diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-21 22:14:24 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-21 22:14:24 (GMT) |
commit | 7391ecd338edcd0317687399c915927c1b4e25dd (patch) | |
tree | 69d298824738ca2289f96d134c9ea2c0ec3dbf95 /revision.c | |
parent | b6763af74ba55570deae38ce118c1d803d7b825c (diff) | |
parent | 86fdd94d723b7fa1870a64e8080d3540a434f29b (diff) | |
download | git-7391ecd338edcd0317687399c915927c1b4e25dd.zip git-7391ecd338edcd0317687399c915927c1b4e25dd.tar.gz git-7391ecd338edcd0317687399c915927c1b4e25dd.tar.bz2 |
Merge branch 'ds/partial-bundles'
Bundle file format gets extended to allow a partial bundle,
filtered by similar criteria you would give when making a
partial/lazy clone.
* ds/partial-bundles:
clone: fail gracefully when cloning filtered bundle
bundle: unbundle promisor packs
bundle: create filtered bundles
rev-list: move --filter parsing into revision.c
bundle: parse filter capability
list-objects: handle NULL function pointers
MyFirstObjectWalk: update recommended usage
list-objects: consolidate traverse_commit_list[_filtered]
pack-bitmap: drop filter in prepare_bitmap_walk()
pack-objects: use rev.filter when possible
revision: put object filter into struct rev_info
list-objects-filter-options: create copy helper
index-pack: document and test the --promisor option
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -32,6 +32,7 @@ #include "utf8.h" #include "bloom.h" #include "json-writer.h" +#include "list-objects-filter-options.h" volatile show_early_output_fn_t show_early_output; @@ -2690,6 +2691,10 @@ static int handle_revision_pseudo_opt(struct rev_info *revs, revs->no_walk = 0; } else if (!strcmp(arg, "--single-worktree")) { revs->single_worktree = 1; + } else if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) { + parse_list_objects_filter(&revs->filter, arg); + } else if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) { + list_objects_filter_set_no_filter(&revs->filter); } else { return 0; } @@ -2892,6 +2897,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s die("cannot combine --walk-reflogs with history-limiting options"); if (revs->rewrite_parents && revs->children.name) die(_("options '%s' and '%s' cannot be used together"), "--parents", "--children"); + if (revs->filter.choice && !revs->blob_objects) + die(_("object filtering requires --objects")); /* * Limitations on the graph functionality |