From: Junio C Hamano Date: Wed, 25 Jun 2014 18:49:10 +0000 (-0700) Subject: Merge branch 'jc/shortlog-ref-exclude' into maint X-Git-Tag: v2.0.1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8675779454ed3007bd2a8f83d013e05a65c2d480;p=thirdparty%2Fgit.git Merge branch 'jc/shortlog-ref-exclude' into maint "git log --exclude= --all | git shortlog" worked as expected, but "git shortlog --exclude= --all", which is supposed to be identical to the above pipeline, was not accepted at the command line argument parser level. * jc/shortlog-ref-exclude: shortlog: allow --exclude= to be passed --- 8675779454ed3007bd2a8f83d013e05a65c2d480 diff --cc revision.c index f6a1088381,9daaf35801..8351e794df --- a/revision.c +++ b/revision.c @@@ -1632,9 -1611,10 +1632,10 @@@ static int handle_revision_opt(struct r !strcmp(arg, "--tags") || !strcmp(arg, "--remotes") || !strcmp(arg, "--reflog") || !strcmp(arg, "--not") || !strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk") || - !strcmp(arg, "--bisect") || !prefixcmp(arg, "--glob=") || - !prefixcmp(arg, "--exclude=") || - !prefixcmp(arg, "--branches=") || !prefixcmp(arg, "--tags=") || - !prefixcmp(arg, "--remotes=") || !prefixcmp(arg, "--no-walk=")) + !strcmp(arg, "--bisect") || starts_with(arg, "--glob=") || ++ starts_with(arg, "--exclude=") || + starts_with(arg, "--branches=") || starts_with(arg, "--tags=") || + starts_with(arg, "--remotes=") || starts_with(arg, "--no-walk=")) { unkv[(*unkc)++] = arg; return 1; diff --cc t/t4201-shortlog.sh index 42866992cf,a702bb5bf7..97fcb31d6e --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@@ -172,20 -172,10 +172,26 @@@ test_expect_success 'shortlog encoding git shortlog HEAD~2.. > out && test_cmp expect out' +test_expect_success 'shortlog ignores commits with missing authors' ' + git commit --allow-empty -m normal && + git commit --allow-empty -m soon-to-be-broken && + git cat-file commit HEAD >commit.tmp && + sed "/^author/d" commit.tmp >broken.tmp && + commit=$(git hash-object -w -t commit --stdin expect <<-\EOF && + A U Thor (1): + normal + + EOF + git shortlog HEAD~2.. >actual && + test_cmp expect actual +' + + test_expect_success 'shortlog with revision pseudo options' ' + git shortlog --all && + git shortlog --branches && + git shortlog --exclude=refs/heads/m* --all + ' + test_done