Skip to content

Commit

Permalink
shortlog: take the first populated line of the description
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Whitcroft authored and Junio C Hamano committed Mar 5, 2008
1 parent 52dce39 commit c1ce83a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builtin-shortlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ static void insert_one_record(struct path_list *list,
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))
Expand Down

0 comments on commit c1ce83a

Please sign in to comment.