summaryrefslogtreecommitdiff
path: root/builtin-fmt-merge-msg.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-15 11:01:36 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-15 23:53:26 -0700
commit6a28518ae098fad99ca3774ad7ed17bb681b809b (patch)
treeade086fced95db2def4e6b63e2ee3dbd494b4e06 /builtin-fmt-merge-msg.c
parent48949a18c852e5119827278c37f791921e640688 (diff)
downloadgit-6a28518ae098fad99ca3774ad7ed17bb681b809b.tar.gz
Ignore leading empty lines while summarizing merges
"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>
Diffstat (limited to 'builtin-fmt-merge-msg.c')
-rw-r--r--builtin-fmt-merge-msg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index 6163bd4975..03c2bc33eb 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -200,6 +200,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)),
@@ -207,7 +216,6 @@ static void shortlog(const char *name, unsigned char *sha1,
continue;
}
- bol += 2;
eol = strchr(bol, '\n');
if (eol) {
oneline = xmemdupz(bol, eol - bol);