Skip to content

repack: write filtered-out objects as loose objects

Adithya Chakilam via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2repack: add --filter-to-loose to write filtered-out objects as loose objectsDocumentation/git-repack.adoc builtin/repack.c repack-filtered.c +2 more+199 -71 reply
2/2repack: also copy loose objects excluded by --filter-to-looseDocumentation/git-repack.adoc builtin/repack.c repack-filtered.c +2 more+195 -00 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/2] repack: write filtered-out objects as loose objects

Some key-value object stores manage and retrieve Git objects individually. The existing --filter-to option writes filtered-out objects into packs, so using it with such stores requires unpacking the resulting packs before importing the objects.

This series adds --filter-to-loose=dir to git repack, allowing filtered-out objects to be written directly as loose objects into another object directory.

With --filter-to-loose, repack streams the filtered pack into unpack-objects, avoiding that extra step and the intermediate pack file. For example:

git repack -a --filter=blob=1m --filter-to-loose=/path/to/objects

The destination is treated as a Git object directory.

The first patch adds the option for objects already stored in packs. The second extends it to include loose objects excluded by the filter, so the destination also receives those objects. Objects already present in the destination are not rewritten. With -d, the source copies of those loose objects are removed after all objects have been written successfully.

Adithya Chakilam (2):
repack: add --filter-to-loose to write filtered-out objects as loose
objects
repack: also copy loose objects excluded by --filter-to-loose

 Documentation/git-repack.adoc |  14 ++-
 builtin/repack.c              |  32 +++++-
 repack-filtered.c             | 152 ++++++++++++++++++++++++++-
 repack.h                      |  14 +++
 t/t7700-repack.sh             | 189 ++++++++++++++++++++++++++++++++++
 5 files changed, 394 insertions(+), 7 deletions(-)

base-commit: 1891de46f79dc444a47db1c87bd0c8c76b5463f2
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2314%2Fachakilam-nv%2Ffilter-to-loose-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2314/achakilam-nv/filter-to-loose-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2314

Signature · 1 line
gitgitgadget