diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-10-01 18:38:10 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-01 16:40:09 -0700 |
commit | 324efc90d1b1a660388f8cabbb72e803160082d3 (patch) | |
tree | 10b32d61e2634b390caf291ad67ca6b3f66ffdb7 /t/t4208-log-magic-pathspec.sh | |
parent | builtin/repack.c: make largest pack preferred (diff) | |
download | tgif-324efc90d1b1a660388f8cabbb72e803160082d3.tar.xz |
builtin/repack.c: pass `--refs-snapshot` when writing bitmaps
To prevent the race described in an earlier patch, generate and pass a
reference snapshot to the multi-pack bitmap code, if we are writing one
from `git repack`.
This patch is mostly limited to creating a temporary file, and then
calling for_each_ref(). Except we try to minimize duplicates, since
doing so can drastically reduce the size in network-of-forks style
repositories. In the kernel's fork network (the repository containing
all objects from the kernel and all its forks), deduplicating the
references drops the snapshot size from 934 MB to just 12 MB.
But since we're handling duplicates in this way, we have to make sure
that we preferred references (those listed in pack.preferBitmapTips)
before non-preferred ones (to avoid recording an object which is pointed
at by a preferred tip as non-preferred).
We accomplish this by doing separate passes over the references: first
visiting each prefix in pack.preferBitmapTips, and then over the rest of
the references.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4208-log-magic-pathspec.sh')
0 files changed, 0 insertions, 0 deletions