git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH] gitweb: Add "all parents" (-m) view to commitdiff

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 23, 2006, 22:35 UTC
Message-ID
<200610240035.23963.jnareb@gmail.com>

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
Message 1 of 1 in “gitweb: Add "all parents" (-m) view to commitdiff”
  1. gitweb: Add "all parents" (-m) view to commitdiffJakub Narebski, Oct 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.