{"thread":{"id":"6020","subject":"[RFC/PATCH] gitweb: Add \"all parents\" (-m) view to commitdiff","startedAt":"2006-10-23T22:35:23Z","lastAt":"2006-10-23T22:35:23Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"29777","messageId":"200610240035.23963.jnareb@gmail.com","threadId":"6020","inReplyTo":null,"subject":"[RFC/PATCH] gitweb: Add \"all parents\" (-m) view to commitdiff","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-23T22:35:23Z","receivedAt":"2006-10-23T22:35:23Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Add \"all parents\" view/link to commitdiff, which uses '-m' to show\ndiff to all parents of a merge commit.\n\nThis is instead of having link \"combined\" to combined (-c) or compact\ncombined (--cc) diff for a merge commit, till we have syntax\nhighlighting for combined diff.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   11 ++++++++++-\n 1 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 255487d..84b4abb 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3289,7 +3289,7 @@ sub git_commitdiff {\n \t\t\t                       hash=>$hash, hash_parent=>$hash_parent)},\n \t\t\t        \"raw\");\n \n-\t\tif (defined $hash_parent) {\n+\t\tif (defined $hash_parent && substr($hash_parent, 0, 1) ne '-') {\n \t\t\t# commitdiff with two commits given\n \t\t\t$formats_nav .=\n \t\t\t\t' (' .\n@@ -3310,6 +3310,15 @@ sub git_commitdiff {\n \t\t\t\t')';\n \t\t} else {\n \t\t\t# merge commit\n+\t\t\t$formats_nav .= ' | ';\n+\t\t\tif (defined $hash_parent && $hash_parent eq '-m') {\n+\t\t\t\t$formats_nav .= 'all parents';\n+\t\t\t} else {\n+\t\t\t\t$formats_nav .=\n+\t\t\t\t\t\t\t\t\t$cgi->a({-href => href(action=>\"commitdiff\",\n+\t\t\t\t\t                       hash=>$hash, hash_parent=>'-m')},\n+\t\t\t\t\t        'all parents');\n+\t\t\t}\n \t\t\t$formats_nav .=\n \t\t\t\t' (' .\n \t\t\t\tjoin(' ', map {\n-- \n1.4.2.1\n"}]}