Thread (10 messages) flat view 10 messages, 3 authors, 2016-06-15
STALE3731d

[PATCH] gitweb: Do not show 'patch' link in 'commit' view for merges

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:47:28
Subsystem: the rest · Maintainer: Linus Torvalds

Show 'patch' link in the 'commit' view only for commits which have
exactly one parent, otherwise call to git-format-patch would fail for
the hyperlinked 'patch' action.

Signed-off-by: Jakub Narebski <redacted>
---
Just noticed this issue, thanks indirectly to 
"Re: How can I download a git commit as a diff patch?"
thread.

This is conservative change: perhaps we could extend 'patch' view to
work also for root commit...

 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 24b2193..fb045a1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5328,7 +5328,7 @@ sub git_commit {
 			} @$parents ) .
 			')';
 	}
-	if (gitweb_check_feature('patches')) {
+	if (gitweb_check_feature('patches') && @$parents == 1) {
 		$formats_nav .= " | " .
 			$cgi->a({-href => href(action=>"patch", -replay=>1)},
 				"patch");
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help