All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitweb: Do not show 'patch' link in 'commit' view for merges
@ 2009-09-30 20:21 Jakub Narebski
  2009-10-01  3:11 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2009-09-30 20:21 UTC (permalink / raw)
  To: git

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 <jnareb@gmail.com>
---
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");

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-10  1:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-30 20:21 [PATCH] gitweb: Do not show 'patch' link in 'commit' view for merges Jakub Narebski
2009-10-01  3:11 ` Jeff King
2009-10-01  7:36   ` Jakub Narebski
2009-10-01  7:55     ` Jeff King
2009-10-01  9:18       ` Jakub Narebski
2009-10-09 12:10         ` [PATCH v2] gitweb: Do not show 'patch' link for merge commits Jakub Narebski
2009-10-09 12:23           ` Jakub Narebski
2009-10-09 12:26             ` [PATCH v2 (amend)] " Jakub Narebski
2009-10-09 19:19               ` Jeff King
2009-10-10  0:56               ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.