aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorRobert Fitzsimons <robfitz@273k.net>2006-12-24 14:31:43 +0000
committerJunio C Hamano <junkio@cox.net>2006-12-25 10:40:43 -0800
commit208b2dff95bb48682c351099023a1cbb0e1edf26 (patch)
tree6148bd6a55d75d3a57604b836a7391f2e08cae72 /gitweb
parent756bbf548dbef5b738c50ce6517f5c63ab929373 (diff)
downloadgit-208b2dff95bb48682c351099023a1cbb0e1edf26.tar.gz
git-208b2dff95bb48682c351099023a1cbb0e1edf26.tar.xz
gitweb: We do longer need the --parents flag in rev-list.
We only want to know the direct parents of a given commit object, these parents are available in the --header output of rev-list. If --parents is supplied with --full-history the output includes merge commits that aren't relevant. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl11
1 files changed, 6 insertions, 5 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6bd57a4e3..c645686a7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1281,13 +1281,14 @@ sub parse_commit_text {
if (!($header =~ m/^[0-9a-fA-F]{40}/)) {
return;
}
- ($co{'id'}, my @parents) = split ' ', $header;
- $co{'parents'} = \@parents;
- $co{'parent'} = $parents[0];
+ $co{'id'} = $header;
+ my @parents;
while (my $line = shift @commit_lines) {
last if $line eq "\n";
if ($line =~ m/^tree ([0-9a-fA-F]{40})$/) {
$co{'tree'} = $1;
+ } elsif ($line =~ m/^parent ([0-9a-fA-F]{40})$/) {
+ push @parents, $1;
} elsif ($line =~ m/^author (.*) ([0-9]+) (.*)$/) {
$co{'author'} = $1;
$co{'author_epoch'} = $2;
@@ -1314,6 +1315,8 @@ sub parse_commit_text {
if (!defined $co{'tree'}) {
return;
};
+ $co{'parents'} = \@parents;
+ $co{'parent'} = $parents[0];
foreach my $title (@commit_lines) {
$title =~ s/^ //;
@@ -1371,7 +1374,6 @@ sub parse_commit {
open my $fd, "-|", git_cmd(), "rev-list",
"--header",
- "--parents",
"--max-count=1",
$commit_id,
"--",
@@ -1414,7 +1416,6 @@ sub parse_commits {
open my $fd, "-|", git_cmd(), "rev-list",
"--header",
- "--parents",
($arg ? ($arg) : ()),
("--max-count=" . $maxcount),
# Add once rev-list supports the --skip option