[GSoC PATCH v2 0/4] preserve promisor files content after repack
- From
LorenzoPegorari <lorenzo.pegorari2002@gmail.com>
- Date
- Mar 22, 2026, 19:16 UTC
- Message-ID
- <cover.1774205661.git.lorenzo.pegorari2002@gmail.com>
- In-Reply-To
- <cover.1774125871.git.lorenzo.pegorari2002@gmail.com>
The goal of this patch is to solve the NEEDSWORK comment added by 5374a290 (fetch-pack: write fetched refs to .promisor, 14/10/2019). This is done by adding a helper function that takes the content of all .promisor files in the `repository`, and copies it inside the first .promisor file created by the repack.
Also, I added a comment explaining what is the purpose of the content of the .promisor files, since this wasn't explained anywhere (I found information regarding this only in the message of the previously cited commit).
Finally, I added a test to "t7700-repack.sh" that checks if the content of .promisor files are correctly copied into the first .promisor file created by a repack.
V2 DIFF: * changed how the `copy_all_promisor_files()` function works, so that it reads `dest` into a `strset` in its entirety before entering the `repo_for_each_pack()` loop, and then checks the `strset` for existence using `strset_add()` (as suggested by Eric Sunshine) * correctly release `strbuf`s * added test
LorenzoPegorari (4): pack-write: add explanation to promisor file content pack-write: add helper to fill promisor file after repack repack-promisor: preserve content of promisor files after repack t7700: test for promisor file content after repack
Documentation/git-repack.adoc | 4 +- pack-write.c | 70 +++++++++++++++++++++++++++++++++++ pack.h | 1 + repack-promisor.c | 23 ++++++++---- t/t7700-repack.sh | 12 ++++++ 5 files changed, 100 insertions(+), 10 deletions(-)
Range-diff against v1: 1: 9bba49563e = 1: fec0c24897 pack-write: add explanation to promisor file content 2: 3c0702f81b < -: ---------- pack-write: add helper to fill promisor file after repack -: ---------- > 2: 0bb031e744 pack-write: add helper to fill promisor file after repack 3: 6967066fe3 = 3: 3dab969a39 repack-promisor: preserve content of promisor files after repack -: ---------- > 4: cb642d8225 t7700: test for promisor file content after repack
-- 2.43.0