@matheusbsbs / matheus-bagliano / commits / 6a28518ae0
Fork 0

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>

Linus Torvalds committed Apr 15, 2008 at 11:01 UTC 6a28518ae098fad99ca3774ad7ed17bb681b809b
1 file changed +9 -1
builtin-fmt-merge-msg.c
+9 -1
@@ -200,6 +200,15 @@ static void shortlog(const char *name, unsigned char *sha1,
200 continue;
201
202 bol = strstr(commit->buffer, "\n\n");
203 + if (bol) {
204 + unsigned char c;
205 + do {
206 + c = *++bol;
207 + } while (isspace(c));
208 + if (!c)
209 + bol = NULL;
210 + }
211 +
212 if (!bol) {
213 append_to_list(&subjects, xstrdup(sha1_to_hex(
214 commit->object.sha1)),
@@ -207,7 +216,6 @@ static void shortlog(const char *name, unsigned char *sha1,
216 continue;
217 }
218
210 - bol += 2;
219 eol = strchr(bol, '\n');
220 if (eol) {
221 oneline = xmemdupz(bol, eol - bol);