Merge branch 'jc/shortlog-ref-exclude' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 25 Jun 2014 18:49:10 +0000 (11:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Jun 2014 18:49:11 +0000 (11:49 -0700)
"git log --exclude=<glob> --all | git shortlog" worked as expected,
but "git shortlog --exclude=<glob> --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=<glob> to be passed

1  2 
revision.c
t/t4201-shortlog.sh
diff --cc revision.c
index f6a10883813ca72fd7df0e827aeab58aa6cf786e,9daaf35801106ea33547b5389953890fa76bbaa1..8351e794df943ea6ea7acde40c01c97c20be4576
@@@ -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;
index 42866992cfe65657019dced508d3490b3851a6c7,a702bb5bf7e8b45cb0be2c30f7eb4322d792fcd2..97fcb31d6eb516b195e9e26a8716dbf484fcc616
@@@ -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 <broken.tmp) &&
 +      git update-ref HEAD $commit &&
 +      cat >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