rev-list: use bitmap filters for traversal
This just passes the filter-options struct to prepare_bitmap_walk(). Since the bitmap code doesn't actually support any filters yet, it will fallback to the non-bitmap code if any --filter is specified. But this lets us exercise that rejection code path, as well as getting us ready to test filters via rev-list when we _do_ support them. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6663ae0a08
commit
2aaeb9ac41
@ -372,7 +372,8 @@ static inline int parse_missing_action_value(const char *value)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int try_bitmap_count(struct rev_info *revs)
|
static int try_bitmap_count(struct rev_info *revs,
|
||||||
|
struct list_objects_filter_options *filter)
|
||||||
{
|
{
|
||||||
uint32_t commit_count = 0,
|
uint32_t commit_count = 0,
|
||||||
tag_count = 0,
|
tag_count = 0,
|
||||||
@ -407,7 +408,7 @@ static int try_bitmap_count(struct rev_info *revs)
|
|||||||
*/
|
*/
|
||||||
max_count = revs->max_count;
|
max_count = revs->max_count;
|
||||||
|
|
||||||
bitmap_git = prepare_bitmap_walk(revs, NULL);
|
bitmap_git = prepare_bitmap_walk(revs, filter);
|
||||||
if (!bitmap_git)
|
if (!bitmap_git)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -423,7 +424,8 @@ static int try_bitmap_count(struct rev_info *revs)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int try_bitmap_traversal(struct rev_info *revs)
|
static int try_bitmap_traversal(struct rev_info *revs,
|
||||||
|
struct list_objects_filter_options *filter)
|
||||||
{
|
{
|
||||||
struct bitmap_index *bitmap_git;
|
struct bitmap_index *bitmap_git;
|
||||||
|
|
||||||
@ -434,7 +436,7 @@ static int try_bitmap_traversal(struct rev_info *revs)
|
|||||||
if (revs->max_count >= 0)
|
if (revs->max_count >= 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
bitmap_git = prepare_bitmap_walk(revs, NULL);
|
bitmap_git = prepare_bitmap_walk(revs, filter);
|
||||||
if (!bitmap_git)
|
if (!bitmap_git)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -605,9 +607,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
|||||||
(revs.left_right || revs.cherry_mark))
|
(revs.left_right || revs.cherry_mark))
|
||||||
die(_("marked counting is incompatible with --objects"));
|
die(_("marked counting is incompatible with --objects"));
|
||||||
|
|
||||||
if (filter_options.choice)
|
|
||||||
use_bitmap_index = 0;
|
|
||||||
|
|
||||||
save_commit_buffer = (revs.verbose_header ||
|
save_commit_buffer = (revs.verbose_header ||
|
||||||
revs.grep_filter.pattern_list ||
|
revs.grep_filter.pattern_list ||
|
||||||
revs.grep_filter.header_list);
|
revs.grep_filter.header_list);
|
||||||
@ -618,9 +617,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
|||||||
progress = start_delayed_progress(show_progress, 0);
|
progress = start_delayed_progress(show_progress, 0);
|
||||||
|
|
||||||
if (use_bitmap_index) {
|
if (use_bitmap_index) {
|
||||||
if (!try_bitmap_count(&revs))
|
if (!try_bitmap_count(&revs, &filter_options))
|
||||||
return 0;
|
return 0;
|
||||||
if (!try_bitmap_traversal(&revs))
|
if (!try_bitmap_traversal(&revs, &filter_options))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user