summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 493e01d)
raw | patch | inline | side by side (parent: 493e01d)
author | Jakub Narebski <jnareb@gmail.com> | |
Sun, 6 May 2007 23:10:07 +0000 (01:10 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 8 May 2007 01:20:19 +0000 (18:20 -0700) |
When 'commitdiff' action is requested without 'hp' (hash parent)
parameter, and commit given by 'h' (hash) parameter is merge commit,
show merge as combined diff.
Earlier for merge commits without 'hp' parameter diff to first parent
was shown.
Note that in compact combined (--cc) format 'uninteresting' hunks
omission mechanism can make that there is no patch corresponding to
line in raw format (difftree) output. That is why (at least for now)
we use --combined and not --cc format for showing commitdiff for merge
commits.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
parameter, and commit given by 'h' (hash) parameter is merge commit,
show merge as combined diff.
Earlier for merge commits without 'hp' parameter diff to first parent
was shown.
Note that in compact combined (--cc) format 'uninteresting' hunks
omission mechanism can make that there is no patch corresponding to
line in raw format (difftree) output. That is why (at least for now)
we use --combined and not --cc format for showing commitdiff for merge
commits.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
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 b3e2e07a2bd06659dc602fcbdd57fb43b21c3fab..c0e2473b40775b37a29adb666d43be06337dd790 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
}
+ my $hash_parent_param = $hash_parent;
if (!defined $hash_parent) {
- $hash_parent = $co{'parent'} || '--root';
+ $hash_parent_param =
+ @{$co{'parents'}} > 1 ? '-c' : $co{'parent'} || '--root';
}
# read commitdiff
if ($format eq 'html') {
open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
"--no-commit-id", "--patch-with-raw", "--full-index",
- $hash_parent, $hash, "--"
+ $hash_parent_param, $hash, "--"
or die_error(undef, "Open git-diff-tree failed");
while (my $line = <$fd>) {
} elsif ($format eq 'plain') {
open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
- '-p', $hash_parent, $hash, "--"
+ '-p', $hash_parent_param, $hash, "--"
or die_error(undef, "Open git-diff-tree failed");
} else {
# write patch
if ($format eq 'html') {
- git_difftree_body(\@difftree, $hash, $hash_parent);
+ git_difftree_body(\@difftree, $hash, $hash_parent || @{$co{'parents'}});
print "<br/>\n";
- git_patchset_body($fd, \@difftree, $hash, $hash_parent);
+ git_patchset_body($fd, \@difftree, $hash, $hash_parent || @{$co{'parents'}});
close $fd;
print "</div>\n"; # class="page_body"
git_footer_html();