Skip to content

pack-objects: simplify add_objects_in_unpacked_packs()

Taylor Blau git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3object-store.h: teach for_each_packed_object to ignore kept packsobject-store.h packfile.c+12 -00 replies
2/3builtin/pack-objects.c: simplify add_objects_in_unpacked_packs()builtin/pack-objects.c+16 -682 replies
3/3builtin/pack-objects.c: remove duplicate hash lookupbuiltin/pack-objects.c object.h+1 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] pack-objects: simplify add_objects_in_unpacked_packs()

This short series is extracted from mine and Peff's work on cruft packs. These three patches focus on cleaning up add_objects_in_unpacked_packs(), which is used to implement git repack -k.

The pay-off for this clean-up is significant, though: we net -50 lines of code, and the result is much more readable, at least in my opinion.

The changes are described in detail in the patch messages, but essentially we are replacing a loop over get_all_packs() with for_each_packed_object() after adding a couple of new flags necessary to make the switch. And once we are done with that, the third patch removes a bit from the object flag allocation table.

Thanks in advance for your review.

Taylor Blau (3):
object-store.h: teach for_each_packed_object to ignore kept packs builtin/pack-objects.c: simplify add_objects_in_unpacked_packs() builtin/pack-objects.c: remove duplicate hash lookup

 builtin/pack-objects.c | 85 ++++++------------------------------------
 object-store.h         |  6 +++
 object.h               |  1 -
 packfile.c             |  6 +++
 4 files changed, 24 insertions(+), 74 deletions(-)
Signature · 1 line
2.33.0.96.g73915697e6