On Tue, Apr 27, 2021 at 10:41:18AM -0400, Jeff King wrote: > I think we'd just want to run the whole mark_recent block after doing > the bitmap traversal. > > There may be some subtlety with reusing the rev_info struct again. I > think we'd want to reset the pending objects list after calling into the > bitmap code. It _usually_ does an actual traversal that consumes the > list, but not necessarily. I think traverse_bitmap_commit_list() > probably ought to be the one to do it, so it behaves more like > traverse_commit_list(). (OTOH, I don't think it's _too_ bad if we don't; > we'd include those already-seen objects in our traversal, but they > should all by definition have the SEEN bit set, so we'd stop there). Nope, I was wrong here. It's actually prepare_bitmap_walk() which would want to clear the pending list, and it does so (it may later re-add objects in find_objects(), but if it does so, it will definitely traverse and consume them). > It's possible that we could do the second mark_recent traversal also > with bitmaps (but still separately). I can't offhand think of a reason > that ignore_missing_links wouldn't behave well there. But since we > expect it to be small, I'd be more comfortable just using the regular > traversal code. I poked at this a bit, and indeed, the bitmap code is not ready to handle the caller passing ignore_missing_links (it performs two separate traversals for the wanted and uninteresting objects, and manipulates ignore_missing_links itself between the two). It would probably be easy to change, but I think we should focus on the minimal fix for the bug you found first. -Peff