diff options
author | Derrick Stolee <derrickstolee@github.com> | 2022-03-09 16:01:40 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-09 10:25:27 -0800 |
commit | c4ea513f4aea64e1ab03309dddff046852bddb74 (patch) | |
tree | b95aa560c455461afa0521a8fb8452413ad143e2 /builtin | |
parent | bundle: parse filter capability (diff) | |
download | tgif-c4ea513f4aea64e1ab03309dddff046852bddb74.tar.xz |
rev-list: move --filter parsing into revision.c
Now that 'struct rev_info' has a 'filter' member and most consumers of
object filtering are using that member instead of an external struct,
move the parsing of the '--filter' option out of builtin/rev-list.c and
into revision.c.
This use within handle_revision_pseudo_opt() allows us to find the
option within setup_revisions() if the arguments are passed directly. In
the case of a command such as 'git blame', the arguments are first
scanned and checked with parse_revision_opt(), which complains about the
option, so 'git blame --filter=blob:none <file>' does not become valid
with this change.
Some commands, such as 'git diff' gain this option without having it
make an effect. And 'git diff --objects' was already possible, but does
not actually make sense in that builtin.
The key addition that is coming is 'git bundle create --filter=<X>' so
we can create bundles containing promisor packs. More work is required
to make them fully functional, but that will follow.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/rev-list.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c index ec433cb6d3..640828149c 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -591,17 +591,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) show_progress = arg; continue; } - - if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) { - parse_list_objects_filter(&revs.filter, arg); - if (revs.filter.choice && !revs.blob_objects) - die(_("object filtering requires --objects")); - continue; - } - if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) { - list_objects_filter_set_no_filter(&revs.filter); - continue; - } if (!strcmp(arg, "--filter-provided-objects")) { filter_provided_objects = 1; continue; |