{"thread":{"id":"12763","subject":"[PATCH] gitweb: Remove commit title from comitdiff_plain body","startedAt":"2008-03-19T22:28:58Z","lastAt":"2008-03-19T22:35:37Z","messageCount":2,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72429","messageId":"20080319222858.733.79714.stgit@localhost.localdomain","threadId":"12763","inReplyTo":null,"subject":"[PATCH] gitweb: Remove commit title from comitdiff_plain body","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-19T22:28:58Z","receivedAt":"2008-03-19T22:28:58Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\n\nRemove commit title (first line of commit message) from the \"body\" of\ncommitdiff_plain view: it is present there already in format-patch\nlike Subject: header.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n\n gitweb/gitweb.perl |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex ec73cb1..6e3ab85 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -5122,8 +5122,11 @@ sub git_commitdiff {\n \t\tprint \"Subject: \" . to_utf8($co{'title'}) . \"\\n\";\n \n \t\tprint \"X-Git-Tag: $tagname\\n\" if $tagname;\n-\t\tprint \"X-Git-Url: \" . $cgi->self_url() . \"\\n\\n\";\n+\t\tprint \"X-Git-Url: \" . $cgi->self_url() . \"\\n\";\n \n+\t\t# remove title, i.e. first line of log\n+\t\tshift @{$co{'comment'}};\n+\t\t# leading empty lines would separate headers from body\n \t\tforeach my $line (@{$co{'comment'}}) {\n \t\t\tprint to_utf8($line) . \"\\n\";\n \t\t}\n"},{"id":"72431","messageId":"7vk5jy1gw6.fsf@gitster.siamese.dyndns.org","threadId":"12763","inReplyTo":"20080319222858.733.79714.stgit@localhost.localdomain","subject":"Re: [PATCH] gitweb: Remove commit title from comitdiff_plain body","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-19T22:35:37Z","receivedAt":"2008-03-19T22:35:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Remove commit title (first line of commit message) from the \"body\" of\n> commitdiff_plain view: it is present there already in format-patch\n> like Subject: header.\n>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n>\n>  gitweb/gitweb.perl |    5 ++++-\n>  1 files changed, 4 insertions(+), 1 deletions(-)\n>\n>\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index ec73cb1..6e3ab85 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -5122,8 +5122,11 @@ sub git_commitdiff {\n>  \t\tprint \"Subject: \" . to_utf8($co{'title'}) . \"\\n\";\n>  \n>  \t\tprint \"X-Git-Tag: $tagname\\n\" if $tagname;\n> -\t\tprint \"X-Git-Url: \" . $cgi->self_url() . \"\\n\\n\";\n> +\t\tprint \"X-Git-Url: \" . $cgi->self_url() . \"\\n\";\n>  \n> +\t\t# remove title, i.e. first line of log\n> +\t\tshift @{$co{'comment'}};\n> +\t\t# leading empty lines would separate headers from body\n>  \t\tforeach my $line (@{$co{'comment'}}) {\n>  \t\t\tprint to_utf8($line) . \"\\n\";\n>  \t\t}\n\nYou seem to be assuming messages that follow git convention, but is it a\ngood assumption here?  E.g. is the first element of @[$co{'comment'}]\nalways known to be non blank?  is the second element guaranteed to be\nempty?\n"}]}