Skip to content

Commit eb07774

Browse files
committed
shortlog: allow --exclude=<glob> to be passed
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 e7b432c5 (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 <[email protected]>
1 parent e7b432c commit eb07774

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

revision.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
16121612
!strcmp(arg, "--reflog") || !strcmp(arg, "--not") ||
16131613
!strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk") ||
16141614
!strcmp(arg, "--bisect") || !prefixcmp(arg, "--glob=") ||
1615+
!prefixcmp(arg, "--exclude=") ||
16151616
!prefixcmp(arg, "--branches=") || !prefixcmp(arg, "--tags=") ||
16161617
!prefixcmp(arg, "--remotes=") || !prefixcmp(arg, "--no-walk="))
16171618
{

t/t4201-shortlog.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,10 @@ test_expect_success 'shortlog encoding' '
172172
git shortlog HEAD~2.. > out &&
173173
test_cmp expect out'
174174

175+
test_expect_success 'shortlog with revision pseudo options' '
176+
git shortlog --all &&
177+
git shortlog --branches &&
178+
git shortlog --exclude=refs/heads/m* --all
179+
'
180+
175181
test_done

0 commit comments

Comments
 (0)