@matheusbsbs / matheus-bagliano / commits / c1ce83a5b6
Fork 0

shortlog: take the first populated line of the description

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>

Andy Whitcroft committed Mar 5, 2008 at 14:24 UTC c1ce83a5b64618a8a4ac313da82c156558cbe259
1 file changed +3 -2
builtin-shortlog.c
+3 -2
@@ -74,11 +74,12 @@ static void insert_one_record(struct path_list *list,
74 else
75 free(buffer);
76
77 + /* Skip any leading whitespace, including any blank lines. */
78 + while (*oneline && isspace(*oneline))
79 + oneline++;
80 eol = strchr(oneline, '\n');
81 if (!eol)
82 eol = oneline + strlen(oneline);
80 - while (*oneline && isspace(*oneline) && *oneline != '\n')
81 - oneline++;
83 if (!prefixcmp(oneline, "[PATCH")) {
84 char *eob = strchr(oneline, ']');
85 if (eob && (!eol || eob < eol))