Re: [PATCH] shortlog: take the first populated line of the description
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 5, 2008, 16:51 UTC
- Message-ID
- <alpine.LSU.1.00.0803051750030.15786@racer.site>
- In-Reply-To
- <20080305164316.GH17931@shadowen.org>
Hi,
On Wed, 5 Mar 2008, Andy Whitcroft wrote:
Show 29 quoted lines
> On Wed, Mar 05, 2008 at 03:48:00PM +0100, Johannes Schindelin wrote:
>
> > 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.Well, it sure looks like that. Maybe you want to make it look like that even more?
Show 7 quoted lines
> 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?
No, I think with an explanation like this in the commit message, it is good as-is.
Ciao, Dscho