Skip to content

Commit 2744383

Browse files
committed
Merge branch 'tb/geometric-repack'
"git repack" so far has been only capable of repacking everything under the sun into a single pack (or split by size). A cleverer strategy to reduce the cost of repacking a repository has been introduced. * tb/geometric-repack: builtin/pack-objects.c: ignore missing links with --stdin-packs builtin/repack.c: reword comment around pack-objects flags builtin/repack.c: be more conservative with unsigned overflows builtin/repack.c: assign pack split later t7703: test --geometric repack with loose objects builtin/repack.c: do not repack single packs with --geometric builtin/repack.c: add '--geometric' option packfile: add kept-pack cache for find_kept_pack_entry() builtin/pack-objects.c: rewrite honor-pack-keep logic p5303: measure time to repack with keep p5303: add missing &&-chains builtin/pack-objects.c: add '--stdin-packs' option revision: learn '--no-kept-objects' packfile: introduce 'find_kept_pack_entry()'
2 parents c6617d1 + 14e7b83 commit 2744383

13 files changed

+1029
-60
lines changed

Documentation/git-pack-objects.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ base-name::
8585
reference was included in the resulting packfile. This
8686
can be useful to send new tags to native Git clients.
8787

88+
--stdin-packs::
89+
Read the basenames of packfiles (e.g., `pack-1234abcd.pack`)
90+
from the standard input, instead of object names or revision
91+
arguments. The resulting pack contains all objects listed in the
92+
included packs (those not beginning with `^`), excluding any
93+
objects listed in the excluded packs (beginning with `^`).
94+
+
95+
Incompatible with `--revs`, or options that imply `--revs` (such as
96+
`--all`), with the exception of `--unpacked`, which is compatible.
97+
8898
--window=<n>::
8999
--depth=<n>::
90100
These two options affect how the objects contained in

Documentation/git-repack.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,29 @@ depth is 4095.
165165
Pass the `--delta-islands` option to `git-pack-objects`, see
166166
linkgit:git-pack-objects[1].
167167

168+
-g=<factor>::
169+
--geometric=<factor>::
170+
Arrange resulting pack structure so that each successive pack
171+
contains at least `<factor>` times the number of objects as the
172+
next-largest pack.
173+
+
174+
`git repack` ensures this by determining a "cut" of packfiles that need
175+
to be repacked into one in order to ensure a geometric progression. It
176+
picks the smallest set of packfiles such that as many of the larger
177+
packfiles (by count of objects contained in that pack) may be left
178+
intact.
179+
+
180+
Unlike other repack modes, the set of objects to pack is determined
181+
uniquely by the set of packs being "rolled-up"; in other words, the
182+
packs determined to need to be combined in order to restore a geometric
183+
progression.
184+
+
185+
When `--unpacked` is specified, loose objects are implicitly included in
186+
this "roll-up", without respect to their reachability. This is subject
187+
to change in the future. This option (implying a drastically different
188+
repack mode) is not guaranteed to work with all other combinations of
189+
option to `git repack`).
190+
168191
CONFIGURATION
169192
-------------
170193

0 commit comments

Comments
 (0)