Skip to content

Commit

Permalink
Ignore leading empty lines while summarizing merges
Browse files Browse the repository at this point in the history
"git log" and friends normally skip the initial empty lines when showing
one-line summary of a commit, but merge summary didn't.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----
 builtin-fmt-merge-msg.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Apr 16, 2008
1 parent 48949a1 commit 6a28518
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion builtin-fmt-merge-msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,22 @@ 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)),
NULL);
continue;
}

bol += 2;
eol = strchr(bol, '\n');
if (eol) {
oneline = xmemdupz(bol, eol - bol);
Expand Down

0 comments on commit 6a28518

Please sign in to comment.