summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52dce39)
raw | patch | inline | side by side (parent: 52dce39)
author | Andy Whitcroft <apw@shadowen.org> | |
Wed, 5 Mar 2008 14:24:10 +0000 (14:24 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 21:28:39 +0000 (13:28 -0800) |
Way back the perl version of shortlog would take the first populated line
of the commit body. The builtin version mearly takes the first line.
This leads to empty shortlog entries when there is some viable text in
the commit.
Reinstate this behaviour igoring all lines with nothing but whitespace.
This is often useful when dealing with commits imported from foreign SCMs
that do not tidy up the log message of useless blank lines at the beginning.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
of the commit body. The builtin version mearly takes the first line.
This leads to empty shortlog entries when there is some viable text in
the commit.
Reinstate this behaviour igoring all lines with nothing but whitespace.
This is often useful when dealing with commits imported from foreign SCMs
that do not tidy up the log message of useless blank lines at the beginning.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-shortlog.c | patch | blob | history |
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index fa8bc7d02a2268d99dcc829cb3adbee10c949306..f08095bc91b92ad93560459d060259bd5df52c4a 100644 (file)
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
else
free(buffer);
+ /* Skip any leading whitespace, including any blank lines. */
+ while (*oneline && isspace(*oneline))
+ oneline++;
eol = strchr(oneline, '\n');
if (!eol)
eol = oneline + strlen(oneline);
- while (*oneline && isspace(*oneline) && *oneline != '\n')
- oneline++;
if (!prefixcmp(oneline, "[PATCH")) {
char *eob = strchr(oneline, ']');
if (eob && (!eol || eob < eol))