From: Junio C Hamano Date: Fri, 30 May 2014 19:57:25 +0000 (-0700) Subject: shortlog: allow --exclude= to be passed X-Git-Tag: v2.0.1~6^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb077745a4f22183faec93e46e053ccddabcc88b;p=thirdparty%2Fgit.git shortlog: allow --exclude= 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= 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 --- diff --git a/revision.c b/revision.c index 3e8287425d..9daaf35801 100644 --- a/revision.c +++ b/revision.c @@ -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=")) { diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 5493500ef1..a702bb5bf7 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -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