* Re: [RFC] adding support for md5
From: Junio C Hamano @ 2006-08-24 10:34 UTC (permalink / raw)
To: Shawn Pearce; +Cc: git
In-Reply-To: <20060824080807.GG25247@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
>> Except some minor nits, yes.
>>
>> * I would have preferred two patches, one for "master" and one
>> for the C merge-recursive topic (or at least "next").
>
> Doh. I didn't realize this was something you were interested in
> pulling into master.
Applying them directly to "master" does not have much to do with
this.
Of course, if something is obviously the right thing to do, then
I often apply them straight to "master" (or apply them to
"maint" and pull the result into "master"). In other cases, I
prefer to fork off a new series from the tip of the "master"
into a new topic branch. Then merge that into either "pu" (if I
have suspicion that it is not ready for even testing yet) or
"next", and cook there for a while until it is ready.
While being cooked in "next", what happens is that changes to
that specific topic are applied to the tip of the topic branch,
and then pulled into "next", over and over. Many topic branches
are cooked simultaneously that way. So the development history
of "next" is, eh, messy.
I usually test "next", in other words, multiple topics cooking
together. But when some changes are applied to "master" that
might interfere with an older but still not in "master", I pull
"master" into the topic and test that topic alone in isolation.
That way, when a topic matures, we can be reasonably sure that
it can be pulled into "master" without breaking things.
A single patch on top of "next" depends on all existing topics
that may or may not turn out to be useful. That makes such a
patch less useful than otherwise be.
So if a series affects things in "master" and some other things
still not in "master", a preferred way, from my workflow point
of view, is to have at least two patches: one for "master" and
another for the rest. Then what I would do is to fork one topic
off from "master" and apply the former, pull that into "next"
and cook that. That part of the topic can graduate to "master"
without waiting for other topics in "next".
What happens to the rest is a bit more involved. In the case of
the hashcpy() patch, one thing that only exists in "next" was
merge-recursive.c, but the story would be the same if "next" had
more places that used memcpy(a, b, 20) than "master" in a file
that are common in two branches. Ideally, the remainder will be
broken into pieces and applied as a fixup on top of existing
topics (in this case, C merge-recursive topic) and then merged
into "next". This can be either done by applying the remainder
directly on top of the affected topic, or forking a subtopic off
of the affected topic (the latter is useful if the new series
might turn out to be dud -- the original topic will not be
contaminated by bad changes and can graduate to "master" more
easily).
In any case, I've done a split myself and the parts that can be
applied to "master" is now sitting in gl/cleanup topic and the
remainder is sitting in gl/cleanup-next topic which was forked
off from C merge-recursive topic (you can tell where their tips
are by looking at "gitk next" output) and both are merged into
"next".
^ permalink raw reply
* Re: [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff
From: Jakub Narebski @ 2006-08-24 11:10 UTC (permalink / raw)
To: git
In-Reply-To: <7v3bbmhoa2.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Converting "blobdiff" and "blobdiff_plain" format would be much easier
>> if git-diff-tree and friends had -L <label>/--label=<label> option,
>> like GNU diff has.
>
> I am not sure how that would be useful, given that you would
> disect the header line-by-line to colorize anyway.
gitweb could output patch directly (slurp-print) in blobdiff_plain,
if there were -L <label>/--label=<label> option to git-diff. As it is now
git_blobdiff_plain (or git_blobdiff('plain')) would have to process diff
header, replacing hashes by file names.
Anyway to get full information you need commits to diff, not only blobs to
diff, otherwise the mode change information is lost, I think. And then we
would be able to reus git_patchset_body for git_blobdiff...
>> Current patch preserves much of current output; the question is if for
>> example generate if 'plain' format should generate patch which could
>> be appplied by ordinary patch which do not understand git diff
>> extensions (including renaming and copying), as it is done in current
>> version, and if 'html' version should detect renames and copying.
>
> I would say html is definitely for human consumption; does
> anybody cut&paste html patch and expect to apply that? Plain
> format I am easy but probably enabling rename is fine. You can
> edit the header or tell patch to apply to which file anyway, and
> I think the value of being able to view the real changes outweigh
> that inconvenience.
Or I we can add another format/option, 'broken' to git_commitdiff
and friends.
>> * "commitdiff" now products patches with renaming and copying
>> detection (git-diff-tree is invoked with -M and -C options).
>
> You do not have to give -M and -C; a single -C is enough.
> I wonder if -B is also useful as a default (i.e. -B -C).
So -C implies -M?
> For a merge, I often would want to see --cc just like gitk does,
> but it is probably just me.
Planned. The problem is that raw format for --cc differs, and parser
has to be improved (and similarity is lost)
> I do not know we would want to slurp the entier diff in an
> array before processing. Is this easy to streamify by passing
> an pipe fd to the formatting sub?
That was one question I meant to ask: slurp entire diff (process
then output rule) or streamify (streamify larger output for faster
result)? Will do (quite easy).
>> Empty patches (mode changes and pure renames and copying)
>> are not written currently.
>
> That's quite bad.
This can be easily changed. Question: what format? Current "gitweb diff
header" (<filetype>:<sha1 link> -> <filetype>:<sha1 link>) has no place for
that. Can be easily changed.
Another question: do output difftree in commitdiff, like in commit view?
Do write out extended header, perhaps except index line (repeats information
in "gitweb diff header")?
>> * "commitdiff_plain" now only generates X-Git-Tag: line only if there
>> is tag pointing to the current commit.
>
> Hmph...
>
>> ...; besides we are
>> interested rather in tags _preceding_ the commit, and _heads_
>> following the commit.
>
> Interesting observation. When somebody says "feature X was
> introduced in such and such commit", people would want to know (1) the
> point release they are using has the feature -- which means you
> would want to know the earliest tag that comes after the commit,
> or (2) if the branch they are working on already has that
> feature -- which again means if the head follows the commit. So
> I am not sure when preceding tag is interesting...
Qgit and gitk both show "Follows:" listing followed = preceding tag(s).
This answers question if given commit has given feature.
I have planned separating generation of first/all preceding/following
tags/heads (from git_get_references) into subroutines anyway.
I will add 'X-Git-Tag-After:' then.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH 3] gitweb: Show information about incomplete lines in commitdiff
From: Jakub Narebski @ 2006-08-24 11:12 UTC (permalink / raw)
To: git
In-Reply-To: <7vy7teg9gz.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> I do not see much point in
> removal of git_commitdiff_plain.
So should I split git_commitdiff into two subroutines,
or should I left it as it is after
gitweb: Use git-diff-tree patch output for commitdiff
i.e. git_commitdiff('plain') for git_commitdiff_plain?
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* git-daemon hangs after invalid request
From: Timo Hirvonen @ 2006-08-24 12:37 UTC (permalink / raw)
To: git
Hi,
I noticed git-daemon hangs sometimes...
git clone git://example.com/git/repo.git
works just fine but this
git clone git://example.com/git/invalid.git
hangs and I have to hit ^C. It's OK but error message would be nice.
git-daemon outputs these lines to syslog:
Request for '/git/invalid.git'
'/git/invalid.git': unable to chdir or not a git archive
Now if I try to clone the existing repo again
git clone git://example.com/git/repo.git
it hangs. I have to restart git-daemon to get it working again. I
started git-daemon (1.4.2) with --syslog --verbose flags.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply
* Running gitweb under mod_perl
From: Jakub Narebski @ 2006-08-24 12:43 UTC (permalink / raw)
To: git
Could you tell me what should I do to run gitweb under mod_perl,
and not as CGI script? What should I put in Apache configuration
(Apache 2.0.54 if this matters, mod_perl 2.0.1)
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Running gitweb under mod_perl
From: Johannes Schindelin @ 2006-08-24 12:46 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eck6sq$agn$1@sea.gmane.org>
Hi,
On Thu, 24 Aug 2006, Jakub Narebski wrote:
> Could you tell me what should I do to run gitweb under mod_perl,
> and not as CGI script? What should I put in Apache configuration
> (Apache 2.0.54 if this matters, mod_perl 2.0.1)
I have not checked closely, but it seems that git-instaweb supports
mod_perl. Maybe you can find out what you have to do by inspecting
git-instaweb?
Hth,
Dscho
^ permalink raw reply
* Re: git cherry-pick feature request
From: Paul Mackerras @ 2006-08-24 12:54 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vhd02bn64.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano writes:
> The combined diff (-c and --cc) comparison works by comparing a
> single post-image (merge result) with multiple pre-images, so I
> think it is reasonable to compare the working tree files as the
> post-image and cached and HEAD-tree versions as the preimages.
Yes, I think that is probably the most useful way around.
> I am not sure how useful this would be though -- I am guessing
> that in most people's workflow the index and the HEAD would
> exactly match most of the time, since that is the way Linus
> encourages (and I follow that myself). So for that extreme use
> case, the difference between "diff-index HEAD" and the proposed
> command (I am thinking about calling it git-diff-status) would
> be that the latter always has two plus or minus signs instead of
> one, and lines with a single plus or minus would be an
> indication that HEAD and index have drifted. In other words,
> the largest benefit of "combined diff" which is to simplify
> trivial "The result took this one not that one wholesale"
> differences would not be felt.
The tool I am writing knows whether the index matches the HEAD or the
working directory, and uses a simple git diff-index -p in those
cases. The only time when the 3-way diff would be needed is when the
user wants to commit a subset of the changes in the working version,
because then the index (== changes to be committed) would be different
from both the HEAD and the working directory.
I could just do the two diffs and combine them in Tcl; I have done
that sort of thing in dirdiff. It gets a bit complicated though, and
given that we already have C code for an N-way diff, I thought it made
sense to reuse it.
Thanks,
Paul.
^ permalink raw reply
* Re: Running gitweb under mod_perl
From: Dennis Stosberg @ 2006-08-24 14:05 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eck6sq$agn$1@sea.gmane.org>
Jakub Narebski wrote:
> Could you tell me what should I do to run gitweb under mod_perl,
> and not as CGI script?
About two months ago I sent a set of three patches that made gitweb
run with Apache::Registry:
http://marc.theaimsgroup.com/?l=git&m=115089541911624
The first two patches have found their way into git, so the only
thing left to do is to change the way the path to the git repository
is passed to the git commands.
I haven't updated that patch since then and with all the refactoring
gitweb has seen it surely won't apply anymore, but if there's
interest I can rebase it to current "next".
> What should I put in Apache configuration (Apache 2.0.54 if this
> matters, mod_perl 2.0.1)
>From my configuration:
<Directory /home/dennis/public_html/perl>
Options -Indexes +ExecCGI
AllowOverride None
PerlSendHeader On
SetHandler perl-script
PerlHandler ModPerl::Registry
</Directory>
Regards,
Dennis
^ permalink raw reply
* [PATCH] gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}
From: Dennis Stosberg @ 2006-08-24 15:12 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <20060824140525.G638085b@leonov.stosberg.net>
This makes it possible to run gitweb under mod_perl's Apache::Registry.
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---
Gitweb has changed a lot since I last looked into it two months ago,
so this patch is a little different from the former one. Only very
superficially tested, but seems to work well.
gitweb/gitweb.perl | 73 +++++++++++++++++++++++++++++-----------------------
1 files changed, 41 insertions(+), 32 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ae13e3e..73b3663 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -65,6 +65,9 @@ require $GITWEB_CONFIG if -e $GITWEB_CON
# version of the core git binary
our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
+# path to the current git repository
+our $git_dir;
+
$projects_list ||= $projectroot;
if (! -d $git_temp) {
mkdir($git_temp, 0700) || die_error(undef, "Couldn't mkdir $git_temp");
@@ -99,7 +102,7 @@ if (defined $project && $project) {
if (!(-e "$projectroot/$project/HEAD")) {
die_error(undef, "No such project");
}
- $ENV{'GIT_DIR'} = "$projectroot/$project";
+ $git_dir = "$projectroot/$project";
} else {
git_project_list();
exit;
@@ -375,21 +378,26 @@ sub git_get_referencing {
## ----------------------------------------------------------------------
## git utility subroutines, invoking git commands
+# returns path to the core git executable and the --git-dir parameter
+sub git_cmd {
+ return $GIT, '--git-dir='.$git_dir;
+}
+
# get HEAD ref of given project as hash
sub git_read_head {
my $project = shift;
- my $oENV = $ENV{'GIT_DIR'};
+ my $o_git_dir = $git_dir;
my $retval = undef;
- $ENV{'GIT_DIR'} = "$projectroot/$project";
- if (open my $fd, "-|", $GIT, "rev-parse", "--verify", "HEAD") {
+ $git_dir = "$projectroot/$project";
+ if (open my $fd, "-|", git_cmd(), "rev-parse", "--verify", "HEAD") {
my $head = <$fd>;
close $fd;
if (defined $head && $head =~ /^([0-9a-fA-F]{40})$/) {
$retval = $1;
}
}
- if (defined $oENV) {
- $ENV{'GIT_DIR'} = $oENV;
+ if (defined $o_git_dir) {
+ $git_dir = $o_git_dir;
}
return $retval;
}
@@ -398,7 +406,7 @@ # get type of given object
sub git_get_type {
my $hash = shift;
- open my $fd, "-|", $GIT, "cat-file", '-t', $hash or return;
+ open my $fd, "-|", git_cmd(), "cat-file", '-t', $hash or return;
my $type = <$fd>;
close $fd or return;
chomp $type;
@@ -412,7 +420,8 @@ sub git_get_project_config {
$key =~ s/^gitweb\.//;
return if ($key =~ m/\W/);
- my $val = qx($GIT repo-config --get gitweb.$key);
+ my $git_command = join(' ', git_cmd());
+ my $val = qx($git_command repo-config --get gitweb.$key);
return ($val);
}
@@ -431,7 +440,7 @@ sub git_get_hash_by_path {
my $tree = $base;
- open my $fd, "-|", $GIT, "ls-tree", $base, "--", $path
+ open my $fd, "-|", git_cmd(), "ls-tree", $base, "--", $path
or die_error(undef, "Open git-ls-tree failed");
my $line = <$fd>;
close $fd or return undef;
@@ -566,7 +575,7 @@ sub git_read_tag {
my %tag;
my @comment;
- open my $fd, "-|", $GIT, "cat-file", "tag", $tag_id or return;
+ open my $fd, "-|", git_cmd(), "cat-file", "tag", $tag_id or return;
$tag{'id'} = $tag_id;
while (my $line = <$fd>) {
chomp $line;
@@ -607,7 +616,7 @@ sub git_read_commit {
@commit_lines = @$commit_text;
} else {
$/ = "\0";
- open my $fd, "-|", $GIT, "rev-list", "--header", "--parents", "--max-count=1", $commit_id or return;
+ open my $fd, "-|", git_cmd(), "rev-list", "--header", "--parents", "--max-count=1", $commit_id or return;
@commit_lines = split '\n', <$fd>;
close $fd or return;
$/ = "\n";
@@ -1219,7 +1228,7 @@ sub git_diff_print {
if (defined $from) {
$from_tmp = "$git_temp/gitweb_" . $$ . "_from";
open my $fd2, "> $from_tmp";
- open my $fd, "-|", $GIT, "cat-file", "blob", $from;
+ open my $fd, "-|", git_cmd(), "cat-file", "blob", $from;
my @file = <$fd>;
print $fd2 @file;
close $fd2;
@@ -1230,7 +1239,7 @@ sub git_diff_print {
if (defined $to) {
$to_tmp = "$git_temp/gitweb_" . $$ . "_to";
open my $fd2, "> $to_tmp";
- open my $fd, "-|", $GIT, "cat-file", "blob", $to;
+ open my $fd, "-|", git_cmd(), "cat-file", "blob", $to;
my @file = <$fd>;
print $fd2 @file;
close $fd2;
@@ -1292,7 +1301,7 @@ sub git_project_list {
if (!defined $head) {
next;
}
- $ENV{'GIT_DIR'} = "$projectroot/$pr->{'path'}";
+ $git_dir = "$projectroot/$pr->{'path'}";
my %co = git_read_commit($head);
if (!%co) {
next;
@@ -1418,7 +1427,7 @@ sub git_summary {
"<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n" .
"</table>\n";
- open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_read_head($project)
+ open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17", git_read_head($project)
or die_error(undef, "Open git-rev-list failed");
my @revlist = map { chomp; $_ } <$fd>;
close $fd;
@@ -1489,7 +1498,7 @@ sub git_blame2 {
if ($ftype !~ "blob") {
die_error("400 Bad Request", "Object is not a blob");
}
- open ($fd, "-|", $GIT, "blame", '-l', $file_name, $hash_base)
+ open ($fd, "-|", git_cmd(), "blame", '-l', $file_name, $hash_base)
or die_error(undef, "Open git-blame failed");
git_header_html();
my $formats_nav =
@@ -1543,7 +1552,7 @@ sub git_blame {
$hash = git_get_hash_by_path($hash_base, $file_name, "blob")
or die_error(undef, "Error lookup file");
}
- open ($fd, "-|", $GIT, "annotate", '-l', '-t', '-r', $file_name, $hash_base)
+ open ($fd, "-|", git_cmd(), "annotate", '-l', '-t', '-r', $file_name, $hash_base)
or die_error(undef, "Open git-annotate failed");
git_header_html();
my $formats_nav =
@@ -1654,7 +1663,7 @@ sub git_blob_plain {
}
}
my $type = shift;
- open my $fd, "-|", $GIT, "cat-file", "blob", $hash
+ open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(undef, "Couldn't cat $file_name, $hash");
$type ||= git_blob_plain_mimetype($fd, $file_name);
@@ -1687,7 +1696,7 @@ sub git_blob {
}
}
my $have_blame = git_get_project_config_bool ('blame');
- open my $fd, "-|", $GIT, "cat-file", "blob", $hash
+ open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(undef, "Couldn't cat $file_name, $hash");
my $mimetype = git_blob_plain_mimetype($fd, $file_name);
if ($mimetype !~ m/^text\//) {
@@ -1740,7 +1749,7 @@ sub git_tree {
}
}
$/ = "\0";
- open my $fd, "-|", $GIT, "ls-tree", '-z', $hash
+ open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash
or die_error(undef, "Open git-ls-tree failed");
my @entries = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading tree failed");
@@ -1821,7 +1830,7 @@ sub git_log {
my $refs = read_info_ref();
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
- open my $fd, "-|", $GIT, "rev-list", $limit, $hash
+ open my $fd, "-|", git_cmd(), "rev-list", $limit, $hash
or die_error(undef, "Open git-rev-list failed");
my @revlist = map { chomp; $_ } <$fd>;
close $fd;
@@ -1892,7 +1901,7 @@ sub git_commit {
if (!defined $parent) {
$parent = "--root";
}
- open my $fd, "-|", $GIT, "diff-tree", '-r', '-M', $parent, $hash
+ open my $fd, "-|", git_cmd(), "diff-tree", '-r', '-M', $parent, $hash
or die_error(undef, "Open git-diff-tree failed");
my @difftree = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading git-diff-tree failed");
@@ -2116,7 +2125,7 @@ sub git_commitdiff {
if (!defined $hash_parent) {
$hash_parent = $co{'parent'} || '--root';
}
- open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
+ open my $fd, "-|", git_cmd(), "diff-tree", '-r', $hash_parent, $hash
or die_error(undef, "Open git-diff-tree failed");
my @difftree = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading git-diff-tree failed");
@@ -2207,7 +2216,7 @@ sub git_commitdiff_plain {
if (!defined $hash_parent) {
$hash_parent = $co{'parent'} || '--root';
}
- open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
+ open my $fd, "-|", git_cmd(), "diff-tree", '-r', $hash_parent, $hash
or die_error(undef, "Open git-diff-tree failed");
my @difftree = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading diff-tree failed");
@@ -2215,7 +2224,7 @@ sub git_commitdiff_plain {
# try to figure out the next tag after this commit
my $tagname;
my $refs = read_info_ref("tags");
- open $fd, "-|", $GIT, "rev-list", "HEAD";
+ open $fd, "-|", git_cmd(), "rev-list", "HEAD";
my @commits = map { chomp; $_ } <$fd>;
close $fd;
foreach my $commit (@commits) {
@@ -2284,7 +2293,7 @@ sub git_history {
git_print_page_path($file_name, $ftype);
open my $fd, "-|",
- $GIT, "rev-list", "--full-history", $hash_base, "--", $file_name;
+ git_cmd(), "rev-list", "--full-history", $hash_base, "--", $file_name;
print "<table cellspacing=\"0\">\n";
my $alternate = 0;
while (my $line = <$fd>) {
@@ -2358,7 +2367,7 @@ sub git_search {
my $alternate = 0;
if ($commit_search) {
$/ = "\0";
- open my $fd, "-|", $GIT, "rev-list", "--header", "--parents", $hash or next;
+ open my $fd, "-|", git_cmd(), "rev-list", "--header", "--parents", $hash or next;
while (my $commit_text = <$fd>) {
if (!grep m/$searchtext/i, $commit_text) {
next;
@@ -2408,7 +2417,7 @@ sub git_search {
if ($pickaxe_search) {
$/ = "\n";
- open my $fd, "-|", "$GIT rev-list $hash | $GIT diff-tree -r --stdin -S\'$searchtext\'";
+ open my $fd, "-|", git_cmd()." rev-list $hash | ".git_cmd()." diff-tree -r --stdin -S\'$searchtext\'";
undef %co;
my @files;
while (my $line = <$fd>) {
@@ -2471,7 +2480,7 @@ sub git_shortlog {
my $refs = read_info_ref();
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
- open my $fd, "-|", $GIT, "rev-list", $limit, $hash
+ open my $fd, "-|", git_cmd(), "rev-list", $limit, $hash
or die_error(undef, "Open git-rev-list failed");
my @revlist = map { chomp; $_ } <$fd>;
close $fd;
@@ -2499,7 +2508,7 @@ ## feeds (RSS, OPML)
sub git_rss {
# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
- open my $fd, "-|", $GIT, "rev-list", "--max-count=150", git_read_head($project)
+ open my $fd, "-|", git_cmd(), "rev-list", "--max-count=150", git_read_head($project)
or die_error(undef, "Open git-rev-list failed");
my @revlist = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading git-rev-list failed");
@@ -2520,7 +2529,7 @@ sub git_rss {
last;
}
my %cd = date_str($co{'committer_epoch'});
- open $fd, "-|", $GIT, "diff-tree", '-r', $co{'parent'}, $co{'id'} or next;
+ open $fd, "-|", git_cmd(), "diff-tree", '-r', $co{'parent'}, $co{'id'} or next;
my @difftree = map { chomp; $_ } <$fd>;
close $fd or next;
print "<item>\n" .
@@ -2573,7 +2582,7 @@ sub git_opml {
if (!defined $head) {
next;
}
- $ENV{'GIT_DIR'} = "$projectroot/$proj{'path'}";
+ $git_dir = "$projectroot/$proj{'path'}";
my %co = git_read_commit($head);
if (!%co) {
next;
--
1.4.2
^ permalink raw reply related
* Re: [PATCH 1/18] 2.6.17.9 perfmon2 patch for review: introduction
From: Junio C Hamano @ 2006-08-24 17:38 UTC (permalink / raw)
To: git; +Cc: Andrew Morton, Alexey Dobriyan, Stephane Eranian, linux-kernel,
eranian
In-Reply-To: <20060823115857.89f8d47b.akpm@osdl.org>
Andrew Morton <akpm@osdl.org> writes:
> On Wed, 23 Aug 2006 17:04:58 +0100
> Christoph Hellwig <hch@infradead.org> wrote:
>
>> > Padding with zeros makes it even more useful:
>> >
>> > [PATCH 00/17]
>> > [PATCH 01/17]
>> > ...
>> > [PATCH 17/17]
>>
>> To be honest I utterly hate that convention
>
> It's so they'll correctly alphasort at the recipient's end.
>
> I doubt if many MUAs do numeric sorting..
I wonder if 'git-format-patch --numbered' should be updated to
do the zero padding. Right now we don't.
It should be a trivial patch to do if somebody is so inclined
(it is around ll.133 in log-tree.c).
^ permalink raw reply
* [PATCH 4] gitweb: Remove invalid comment in format_diff_line
From: Jakub Narebski @ 2006-08-24 17:32 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch and all subsequent patches assumes (although this should
have no bearing) that patch
[PATCH 2] gitweb: Replace git_commitdiff_plain by anonymous subroutine
was not applied. (In my repository this commit had been simply reverted).
gitweb/gitweb.perl | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fe9b9ee..1d3d9df 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -538,7 +538,6 @@ sub format_diff_line {
} elsif ($char eq "@") {
$diff_class = " chunk_header";
} elsif ($char eq "\\") {
- # skip errors (incomplete lines)
$diff_class = " incomplete";
}
$line = untabify($line);
--
1.4.1.1
^ permalink raw reply related
* [PATCH 5] gitweb: Streamify patch output in git_commitdiff
From: Jakub Narebski @ 2006-08-24 17:34 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Change output of patch(set) in git_commitdiff from slurping whole diff
in @patchset array before processing, to passing file descriptor to
git_patchset_body.
Advantages: faster, incremental output, smaller memory footprint.
Disadvantages: cannot react when there is error during closing file
descriptor.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Junio C Hamano wrote:
> I do not know we would want to slurp the entier diff in an
> array before processing. Is this easy to streamify by passing
> an pipe fd to the formatting sub?
This patch adresses that.
gitweb/gitweb.perl | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1d3d9df..d72b19a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1539,7 +1539,7 @@ sub git_difftree_body {
}
sub git_patchset_body {
- my ($patchset, $difftree, $hash, $hash_parent) = @_;
+ my ($fd, $difftree, $hash, $hash_parent) = @_;
my $patch_idx = 0;
my $in_header = 0;
@@ -1548,7 +1548,9 @@ sub git_patchset_body {
print "<div class=\"patchset\">\n";
- LINE: foreach my $patch_line (@$patchset) {
+ LINE:
+ while (my $patch_line = <$fd>) {
+ chomp $patch_line;
if ($patch_line =~ m/^diff /) { # "git diff" header
# beginning of patch (in patchset)
@@ -2727,7 +2729,6 @@ sub git_commitdiff {
# read commitdiff
my $fd;
my @difftree;
- my @patchset;
if ($format eq 'html') {
open $fd, "-|", $GIT, "diff-tree", '-r', '-M', '-C',
"--patch-with-raw", "--full-index", $hash_parent, $hash
@@ -2738,13 +2739,11 @@ sub git_commitdiff {
last unless $line;
push @difftree, $line;
}
- @patchset = map { chomp; $_ } <$fd>;
- close $fd
- or die_error(undef, "Reading git-diff-tree failed");
} elsif ($format eq 'plain') {
open $fd, "-|", $GIT, "diff-tree", '-r', '-p', '-B', $hash_parent, $hash
or die_error(undef, "Open git-diff-tree failed");
+
} else {
die_error(undef, "Unknown commitdiff format");
}
@@ -2806,7 +2805,8 @@ TEXT
#git_difftree_body(\@difftree, $hash, $hash_parent);
#print "<br/>\n";
- git_patchset_body(\@patchset, \@difftree, $hash, $hash_parent);
+ git_patchset_body($fd, \@difftree, $hash, $hash_parent);
+ close $fd;
print "</div>\n"; # class="page_body"
git_footer_html();
--
1.4.1.1
^ permalink raw reply related
* [PATCH 6] gitweb: Add git_get_{following,preceding}_references functions
From: Jakub Narebski @ 2006-08-24 17:37 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Adds git_get_following_references function, based on code which was
used in git_commitdiff_plain to generate X-Git-Tag: header,
and companion git_get_preceding_references function.
Both functions return array of all references of given type (as
returned by git_get_references) following/preceding given commit in
array (list) context, and last following/first preceding ref in scalar
context.
Stripping ref (list of refs) of "$type/" (e.g. "tags/") is left to
caller.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Junio C Hamano wrote:
>> * "commitdiff_plain" now only generates X-Git-Tag: line only if
>> there is tag pointing to the current commit.
>
> Hmph...
>
>> ...; besides we are
>> interested rather in tags _preceding_ the commit, and _heads_
>> following the commit.
>
> Interesting observation. When somebody says "feature X was
> introduced in such and such commit", people would want to know (1)
> the point release they are using has the feature -- which means you
> would want to know the earliest tag that comes after the commit, or
> (2) if the branch they are working on already has that
> feature -- which again means if the head follows the commit. So
> I am not sure when preceding tag is interesting...
Actually, the two following patches adresses this, not this patch...
gitweb/gitweb.perl | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d72b19a..2d3776a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -749,6 +749,58 @@ sub git_get_references {
return \%refs;
}
+sub git_get_following_references {
+ my $hash = shift || return undef;
+ my $type = shift;
+ my $base = shift || $hash_base || "HEAD";
+
+ my $refs = git_get_references($type);
+ open my $fd, "-|", $GIT, "rev-list", $base
+ or return undef;
+ my @commits = map { chomp; $_ } <$fd>;
+ close $fd
+ or return undef;
+
+ my @reflist;
+ my $lastref;
+
+ foreach my $commit (@commits) {
+ foreach my $ref (@{$refs->{$commit}}) {
+ $lastref = $ref;
+ push @reflist, $lastref;
+ }
+ if ($commit eq $hash) {
+ last;
+ }
+ }
+
+ return wantarray ? @reflist : $lastref;
+}
+
+sub git_get_preceding_references {
+ my $hash = shift || return undef;
+ my $type = shift;
+
+ my $refs = git_get_references($type);
+ open my $fd, "-|", $GIT, "rev-list", $hash
+ or return undef;
+ my @commits = map { chomp; $_ } <$fd>;
+ close $fd
+ or return undef;
+
+ my @reflist;
+ my $firstref;
+
+ foreach my $commit (@commits) {
+ foreach my $ref (@{$refs->{$commit}}) {
+ $firstref = $ref unless $firstref;
+ push @reflist, $ref;
+ }
+ }
+
+ return wantarray ? @reflist : $firstref;
+}
+
## ----------------------------------------------------------------------
## parse to hash functions
--
1.4.1.1
^ permalink raw reply related
* [PATCH 9] gitweb: Use git_get_name_rev_tags for commitdiff_plain X-Git-Tag: header
From: Jakub Narebski @ 2006-08-24 17:45 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Use git_get_rev_name_tags function for X-Git-Tag: header in
git_commitdiff('plain'), i.e. for commitdiff_plain action.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
For example, commitdiff_plain for 6c7f4cebdb40c0d95c63d59538fd235dcf978029
commit -- the following query string:
a=commitdiff_plain;p=git.git;h=6c7f4cebdb40c0d95c63d59538fd235dcf978029
outputs the following X-Git-Tag: header:
X-Git-Tag: v1.4.2^0~2
gitweb/gitweb.perl | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3bc3ff3..b2e8259 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2840,10 +2840,7 @@ sub git_commitdiff {
} elsif ($format eq 'plain') {
my $refs = git_get_references("tags");
- my @tagnames;
- if (exists $refs->{$hash}) {
- @tagnames = map { s|^tags/|| } $refs->{$hash};
- }
+ my $tagname = git_get_rev_name_tags($hash);
my $filename = basename($project) . "-$hash.patch";
print $cgi->header(
@@ -2857,10 +2854,9 @@ From: $co{'author'}
Date: $ad{'rfc2822'} ($ad{'tz_local'})
Subject: $co{'title'}
TEXT
- foreach my $tag (@tagnames) {
- print "X-Git-Tag: $tag\n";
- }
+ print "X-Git-Tag: $tagname\n" if $tagname;
print "X-Git-Url: " . $cgi->self_url() . "\n\n";
+
foreach my $line (@{$co{'comment'}}) {
print "$line\n";
}
--
1.4.1.1
^ permalink raw reply related
* [PATCH 7] gitweb: Faster return from git_get_preceding_references if possible
From: Jakub Narebski @ 2006-08-24 17:39 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Return on first ref found when git_get_preceding_references
is called in scalar context
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Jakub Narebski wrote:
> Actually, the two following patches adresses this, not this patch...
The two following this patch...
gitweb/gitweb.perl | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 2d3776a..a068a81 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -789,16 +789,15 @@ sub git_get_preceding_references {
or return undef;
my @reflist;
- my $firstref;
foreach my $commit (@commits) {
foreach my $ref (@{$refs->{$commit}}) {
- $firstref = $ref unless $firstref;
+ return $ref unless wantarray;
push @reflist, $ref;
}
}
- return wantarray ? @reflist : $firstref;
+ return @reflist;
}
## ----------------------------------------------------------------------
--
1.4.1.1
^ permalink raw reply related
* [PATCH 8] gitweb: Add git_get_rev_name_tags function
From: Jakub Narebski @ 2006-08-24 17:41 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Add git_get_rev_name_tags function, for later use in
git_commitdiff('plain') for X-Git-Tag: header.
This function, contrary to the call to
git_get_following_references($hash, "tags");
_does_ strip "tags/" and returns bare tag name.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Junio C Hamano wrote:
>> * "commitdiff_plain" now only generates X-Git-Tag: line only if
>> there is tag pointing to the current commit.
>
> Hmph...
>
>> ...; besides we are
>> interested rather in tags _preceding_ the commit, and _heads_
>> following the commit.
>
> Interesting observation. When somebody says "feature X was
> introduced in such and such commit", people would want to know (1)
> the point release they are using has the feature -- which means you
> would want to know the earliest tag that comes after the commit, or
> (2) if the branch they are working on already has that
> feature -- which again means if the head follows the commit. So
> I am not sure when preceding tag is interesting...
This commit introduces function which does job that was intended
I guess for X-Git-Tag: header... perhaps it should be renamed...
gitweb/gitweb.perl | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a068a81..3bc3ff3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -800,6 +800,22 @@ sub git_get_preceding_references {
return @reflist;
}
+sub git_get_rev_name_tags {
+ my $hash = shift || return undef;
+
+ open my $fd, "-|", $GIT, "name-rev", "--tags", $hash
+ or return;
+ my $name_rev = <$fd>;
+ close $fd;
+
+ if ($name_rev =~ m|^$hash tags/(.*)$|) {
+ return $1;
+ } else {
+ # catches also '$hash undefined' output
+ return undef;
+ }
+}
+
## ----------------------------------------------------------------------
## parse to hash functions
--
1.4.1.1
^ permalink raw reply related
* Re: Running gitweb under mod_perl
From: Jakub Narebski @ 2006-08-24 17:49 UTC (permalink / raw)
To: git
In-Reply-To: <eck6sq$agn$1@sea.gmane.org>
By the way, does the "static" variables works under mod_perl? i.e.
{
my $private_var = "something"
sub some_sub {
...
}
sub other_sub {
...
}
}
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH] cg-commit: Fix a typo that would inhibit running of post-commit script:
From: Jim Meyering @ 2006-08-24 18:19 UTC (permalink / raw)
To: git
I tried cg-commit with a commit hook, but the hook never ran.
The problem was a typo:
Fix a typo that would inhibit running the post-commit script:
s/commit-post/post-commit/.
Signed-off-by: Jim Meyering <jim@meyering.net>
---
cg-commit | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cg-commit b/cg-commit
index 9d3b1a1..82eea60 100755
--- a/cg-commit
+++ b/cg-commit
@@ -604,15 +604,16 @@ if [ "$newhead" ]; then
branchname="$(cat "$_git/branch-name")"
fi
[ -z "$branchname" ] && [ "$_git_head" != "master" ] && branchname="$_git_head"
- if [ -x "$_git/hooks/post-commit" -a ! "$no_hooks" ]; then
+ post_commit="$_git/hooks/post-commit"
+ if [ -x "$post_commit" -a ! "$no_hooks" ]; then
if [ "$(git-repo-config --bool cogito.hooks.commit.post.allmerged)" = "true" ]; then
# We just hope that for the initial commit, the user didn't
# manage to install the hook yet.
for merged in $(git-rev-list $newhead ^$oldhead | tac); do
- "$_git/hooks/post-commit" "$merged" "$branchname"
+ "$post_commit" "$merged" "$branchname"
done
else
- "$_git/hooks/post-commit" "$newhead" "$branchname"
+ "$post_commit" "$newhead" "$branchname"
fi
fi
--
1.4.1.1
^ permalink raw reply related
* Re: [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff
From: Junio C Hamano @ 2006-08-24 18:45 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eck1em$p8b$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
> Junio C Hamano wrote:
>
>> Jakub Narebski <jnareb@gmail.com> writes:
>>
>>> Converting "blobdiff" and "blobdiff_plain" format would be much easier
>>> if git-diff-tree and friends had -L <label>/--label=<label> option,
>>> like GNU diff has.
>>
>> I am not sure how that would be useful, given that you would
>> disect the header line-by-line to colorize anyway.
>
> gitweb could output patch directly (slurp-print) in blobdiff_plain,
> if there were -L <label>/--label=<label> option to git-diff. As it is now
> git_blobdiff_plain (or git_blobdiff('plain')) would have to process diff
> header, replacing hashes by file names.
I do not think gitweb does diff between two arbitrary blobs; in
other words, you only need "diff-tree treeA treeB -- path".
I think feeding object names _is_ what's causing you trouble.
^ permalink raw reply
* [PATCH 10] gitweb: Add support for hash_parent_base parameter for blobdiffs
From: Jakub Narebski @ 2006-08-24 18:50 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Add support for hash_parent_base in input validation part and in
href() function. Add proper hash_parent_base to all calls to blobdiff
and blobdiff_plain action URLs.
To be used in future rewrite of git_blobdiff and git_blobdiff_plain.
While at it, move project before action in ordering CGI parameters in
href().
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Such an easy commitdiff_plain link wouldn't be possible without
href() function, which filters out undefined parameters.
gitweb/gitweb.perl | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b2e8259..b236e1a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -211,6 +211,13 @@ if (defined $hash_base) {
}
}
+our $hash_parent_base = $cgi->param('hpb');
+if (defined $hash_parent_base) {
+ if (!validate_input($hash_parent_base)) {
+ die_error(undef, "Invalid hash parent base parameter");
+ }
+}
+
our $page = $cgi->param('pg');
if (defined $page) {
if ($page =~ m/[^0-9]$/) {
@@ -270,13 +277,14 @@ sub href(%) {
my %params = @_;
my @mapping = (
- action => "a",
project => "p",
+ action => "a",
file_name => "f",
file_parent => "fp",
hash => "h",
hash_parent => "hp",
hash_base => "hb",
+ hash_parent_base => "hpb",
page => "pg",
searchtext => "s",
);
@@ -1543,8 +1551,10 @@ sub git_difftree_body {
}
print "<td>";
if ($diff{'to_id'} ne $diff{'from_id'}) { # modified
- print $cgi->a({-href => href(action=>"blobdiff", hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
- hash_base=>$hash, file_name=>$diff{'file'}),
+ print $cgi->a({-href => href(action=>"blobdiff",
+ hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+ hash_base=>$hash, hash_parent_base=>$parent,
+ file_name=>$diff{'file'}),
-class => "list"}, esc_html($diff{'file'}));
} else { # only mode changed
print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'},
@@ -1559,8 +1569,10 @@ sub git_difftree_body {
"blob");
if ($diff{'to_id'} ne $diff{'from_id'}) { # modified
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
- hash_base=>$hash, file_name=>$diff{'file'})},
+ $cgi->a({-href => href(action=>"blobdiff",
+ hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+ hash_base=>$hash, hash_parent_base=>$parent,
+ file_name=>$diff{'file'})},
"diff");
}
print " | " .
@@ -1592,8 +1604,9 @@ sub git_difftree_body {
"blob");
if ($diff{'to_id'} ne $diff{'from_id'}) {
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash_base=>$hash,
+ $cgi->a({-href => href(action=>"blobdiff",
hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+ hash_base=>$hash, hash_parent_base=>$parent,
file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
"diff");
}
@@ -1793,8 +1806,10 @@ sub git_history_body {
if (defined $blob_current && defined $blob_parent &&
$blob_current ne $blob_parent) {
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash=>$blob_current, hash_parent=>$blob_parent,
- hash_base=>$commit, file_name=>$file_name)},
+ $cgi->a({-href => href(action=>"blobdiff",
+ hash=>$blob_current, hash_parent=>$blob_parent,
+ hash_base=>$hash_base, hash_parent_base=>$commit,
+ file_name=>$file_name)},
"diff to current");
}
}
@@ -2751,7 +2766,9 @@ sub git_blobdiff {
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
my $formats_nav =
$cgi->a({-href => href(action=>"blobdiff_plain",
- hash=>$hash, hash_parent=>$hash_parent)},
+ hash=>$hash, hash_parent=>$hash_parent,
+ hash_base=>$hash_base, hash_parent_base=>$hash_parent_base,
+ file_name=>$file_name, file_parent=>$file_parent)},
"plain");
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
--
1.4.1.1
^ permalink raw reply related
* Re: [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff
From: Jakub Narebski @ 2006-08-24 18:56 UTC (permalink / raw)
To: Junio C Hamano, git
In-Reply-To: <7vzmdu7z1m.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Junio C Hamano wrote:
>>
>>> Jakub Narebski <jnareb@gmail.com> writes:
>>>
>>>> Converting "blobdiff" and "blobdiff_plain" format would be much easier
>>>> if git-diff-tree and friends had -L <label>/--label=<label> option,
>>>> like GNU diff has.
>>>
>>> I am not sure how that would be useful, given that you would
>>> disect the header line-by-line to colorize anyway.
>>
>> gitweb could output patch directly (slurp-print) in blobdiff_plain,
>> if there were -L <label>/--label=<label> option to git-diff. As it is now
>> git_blobdiff_plain (or git_blobdiff('plain')) would have to process diff
>> header, replacing hashes by file names.
>
> I do not think gitweb does diff between two arbitrary blobs; in
> other words, you only need "diff-tree treeA treeB -- path".
gitweb didn't pass parent commit (i.e. treeB) information for blobdiff,
and IIRC passed only blob hashes for blobdiff_plain (and not passed
filename aka path).
> I think feeding object names _is_ what's causing you trouble.
As I said:
>> Anyway to get full information you need commits to diff, not only blobs to
>> diff, otherwise the mode change information is lost, I think. And then we
>> would be able to reuse git_patchset_body for git_blobdiff...
Instead of using hash and hash_parent parameters for tree-ish and
tree_parent-ish hashes (instead of blob hashes as it is now), I have
used in patch (in this thread):
[PATCH 10] gitweb: Add support for hash_parent_base parameter for blobdiffs
hash_base and (newly introduced) hash_parent_base arguments/parameters.
Not used yet, but planned.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Running gitweb under mod_perl
From: Dennis Stosberg @ 2006-08-24 19:32 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eckor9$jje$1@sea.gmane.org>
Jakub Narebski wrote:
> By the way, does the "static" variables works under mod_perl? i.e.
>
> {
> my $private_var = "something"
>
> sub some_sub {
> ...
> }
>
> sub other_sub {
> ...
> }
> }
Depends on what you expect. The variable will remain shared between
those subs over successive executions, but it will not be reinitialised
to "something" -- at least not visibly to the subs:
On the first invocation, $private_var is initialised and the two
subroutines are created. Internally, they refer to the _instance_ of
$private_var. The next time the script is run by mod_perl, $private_var
gets initialised again, but the subs are persistent and still refer to
the old instance. _Their_ copy of the variable will still be shared
between them, but it will not be reset to "something".
So it should work, but I would avoid such a construction if possible.
Apache::Registry wraps the whole script in another function, which
is called on each request, so your piece of code really looks somewhat
like this:
#!/usr/bin/perl
sub handler {
# do something
{
my $a = 'A';
sub sub_a { $a .= 'B' }
sub sub_b { print $a."\n" }
}
sub_a();
sub_b();
}
for(1..10) { handler() }
Regards,
Dennis
^ permalink raw reply
* Re: [PATCH] git-daemon virtual hosting implementation.
From: Jon Loeliger @ 2006-08-24 20:15 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: Junio C Hamano, Git List
In-Reply-To: <200608232256.10108.madcoder@debian.org>
On Wed, 2006-08-23 at 15:56, Pierre Habouzit wrote:
> Another option would be not to support virtual hosts, but instead
> superseed the --base-path and --user-path with some --base-path-fmt
> and --user-path-fmt where the user can specify how to build the path
> with simple sprintf-like formats. One could e.g. support:
> * %% obviously ;
> * %h that will be replaced with the hostname
> * %u (only for --user-path-fmt)
> * %p (asked path)
> * ...
And this is exactly what I have implemented and
running on my system today!
> I think that's more clever, and allow more flexible use of the virtual
> hosting code. It e.g. allow to use the virtual host scheme for the
> `base-path` repos and to disallow it for the users.
>
> --*-path and --*-path-fmt are obviously mutually exclusive.
>
> What do you think ?
I kinda like it... :-)
jdl
^ permalink raw reply
* Re: [PATCH] git-daemon virtual hosting implementation.
From: Junio C Hamano @ 2006-08-24 20:35 UTC (permalink / raw)
To: Jon Loeliger; +Cc: git
In-Reply-To: <1156450516.10054.276.camel@cashmere.sps.mot.com>
Jon Loeliger <jdl@freescale.com> writes:
> On Wed, 2006-08-23 at 15:56, Pierre Habouzit wrote:
>
>> Another option would be not to support virtual hosts, but instead
>> superseed the --base-path and --user-path with some --base-path-fmt
>> and --user-path-fmt where the user can specify how to build the path
>> with simple sprintf-like formats. One could e.g. support:
>> * %% obviously ;
>> * %h that will be replaced with the hostname
>> * %u (only for --user-path-fmt)
>> * %p (asked path)
>> * ...
>
> And this is exactly what I have implemented and
> running on my system today!
Where is the patch ;-)?
^ permalink raw reply
* Re: [PATCH] git-daemon virtual hosting implementation.
From: Jon Loeliger @ 2006-08-24 20:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git List
In-Reply-To: <7vejv598iq.fsf@assigned-by-dhcp.cox.net>
On Thu, 2006-08-24 at 15:35, Junio C Hamano wrote:
> Where is the patch ;-)?
Heh.
Well, I rewrote the interpolation code. As you pointed
out earlier, it was crap. I can send that in; no problem.
There was some outstanding debate if this was actually
the right way to go about things. Specifically, the
problem of canonical hostname. A proposal was to use
peer IP addresses instead, and I just haven't gotten
around to messing with that yet. So that is why I
hadn't sent it in yet. Sorry.
But, I'll rebase it and send it in this evening.
jdl
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox