From: Junio C Hamano Date: Mon, 9 Jun 2014 18:30:12 +0000 (-0700) Subject: Merge branch 'jc/shortlog-ref-exclude' X-Git-Tag: v2.1.0-rc0~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07768e03b5a5efc9d768d6afc6246d2ec345cace;p=thirdparty%2Fgit.git Merge branch 'jc/shortlog-ref-exclude' "log --exclude= --all | shortlog" worked as expected, but "shortlog --exclude= --all" was not accepted at the command line argument parser level. * jc/shortlog-ref-exclude: shortlog: allow --exclude= to be passed --- 07768e03b5a5efc9d768d6afc6246d2ec345cace diff --cc revision.c index 71e2337423,9daaf35801..3818b4628d --- 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