diff options
author | Jeff King <peff@peff.net> | 2016-01-18 15:02:48 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-19 09:54:14 -0800 |
commit | 2db6b83d189bb82d1d45805fa6c85a9c8b507920 (patch) | |
tree | 52a4a02c06f5b3ad67d60ed1310be2bd827e94b1 /ws.c | |
parent | shortlog: use strbufs to read from stdin (diff) | |
download | tgif-2db6b83d189bb82d1d45805fa6c85a9c8b507920.tar.xz |
shortlog: replace hand-parsing of author with pretty-printer
When gathering the author and oneline subject for each
commit, we hand-parse the commit headers to find the
"author" line, and then continue past to the blank line at
the end of the header.
We can replace this tricky hand-parsing by simply asking the
pretty-printer for the relevant items. This also decouples
the author and oneline parsing, opening up some new
optimizations in further commits.
One reason to avoid the pretty-printer is that it might be
less efficient than hand-parsing. However, I measured no
slowdown at all running "git shortlog -ns HEAD" on
linux.git.
As a bonus, we also fix a memory leak in the (uncommon) case
that the author field is blank.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ws.c')
0 files changed, 0 insertions, 0 deletions