aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/commit-graph.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2023-10-02 18:55:01 +0200
committerJunio C Hamano <gitster@pobox.com>2023-10-02 14:54:30 -0700
commit48a9b67b4301083d0820e90afef208ed1436298f (patch)
treee9ccde728d847d0b6d1cfd5bb628f1d8feaec4c7 /builtin/commit-graph.c
parentpack-bitmap-write: rebuild using new bitmap when remapping (diff)
downloadgit-48a9b67b4301083d0820e90afef208ed1436298f.tar.gz
git-48a9b67b4301083d0820e90afef208ed1436298f.zip
repack: add `--filter=<filter-spec>` option
This new option puts the objects specified by `<filter-spec>` into a separate packfile. This could be useful if, for example, some blobs take up a lot of precious space on fast storage while they are rarely accessed. It could make sense to move them into a separate cheaper, though slower, storage. It's possible to find which new packfile contains the filtered out objects using one of the following: - `git verify-pack -v ...`, - `test-tool find-pack ...`, which a previous commit added, - `--filter-to=<dir>`, which a following commit will add to specify where the pack containing the filtered out objects will be. This feature is implemented by running `git pack-objects` twice in a row. The first command is run with `--filter=<filter-spec>`, using the specified filter. It packs objects while omitting the objects specified by the filter. Then another `git pack-objects` command is launched using `--stdin-packs`. We pass it all the previously existing packs into its stdin, so that it will pack all the objects in the previously existing packs. But we also pass into its stdin, the pack created by the previous `git pack-objects --filter=<filter-spec>` command as well as the kept packs, all prefixed with '^', so that the objects in these packs will be omitted from the resulting pack. The result is that only the objects filtered out by the first `git pack-objects` command are in the pack resulting from the second `git pack-objects` command. As the interactions with kept packs are a bit tricky, a few related tests are added. Helped-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-graph.c')
0 files changed, 0 insertions, 0 deletions