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

Re: [GIT PULL] sh updates for 2.6.25

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2008, 18:41 UTC
Message-ID
<7vr6d7x8nj.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.00.0804151048060.2879@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> Junio? Something like this for the merge summary code? (It also turns an 
> empty commit message with just whitespace in the commit message into the 
> SHA1 hex string)

Yeah, your patch makes sense, but it also makes me wonder if we should fix the code in pretty.c::parse_commit_header() that grabs the "subject" line, and use format_commit_message() with "%s" format here. Interested people then can enhance it to take custom format string.

Show 34 quoted lines
> 		Linus
>
> ----
>  builtin-fmt-merge-msg.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
> index ebb3f37..7077d52 100644
> --- a/builtin-fmt-merge-msg.c
> +++ b/builtin-fmt-merge-msg.c
> @@ -201,6 +201,15 @@ static void shortlog(const char *name, unsigned char *sha1,
>  			continue;
>  
>  		bol = strstr(commit->buffer, "\n\n");
> +		if (bol) {
> +			unsigned char c;
> +			do {
> +				c = *++bol;
> +			} while (isspace(c));
> +			if (!c)
> +				bol = NULL;
> +		}
> +
>  		if (!bol) {
>  			append_to_list(&subjects, xstrdup(sha1_to_hex(
>  							commit->object.sha1)),
> @@ -208,7 +217,6 @@ static void shortlog(const char *name, unsigned char *sha1,
>  			continue;
>  		}
>  
> -		bol += 2;
>  		eol = strchr(bol, '\n');
>  		if (eol) {
>  			oneline = xmemdupz(bol, eol - bol);
Previous: Linus TorvaldsNext: Jakub Narebski
Message 8 of 17 in “Re: [GIT PULL] sh updates for 2.6.25”
  1. Linus TorvaldsApr 15, 2008
  2. Linus TorvaldsApr 15, 2008
  3. Paul MundtApr 15, 2008
  4. Linus TorvaldsApr 15, 2008
  5. Alex RiesenApr 16, 2008
  6. Junio C HamanoApr 16, 2008
  7. Linus TorvaldsApr 16, 2008
  8. Junio C HamanoApr 15, 2008
  9. Jakub NarebskiApr 15, 2008
  10. Miklos VajnaApr 16, 2008
  11. format-patch: Make sure the subject is always a one-linerMiklos Vajna, Apr 16, 2008
  12. Junio C HamanoApr 16, 2008
  13. Miklos VajnaApr 16, 2008
  14. Re* [GIT PULL] sh updates for 2.6.25Junio C Hamano, Apr 16, 2008
  15. Jakub NarebskiApr 16, 2008
  16. Miklos VajnaApr 17, 2008
  17. David WoodhouseApr 27, 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.