{"thread":{"id":"2373","subject":"[PATCH] Fix empty line processing in git-shortlog.perl","startedAt":"2005-11-06T22:42:18Z","lastAt":"2005-11-07T20:46:59Z","messageCount":4,"participants":["Petr Baudis","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11225","messageId":"20051106224218.22797.97260.stgit@machine.or.cz","threadId":"2373","inReplyTo":null,"subject":"[PATCH] Fix empty line processing in git-shortlog.perl","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-06T22:42:18Z","receivedAt":"2005-11-06T22:42:18Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Faced with a commit such as\n\n\tcommit f1b2646c7f2713c3ea4bce120e1d0d8091808be4\n\tAuthor: Adrian Bunk <bunk@r063144.stusta.swh.mhn.de>\n\tDate:   Sun Nov 6 20:30:38 2005 +0100\n\n\t    From: Michal Wronski <wrona@mat.uni.torun.pl>\n\n\t    I've jchanged my email. Please apply this patch so as to everybody\n\t    could send me a remarks about mqueuefs.\n\n\t    Signed-off-by: Michal Wronski <Michal.Wronski@motorola.com>\n\t    Signed-off-by: Adrian Bunk <bunk@stusta.de>\n\ngit-shortlog.perl would produce a line with an empty commit title.\n\nThis patch fixes that. I believe that just changing the last * to + in the\noriginal regexp would work, but Adrian says it doesn't fix it for him, and\nI believe this regexp is way clearer anyway. This is also the original\nregexp used before a24e658649170c99fdcb4aaa41545679ad02f755.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n git-shortlog.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-shortlog.perl b/git-shortlog.perl\nindex 0b14f83..7283159 100755\n--- a/git-shortlog.perl\n+++ b/git-shortlog.perl\n@@ -94,7 +94,7 @@ sub changelog_input {\n \n \t\t# skip to non-blank line\n \t\telsif ($pstate == 3) {\n-\t\t\tnext unless /^\\s*?(.*)/;\n+\t\t\tnext unless /^\\s*?(\\S.*)$/;\n \n \t\t\t# skip lines that are obviously not\n \t\t\t# a 1-line cset description\n"},{"id":"11227","messageId":"20051106224422.GQ1431@pasky.or.cz","threadId":"2373","inReplyTo":"20051106224218.22797.97260.stgit@machine.or.cz","subject":"Re: [PATCH] Fix empty line processing in git-shortlog.perl","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-06T22:44:22Z","receivedAt":"2005-11-06T22:44:22Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Nov 06, 2005 at 11:42:18PM CET, I got a letter\nwhere Petr Baudis <pasky@suse.cz> told me that...\n> diff --git a/git-shortlog.perl b/git-shortlog.perl\n> index 0b14f83..7283159 100755\n> --- a/git-shortlog.perl\n> +++ b/git-shortlog.perl\n> @@ -94,7 +94,7 @@ sub changelog_input {\n>  \n>  \t\t# skip to non-blank line\n>  \t\telsif ($pstate == 3) {\n> -\t\t\tnext unless /^\\s*?(.*)/;\n> +\t\t\tnext unless /^\\s*?(\\S.*)$/;\n>  \n>  \t\t\t# skip lines that are obviously not\n>  \t\t\t# a 1-line cset description\n> \n\nWhoops, the ? was not part of the original regexp and is obviously\nuseless. Well, I don't think it really matters, so it is up to you...\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11242","messageId":"7v3bm9upx4.fsf@assigned-by-dhcp.cox.net","threadId":"2373","inReplyTo":"20051106224218.22797.97260.stgit@machine.or.cz","subject":"Re: [PATCH] Fix empty line processing in git-shortlog.perl","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-07T02:56:07Z","receivedAt":"2005-11-07T02:56:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> Faced with a commit such as\n>\n> \tcommit f1b2646c7f2713c3ea4bce120e1d0d8091808be4\n> \tAuthor: Adrian Bunk <bunk@r063144.stusta.swh.mhn.de>\n> \tDate:   Sun Nov 6 20:30:38 2005 +0100\n>\n> \t    From: Michal Wronski <wrona@mat.uni.torun.pl>\n>\n> \t    I've jchanged my email. Please apply this patch so as to everybody\n> \t    could send me a remarks about mqueuefs.\n>\n> \t    Signed-off-by: Michal Wronski <Michal.Wronski@motorola.com>\n> \t    Signed-off-by: Adrian Bunk <bunk@stusta.de>\n>\n> git-shortlog.perl would produce a line with an empty commit title.\n\n> This patch fixes that...\n\n> -\t\t\tnext unless /^\\s*?(.*)/;\n> +\t\t\tnext unless /^\\s*?(\\S.*)$/;\n\nI suspect /(\\S.*)$/ would do the same thing, but in any case\nI do not think it is the right fix.\n\nI think the problem is deeper than that.  Shortlog summarizes to\nonly one line per commit, so I suspect what you would be feeding\nit would say something like this for the above example:\n\n        commit f1b2646c7f2713c3ea4bce120e1d0d8091808be4\n        Author: Adrian Bunk <bunk@r063144.stusta.swh.mhn.de>\n\n            From: Michal Wronski <wrona@mat.uni.torun.pl>\n\nThat is, the commit you quoted is done by 'git log --pretty',\nbut a typical shortlog invocation would be:\n\n\tgit log --pretty=short rev1..rev2 | git shortlog\n\nWith or without your fix, the command barfs.\n\nOf course, that \"From: \" line should have been used as the\ncommit author by the tool that created the commit out of e-mail\nAdrian received, but that is a separate issue.\n"},{"id":"11270","messageId":"20051107204659.GT1431@pasky.or.cz","threadId":"2373","inReplyTo":"7v3bm9upx4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix empty line processing in git-shortlog.perl","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-07T20:46:59Z","receivedAt":"2005-11-07T20:46:59Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Nov 07, 2005 at 03:56:07AM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> told me that...\n> I think the problem is deeper than that.  Shortlog summarizes to\n> only one line per commit, so I suspect what you would be feeding\n> it would say something like this for the above example:\n> \n>         commit f1b2646c7f2713c3ea4bce120e1d0d8091808be4\n>         Author: Adrian Bunk <bunk@r063144.stusta.swh.mhn.de>\n> \n>             From: Michal Wronski <wrona@mat.uni.torun.pl>\n> \n> That is, the commit you quoted is done by 'git log --pretty',\n> but a typical shortlog invocation would be:\n> \n> \tgit log --pretty=short rev1..rev2 | git shortlog\n> \n> With or without your fix, the command barfs.\n> \n> Of course, that \"From: \" line should have been used as the\n> commit author by the tool that created the commit out of e-mail\n> Adrian received, but that is a separate issue.\n\nWell, on a second though, I don't think we should probably handle this\nat all, then. The whole logic for this in git-shortlog.perl seems to be\ndubious, so would be a requirement that we require the input to be from\n--pretty=short ok?\n\nSimpler code, no bugs, everyone happy, errors during applying (like\nstale From) immediately noticeable.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"}]}