Skip to content

Using index-pack in place of verify-pack

Junio C Hamano git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5index-pack: group the delta-base array entries also by typebuiltin/index-pack.c+40 -210 replies
2/5write_idx_file: introduce a struct to hold idx customization optionsbuiltin/index-pack.c builtin/pack-objects.c fast-import.c +2 more+48 -330 replies
3/5index-pack: --verifybuiltin/index-pack.c csum-file.c csum-file.h +3 more+125 -172 replies
4/5write_idx_file: need_large_offset() helper functionpack-write.c+19 -100 replies
5/5index-pack --verify: read anomalous offsets from v2 idx filebuiltin/index-pack.c pack-write.c pack.h +1 more+74 -20 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/5] Using index-pack in place of verify-pack

The verify-pack command walks objects in a pack for contents verification in a very naive way, namely, in the object name order. It is inefficient compared to the way index-pack does, which verifies contents of the objects in the order delta-chain is applied. As the result, the former command would end up reconstituting the same intermediate object in a delta chain number of times while the latter would recreate an object only once.

This series, which is still a WIP, is to teach index-pack "--verify" option, in order to eventually replace verify-pack with it.

The basic idea, which comes from Shawn Pearce, is to run index-pack on a packfile being verified, and compare the resulting .idx file with the existing one, and make sure they match.

Junio C Hamano (5):
index-pack: group the delta-base array entries also by type
write_idx_file: introduce a struct to hold idx customization options
index-pack: --verify
write_idx_file: need_large_offset() helper function index-pack --verify: read anomalous offsets from v2 idx file

 builtin/index-pack.c   |  178 ++++++++++++++++++++++++++++++++++++++----------
 builtin/pack-objects.c |   20 +++---
 csum-file.c            |   46 ++++++++++++-
 csum-file.h            |    2 +
 fast-import.c          |   10 ++-
 pack-write.c           |   82 ++++++++++++++++------
 pack.h                 |   23 +++++-
 t/t5302-pack-index.sh  |   18 +++++
 8 files changed, 301 insertions(+), 78 deletions(-)