git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: [RFC/PATCH] gitweb: Add "all parents" (-m) view to commitdiff
Date: Tue, 24 Oct 2006 00:35:23 +0200	[thread overview]
Message-ID: <200610240035.23963.jnareb@gmail.com> (raw)

Add "all parents" view/link to commitdiff, which uses '-m' to show
diff to all parents of a merge commit.

This is instead of having link "combined" to combined (-c) or compact
combined (--cc) diff for a merge commit, till we have syntax
highlighting for combined diff.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 255487d..84b4abb 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3289,7 +3289,7 @@ sub git_commitdiff {
 			                       hash=>$hash, hash_parent=>$hash_parent)},
 			        "raw");
 
-		if (defined $hash_parent) {
+		if (defined $hash_parent && substr($hash_parent, 0, 1) ne '-') {
 			# commitdiff with two commits given
 			$formats_nav .=
 				' (' .
@@ -3310,6 +3310,15 @@ sub git_commitdiff {
 				')';
 		} else {
 			# merge commit
+			$formats_nav .= ' | ';
+			if (defined $hash_parent && $hash_parent eq '-m') {
+				$formats_nav .= 'all parents';
+			} else {
+				$formats_nav .=
+									$cgi->a({-href => href(action=>"commitdiff",
+					                       hash=>$hash, hash_parent=>'-m')},
+					        'all parents');
+			}
 			$formats_nav .=
 				' (' .
 				join(' ', map {
-- 
1.4.2.1

                 reply	other threads:[~2006-10-23 22:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200610240035.23963.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).