Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> 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. > 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); -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html