git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] shortlog: take the first populated line of the description
Date: Wed, 5 Mar 2008 16:43:22 +0000	[thread overview]
Message-ID: <20080305164316.GH17931@shadowen.org> (raw)
In-Reply-To: <alpine.LSU.1.00.0803051544160.15786@racer.site>

On Wed, Mar 05, 2008 at 03:48:00PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Wed, 5 Mar 2008, Andy Whitcroft wrote:
> 
> > diff --git a/builtin-shortlog.c b/builtin-shortlog.c
> > index af31aba..b22b0ed 100644
> > --- a/builtin-shortlog.c
> > +++ b/builtin-shortlog.c
> > @@ -70,11 +70,12 @@ static void insert_one_record(struct shortlog *log,
> >  	else
> >  		free(buffer);
> >  
> > +	/* Skip any leading whitespace, including any blank lines. */
> > +	while (*oneline && isspace(*oneline))
> > +		oneline++;
> >  	eol = strchr(oneline, '\n');
> >  	if (!eol)
> >  		eol = oneline + strlen(oneline);
> > -	while (*oneline && isspace(*oneline) && *oneline != '\n')
> > -		oneline++;
> >  	if (!prefixcmp(oneline, "[PATCH")) {
> >  		char *eob = strchr(oneline, ']');
> >  		if (eob && (!eol || eob < eol))
> 
> Why do you move the code around?  Makes it harder to read your patch.  
> Besides, you now strip empty lines at the beginning of the commit 
> messages, right?  Who produces such a thing?

I've not moved the code as such.  I added a loop to drop the leading
whitespace.  That made the second loop redundant as its job is already
done, so I killed it.

The point of the patch is to strip the empty lines at the start of
the commit.  I am ending up with them in my repo mostly due to
imcompetant users of SVN I suspect.  The main driver is that I have
those and the original non-C version coped and the builtin does not.

Now if people think that its a stupid idea I might suggest it could be
optional?

-apw

  reply	other threads:[~2008-03-05 16:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 14:24 [PATCH] shortlog: take the first populated line of the description Andy Whitcroft
2008-03-05 14:48 ` Johannes Schindelin
2008-03-05 16:43   ` Andy Whitcroft [this message]
2008-03-05 16:51     ` Johannes Schindelin
2008-03-05 18:47 ` Nicolas Pitre
2008-03-05 21:27   ` Junio C Hamano
2008-03-05 21:47     ` Nicolas Pitre
2008-03-05 22:14       ` Junio C Hamano

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=20080305164316.GH17931@shadowen.org \
    --to=apw@shadowen.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /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).