git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] shortlog: take the first populated line of the description

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 5, 2008, 14:48 UTC
Message-ID
<alpine.LSU.1.00.0803051544160.15786@racer.site>
In-Reply-To
<1204727050.0@pinky>
Hi,
On Wed, 5 Mar 2008, Andy Whitcroft wrote:
Show 19 quoted lines
> 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?

Ciao, Dscho

Previous: Andy WhitcroftNext: Andy Whitcroft
Message 2 of 8 in “shortlog: take the first populated line of the description”
  1. shortlog: take the first populated line of the descriptionAndy Whitcroft, Mar 5, 2008
  2. Johannes SchindelinMar 5, 2008
  3. Andy WhitcroftMar 5, 2008
  4. Johannes SchindelinMar 5, 2008
  5. Nicolas PitreMar 5, 2008
  6. Junio C HamanoMar 5, 2008
  7. Nicolas PitreMar 5, 2008
  8. Junio C HamanoMar 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.