diff options
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | 2010-01-20 11:48:26 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-20 12:30:25 -0800 |
commit | b09fe971dea73ff6f5296ce533a566114b23ca4e (patch) | |
tree | 69b2da8e23b89af69575aa4de550479dc87652ff /revision.c | |
parent | d08bae7e221727e26baab984b792854b842130d7 (diff) | |
download | git-b09fe971dea73ff6f5296ce533a566114b23ca4e.tar.gz |
rev-parse --branches/--tags/--remotes=pattern
Since local branch, tags and remote tracking branch namespaces are
most often used, add shortcut notations for globbing those in
manner similar to --glob option.
With this, one can express the "what I have but origin doesn't?"
as:
'git log --branches --not --remotes=origin'
Original-idea-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 162b182914..1e9277d335 100644 --- a/revision.c +++ b/revision.c @@ -1364,6 +1364,24 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch for_each_glob_ref(handle_one_ref, arg + 7, &cb); continue; } + if (!prefixcmp(arg, "--branches=")) { + struct all_refs_cb cb; + init_all_refs_cb(&cb, revs, flags); + for_each_glob_ref_in(handle_one_ref, arg + 11, "refs/heads/", &cb); + continue; + } + if (!prefixcmp(arg, "--tags=")) { + struct all_refs_cb cb; + init_all_refs_cb(&cb, revs, flags); + for_each_glob_ref_in(handle_one_ref, arg + 7, "refs/tags/", &cb); + continue; + } + if (!prefixcmp(arg, "--remotes=")) { + struct all_refs_cb cb; + init_all_refs_cb(&cb, revs, flags); + for_each_glob_ref_in(handle_one_ref, arg + 10, "refs/remotes/", &cb); + continue; + } if (!strcmp(arg, "--reflog")) { handle_reflog(revs, flags); continue; |