summaryrefslogtreecommitdiff
path: root/revision.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-08-30 16:37:55 -0700
committerJunio C Hamano <gitster@pobox.com>2013-08-30 16:37:55 -0700
commite7b432c521b0177e86eaecd2bd16906b9fc53e10 (patch)
tree179470e0cce46ceca0264af3652c7641ff65c1b1 /revision.h
parente230c568c4b9a991e3175e5f65171a566fd8e39c (diff)
downloadgit-e7b432c521b0177e86eaecd2bd16906b9fc53e10.tar.gz
revision: introduce --exclude=<glob> to tame wildcards
People often find "git log --branches" etc. that includes _all_ branches is cumbersome to use when they want to grab most but except some. The same applies to --tags, --all and --glob. Teach the revision machinery to remember patterns, and then upon the next such a globbing option, exclude those that match the pattern. With this, I can view only my integration branches (e.g. maint, master, etc.) without topic branches, which are named after two letters from primary authors' names, slash and topic name. git rev-list --no-walk --exclude=??/* --branches | git name-rev --refs refs/heads/* --stdin This one shows things reachable from local and remote branches that have not been merged to the integration branches. git log --remotes --branches --not --exclude=??/* --branches It may be a bit rough around the edges, in that the pattern to give the exclude option depends on what globbing option follows. In these examples, the pattern "??/*" is used, not "refs/heads/??/*", because the globbing option that follows the -"-exclude=<pattern>" is "--branches". As each use of globbing option resets previously set "--exclude", this may not be such a bad thing, though. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
-rw-r--r--revision.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/revision.h b/revision.h
index 95859ba119..b4dc56c3ca 100644
--- a/revision.h
+++ b/revision.h
@@ -59,6 +59,9 @@ struct rev_info {
/* The end-points specified by the end user */
struct rev_cmdline_info cmdline;
+ /* excluding from --branches, --refs, etc. expansion */
+ struct string_list *ref_excludes;
+
/* Basic information */
const char *prefix;
const char *def;