Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] Fix empty line processing in git-shortlog.perl

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:10

Petr Baudis [off-list ref] writes:
Faced with a commit such as

	commit f1b2646c7f2713c3ea4bce120e1d0d8091808be4
	Author: Adrian Bunk [off-list ref]
	Date:   Sun Nov 6 20:30:38 2005 +0100

	    From: Michal Wronski [off-list ref]

	    I've jchanged my email. Please apply this patch so as to everybody
	    could send me a remarks about mqueuefs.

	    Signed-off-by: Michal Wronski [off-list ref]
	    Signed-off-by: Adrian Bunk [off-list ref]

git-shortlog.perl would produce a line with an empty commit title.
This patch fixes that...
-			next unless /^\s*?(.*)/;
+			next unless /^\s*?(\S.*)$/;
I suspect /(\S.*)$/ would do the same thing, but in any case
I do not think it is the right fix.

I think the problem is deeper than that.  Shortlog summarizes to
only one line per commit, so I suspect what you would be feeding
it would say something like this for the above example:

        commit f1b2646c7f2713c3ea4bce120e1d0d8091808be4
        Author: Adrian Bunk [off-list ref]

            From: Michal Wronski [off-list ref]

That is, the commit you quoted is done by 'git log --pretty',
but a typical shortlog invocation would be:

	git log --pretty=short rev1..rev2 | git shortlog

With or without your fix, the command barfs.

Of course, that "From: " line should have been used as the
commit author by the tool that created the commit out of e-mail
Adrian received, but that is a separate issue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help