git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Remove commit title from comitdiff_plain body
Date: Wed, 19 Mar 2008 15:35:37 -0700	[thread overview]
Message-ID: <7vk5jy1gw6.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080319222858.733.79714.stgit@localhost.localdomain> (Jakub Narebski's message of "Wed, 19 Mar 2008 23:28:58 +0100")

Jakub Narebski <jnareb@gmail.com> writes:

> Remove commit title (first line of commit message) from the "body" of
> commitdiff_plain view: it is present there already in format-patch
> like Subject: header.
>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
>
>  gitweb/gitweb.perl |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ec73cb1..6e3ab85 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -5122,8 +5122,11 @@ sub git_commitdiff {
>  		print "Subject: " . to_utf8($co{'title'}) . "\n";
>  
>  		print "X-Git-Tag: $tagname\n" if $tagname;
> -		print "X-Git-Url: " . $cgi->self_url() . "\n\n";
> +		print "X-Git-Url: " . $cgi->self_url() . "\n";
>  
> +		# remove title, i.e. first line of log
> +		shift @{$co{'comment'}};
> +		# leading empty lines would separate headers from body
>  		foreach my $line (@{$co{'comment'}}) {
>  			print to_utf8($line) . "\n";
>  		}

You seem to be assuming messages that follow git convention, but is it a
good assumption here?  E.g. is the first element of @[$co{'comment'}]
always known to be non blank?  is the second element guaranteed to be
empty?

      reply	other threads:[~2008-03-19 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 22:28 [PATCH] gitweb: Remove commit title from comitdiff_plain body Jakub Narebski
2008-03-19 22:35 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vk5jy1gw6.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).