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

Re: [PATCH 3/4] Retain extra blank lines between the summary and the body

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2008, 20:30 UTC
Message-ID
<7v4pclx1xu.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0802061141320.13593@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 36 quoted lines
> This is so that it's possible to have a message that will generate an
> email with the first line blank. If the email you're generating is
> actually a template, you may have a single line filling in for a
> ~3-line paragraph, meaning that the space starts with a blank line,
> which was impossible before as output from the message-splitting code.
>
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
>  pretty.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/pretty.c b/pretty.c
> index f82380b..98efac2 100644
> --- a/pretty.c
> +++ b/pretty.c
> @@ -713,7 +713,6 @@ void pp_remainder(enum cmit_fmt fmt,
>  		  struct strbuf *sb,
>  		  int indent)
>  {
> -	int first = 1;
>  	for (;;) {
>  		const char *line = *msg_p;
>  		int linelen = get_one_line(line);
> @@ -723,12 +722,9 @@ void pp_remainder(enum cmit_fmt fmt,
>  			break;
>  
>  		if (is_empty_line(line, &linelen)) {
> -			if (first)
> -				continue;
>  			if (fmt == CMIT_FMT_SHORT)
>  				break;
>  		}
> -		first = 0;
>  
>  		strbuf_grow(sb, linelen + indent + 20);
>  		if (indent) {

I have to wonder if this regresses the normal codepath to cleanse commit messages that have extra blanks at the beginning.

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 2 of 4 in “Retain extra blank lines between the summary and the body”
  1. 3/4 Retain extra blank lines between the summary and the bodyDaniel Barkalow, Feb 6, 2008
  2. Junio C HamanoFeb 6, 2008
  3. Daniel BarkalowFeb 6, 2008
  4. Junio C HamanoFeb 7, 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.