Skip to content

repack: avoid MIDX'ing cruft pack(s) where possible

Taylor Blau git 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest9 patches 8 repliesIn review
  2. v59 patches 5 repliesSuperseded
  3. v49 patches 3 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v39 patches10 repliesSuperseded
v28 patches18 repliesSuperseded
v1 RFC8 patches0 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9pack-objects: use standard option incompatibility functionsbuiltin/pack-objects.c t/t5331-pack-objects-stdin.sh+12 -102 replies
2/9pack-objects: limit scope in 'add_object_entry_from_pack()'builtin/pack-objects.c+1 -11 reply
3/9pack-objects: factor out handling '--stdin-packs'builtin/pack-objects.c+12 -60 replies
4/9pack-objects: declare 'rev_info' for '--stdin-packs' earlierbuiltin/pack-objects.c+36 -351 reply
5/9pack-objects: perform name-hash traversal for unpacked objectsbuiltin/pack-objects.c+12 -82 replies
6/9pack-objects: fix typo in 'show_object_pack_hint()'builtin/pack-objects.c+1 -10 replies
7/9pack-objects: swap 'show_{object,commit}_pack_hint'builtin/pack-objects.c+6 -60 replies
8/9pack-objects: introduce '--stdin-packs=follow'Documentation/git-pack-objects.adoc builtin/pack-objects.c t/t5331-pack-objects-stdin.sh+193 -232 replies
9/9repack: exclude cruft pack(s) from the MIDX where possibleDocumentation/config/repack.adoc builtin/repack.c t/t7704-repack-cruft.sh+319 -200 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by.

PatchElijah Newren
1/9
2/9
3/9
4/9
5/9
6/9Noticed-by
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/9] repack: avoid MIDX'ing cruft pack(s) where possible

Here is an additional reroll of my series to create MIDXs that do not include a repository's cruft pack(s).

Nearly everything is identical between this version and the previous (v5), with two exceptions:

- Adjusted where to split a long line in show_object_pack_hint().

- Fixed a test failure with GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL

Thanks for Junio and Peff (respectively) for pointing out each of the above. As usual, a range-diff is attached for convenience.

Thanks in advance for any review :-).

Taylor Blau (9):
pack-objects: use standard option incompatibility functions
pack-objects: limit scope in 'add_object_entry_from_pack()'
pack-objects: factor out handling '--stdin-packs'
pack-objects: declare 'rev_info' for '--stdin-packs' earlier
pack-objects: perform name-hash traversal for unpacked objects
pack-objects: fix typo in 'show_object_pack_hint()'
pack-objects: swap 'show_{object,commit}_pack_hint'
pack-objects: introduce '--stdin-packs=follow'
repack: exclude cruft pack(s) from the MIDX where possible

 Documentation/config/repack.adoc    |   7 +
 Documentation/git-pack-objects.adoc |  10 +-
 builtin/pack-objects.c              | 193 ++++++++++++++++++----------
 builtin/repack.c                    | 187 ++++++++++++++++++++++++---
 t/t5331-pack-objects-stdin.sh       | 122 +++++++++++++++++-
 t/t7704-repack-cruft.sh             | 145 +++++++++++++++++++++
 6 files changed, 573 insertions(+), 91 deletions(-)

Range-diff against v5:

 1:  19fab7a35c =  1:  8e7b2dacc7 pack-objects: use standard option incompatibility functions
 2:  6f2d3f17a4 =  2:  86fb36d317 pack-objects: limit scope in 'add_object_entry_from_pack()'
 3:  c06f5b264a =  3:  19e8c789e9 pack-objects: factor out handling '--stdin-packs'
 4:  40d7d87cb1 =  4:  c9f874eb94 pack-objects: declare 'rev_info' for '--stdin-packs' earlier
 5:  5e2599436c =  5:  6b0149a32d pack-objects: perform name-hash traversal for unpacked objects
 6:  3a5c3f63d8 =  6:  f31dd00a98 pack-objects: fix typo in 'show_object_pack_hint()'
 7:  796e8743f8 =  7:  5d15055985 pack-objects: swap 'show_{object,commit}_pack_hint'
 8:  8830775beb !  8:  3699c25337 pack-objects: introduce '--stdin-packs=follow'
    @@ builtin/pack-objects.c: static int add_object_entry_from_pack(const struct objec
     -		return;
     +	enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
     +	if (mode == STDIN_PACKS_MODE_FOLLOW) {
    -+		if (object->type == OBJ_BLOB && !has_object(the_repository,
    -+							    &object->oid, 0))
    ++		if (object->type == OBJ_BLOB &&
    ++		    !has_object(the_repository, &object->oid, 0))
     +			return;
     +		add_object_entry(&object->oid, object->type, name, 0);
     +	} else {
 9:  8f505179cc !  9:  f519777059 repack: exclude cruft pack(s) from the MIDX where possible
    @@ builtin/repack.c: int cmd_repack(int argc,
      	string_list_sort(&names);
      
     +	if (get_local_multi_pack_index(the_repository)) {
    -+		uint32_t i;
     +		struct multi_pack_index *m =
     +			get_local_multi_pack_index(the_repository);
     +
    -+		ALLOC_ARRAY(midx_pack_names, m->num_packs);
    -+		for (i = 0; i < m->num_packs; i++)
    -+			midx_pack_names[midx_pack_names_nr++] = xstrdup(m->pack_names[i]);
    ++		ALLOC_ARRAY(midx_pack_names,
    ++			    m->num_packs + m->num_packs_in_base);
    ++
    ++		for (; m; m = m->base_midx)
    ++			for (uint32_t i = 0; i < m->num_packs; i++)
    ++				midx_pack_names[midx_pack_names_nr++] =
    ++					xstrdup(m->pack_names[i]);
     +	}
     +
      	close_object_store(the_repository->objects);

base-commit: f9aa0eedb37eb94d9d3711ef0d565fd7cb3b6148

Signature · 1 line
2.50.0.61.g1981e40f2d