summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 756bbf5)
raw | patch | inline | side by side (parent: 756bbf5)
author | Robert Fitzsimons <robfitz@273k.net> | |
Sun, 24 Dec 2006 14:31:43 +0000 (14:31 +0000) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 25 Dec 2006 18:40:43 +0000 (10:40 -0800) |
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>
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>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6bd57a4e3246e981805ac2ddbf3b33ec5dcbc189..c645686a7425079b6d19d5ef1624f8461af3ccd2 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
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;
if (!defined $co{'tree'}) {
return;
};
+ $co{'parents'} = \@parents;
+ $co{'parent'} = $parents[0];
foreach my $title (@commit_lines) {
$title =~ s/^ //;
open my $fd, "-|", git_cmd(), "rev-list",
"--header",
- "--parents",
"--max-count=1",
$commit_id,
"--",
open my $fd, "-|", git_cmd(), "rev-list",
"--header",
- "--parents",
($arg ? ($arg) : ()),
("--max-count=" . $maxcount),
# Add once rev-list supports the --skip option