From 9cf68b27d50c29a0370bd61581d350b0b0a18e85 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 19 Apr 2021 13:47:06 +0200 Subject: rev-list: allow filtering of provided items When providing an object filter, it is currently impossible to also filter provided items. E.g. when executing `git rev-list HEAD` , the commit this reference points to will be treated as user-provided and is thus excluded from the filtering mechanism. This makes it harder than necessary to properly use the new `--filter=object:type` filter given that even if the user wants to only see blobs, he'll still see commits of provided references. Improve this by introducing a new `--filter-provided-objects` option to the git-rev-parse(1) command. If given, then all user-provided references will be subject to filtering. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- pack-bitmap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pack-bitmap.h') diff --git a/pack-bitmap.h b/pack-bitmap.h index 36d99930d8..bb45217d3b 100644 --- a/pack-bitmap.h +++ b/pack-bitmap.h @@ -50,7 +50,8 @@ void traverse_bitmap_commit_list(struct bitmap_index *, show_reachable_fn show_reachable); void test_bitmap_walk(struct rev_info *revs); struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs, - struct list_objects_filter_options *filter); + struct list_objects_filter_options *filter, + int filter_provided_objects); int reuse_partial_packfile_from_bitmap(struct bitmap_index *, struct packed_git **packfile, uint32_t *entries, -- cgit v1.2.3