summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 419e383)
raw | patch | inline | side by side (parent: 419e383)
author | Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com> | |
Thu, 28 Feb 2008 07:24:25 +0000 (08:24 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Feb 2008 08:00:29 +0000 (00:00 -0800) |
These flags are already known to rev-parse and have the same meaning.
This patch allows to run gitk as follows:
gitk --branches --not --remotes
to show only your local work.
Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This patch allows to run gitk as follows:
gitk --branches --not --remotes
to show only your local work.
Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-list.txt | patch | blob | history | |
builtin-rev-list.c | patch | blob | history | |
revision.c | patch | blob | history |
index a8d489f9f29034d732a67375b617f3315109aa05..d80cdf55024e4c8d67178aabd24b055d53a70438 100644 (file)
[ \--full-history ]
[ \--not ]
[ \--all ]
+ [ \--branches ]
+ [ \--tags ]
+ [ \--remotes ]
[ \--stdin ]
[ \--quiet ]
[ \--topo-order ]
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 6f7d5f8214e54c24983e9c8c295edfefba54fb2b..6754e7f124cd3baa263d4b4f2c7e7be453260112 100644 (file)
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
" --no-merges\n"
" --remove-empty\n"
" --all\n"
+" --branches\n"
+" --tags\n"
+" --remotes\n"
" --stdin\n"
" --quiet\n"
" ordering output:\n"
diff --git a/revision.c b/revision.c
index 84fbdd3af47c40879874d50b173ac633d279d734..0eb6faa5378ebafe2c4939cb4ec7fd2e6aaadb02 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -633,12 +633,13 @@ static int handle_one_ref(const char *path, const unsigned char *sha1, int flag,
return 0;
}
-static void handle_all(struct rev_info *revs, unsigned flags)
+static void handle_refs(struct rev_info *revs, unsigned flags,
+ int (*for_each)(each_ref_fn, void *))
{
struct all_refs_cb cb;
cb.all_revs = revs;
cb.all_flags = flags;
- for_each_ref(handle_one_ref, &cb);
+ for_each(handle_one_ref, &cb);
}
static void handle_one_reflog_commit(unsigned char *sha1, void *cb_data)
@@ -1015,7 +1016,19 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
continue;
}
if (!strcmp(arg, "--all")) {
- handle_all(revs, flags);
+ handle_refs(revs, flags, for_each_ref);
+ continue;
+ }
+ if (!strcmp(arg, "--branches")) {
+ handle_refs(revs, flags, for_each_branch_ref);
+ continue;
+ }
+ if (!strcmp(arg, "--tags")) {
+ handle_refs(revs, flags, for_each_tag_ref);
+ continue;
+ }
+ if (!strcmp(arg, "--remotes")) {
+ handle_refs(revs, flags, for_each_remote_ref);
continue;
}
if (!strcmp(arg, "--first-parent")) {