diff options
author | Jakub Narebski <jnareb@gmail.com> | 2007-05-07 01:10:08 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-07 18:20:19 -0700 |
commit | 208ecb2e860364aeffb22eb1f644db077b1c5162 (patch) | |
tree | ce472a862db996b18a72fe6c69e300e8abf6bc0c /gitweb | |
parent | fb1dde4a908ddcfaa884f67734a60dc6bd639b59 (diff) | |
download | git-208ecb2e860364aeffb22eb1f644db077b1c5162.tar.gz |
gitweb: Show combined diff for merge commits in 'commit' view
When commit shown is a merge commit (has more than one parent),
display combined difftree output (result of git-diff-tree -c).
Earlier (since commit 549ab4a30703012ff3a12b5455d319216805a8db)
difftree output (against first parent) was not printed for merges.
Examples of non-trivial merges:
5bac4a671907604b5fb4e24ff682d5b0e8431931 (includes rename)
addafaf92eeb86033da91323d0d3ad7a496dae83 (five parents)
95f97567c1887d77f3a46b42d8622c76414d964d (evil merge)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c0e2473b40..90243fdf98 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -4026,14 +4026,13 @@ sub git_commit { $parent = "--root"; } my @difftree; - if (@$parents <= 1) { - # difftree output is not printed for merges - open my $fd, "-|", git_cmd(), "diff-tree", '-r', "--no-commit-id", - @diff_opts, $parent, $hash, "--" - or die_error(undef, "Open git-diff-tree failed"); - @difftree = map { chomp; $_ } <$fd>; - close $fd or die_error(undef, "Reading git-diff-tree failed"); - } + open my $fd, "-|", git_cmd(), "diff-tree", '-r', "--no-commit-id", + @diff_opts, + (@$parents <= 1 ? $parent : '-c'), + $hash, "--" + or die_error(undef, "Open git-diff-tree failed"); + @difftree = map { chomp; $_ } <$fd>; + close $fd or die_error(undef, "Reading git-diff-tree failed"); # non-textual hash id's can be cached my $expires; @@ -4111,10 +4110,7 @@ sub git_commit { git_print_log($co{'comment'}); print "</div>\n"; - if (@$parents <= 1) { - # do not output difftree/whatchanged for merges - git_difftree_body(\@difftree, $hash, $parent); - } + git_difftree_body(\@difftree, $hash, @$parents); git_footer_html(); } |