Do not show difftree against first parent for merges (commits with
more than one parent) in "commit" view, because it usually is
misleading. git-show and git-whatchanged doesn't show diff for merges
either.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 040ee71..ebf35a1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3572,14 +3572,19 @@ sub git_commit {
my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});
my $parent = $co{'parent'};
+ my $parents = $co{'parents'};
if (!defined $parent) {
$parent = "--root";
}
- open my $fd, "-|", git_cmd(), "diff-tree", '-r', "--no-commit-id",
- @diff_opts, $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");
+ 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");
+ }
# non-textual hash id's can be cached
my $expires;
@@ -3641,7 +3646,7 @@ sub git_commit {
}
print "</td>" .
"</tr>\n";
- my $parents = $co{'parents'};
+
foreach my $par (@$parents) {
print "<tr>" .
"<td>parent</td>" .
@@ -3663,7 +3668,10 @@ sub git_commit {
git_print_log($co{'comment'});
print "</div>\n";
- git_difftree_body(\@difftree, $hash, $parent);
+ if (@$parents <= 1) {
+ # do not output difftree/whatchanged for merges
+ git_difftree_body(\@difftree, $hash, $parent);
+ }
git_footer_html();
}
--
1.4.4.1
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Eduard - Gabriel Munteanu | [PATCH 0/5] kmemtrace |
| Greg KH | Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scan... |
| Borislav Petkov | [PATCH 00/18] misc generic ide stuff |
git: | |
| Jon Smirl | Something is broken in repack |
| Thomas Glanzmann | fatal: serious inflate inconsistency |
| Wink Saville | git-svn segmetation fault |
| Petko Manolov | git and binary files |
| Paul Moore | [RFC PATCH v4 00/14] Labeled networking patches for 2.6.28 |
| David Fries | [PATCH] ne.c fix for hibernate and rmmod oops fix |
| Jeff Kirsher | [PATCH 1/3] e1000e: add support for the 82567LM-4 device |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Bill Day | telnet: Unable to connect to remote host: Network is unreachable |
| Doug Evans | Re: Stabilizing Linux |
| Nhut Nguyen | [Query] Trying to locate BOOTACT. |
| Soft lock bug | 3 hours ago | Linux kernel |
| kernel module to intercept socket creation | 9 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 9 hours ago | Linux kernel |
| Question on swap as ramdisk partition | 11 hours ago | Linux kernel |
| serial driver xmit problem | 16 hours ago | Linux kernel |
| Generic Netlink subsytem | 16 hours ago | Linux kernel |
| 'Report spam filter error' page broken | 18 hours ago | KernelTrap Suggestions and Feedback |
| Netfilter kernel module | 1 day ago | Linux kernel |
| Why Windows is better than Linux | 1 day ago | Linux general |
| How can I see my kernel messages in vt12? | 1 day ago | Linux kernel |
