Skip to content

Commit

Permalink
shortlog: allow --exclude=<glob> to be passed
Browse files Browse the repository at this point in the history
These two commands are supposed to be equivalent:

  $ git log --exclude=refs/notes/\* --all --no-merges --since=2.days |
    git shortlog
  $ git shortlog --exclude=refs/notes/\* --all --no-merges --since=2.days

However, the latter does not understand the ref-exclusion command
line option, even though other options understood by "log", such as
"--all" and "--no-merges", are understood.

This was because e7b432c (revision: introduce --exclude=<glob> to
tame wildcards, 2013-08-30) did not wire the new option fully to the
machinery.  A new option understood by handle_revision_pseudo_opt()
must be told to handle_revision_opt() as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jun 4, 2014
1 parent e7b432c commit eb07774
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
!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="))
{
Expand Down
6 changes: 6 additions & 0 deletions t/t4201-shortlog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,10 @@ test_expect_success 'shortlog encoding' '
git shortlog HEAD~2.. > out &&
test_cmp expect out'

test_expect_success 'shortlog with revision pseudo options' '
git shortlog --all &&
git shortlog --branches &&
git shortlog --exclude=refs/heads/m* --all
'

test_done

0 comments on commit eb07774

Please sign in to comment.