Home Explore Blog CI



git

8th chunk of `Documentation/git-pack-objects.adoc`
d1105d83dc0275a28a10627ff1d5971a8f59bb65d8e569c90000000100000bbc
 by allowing you to group your refs into
distinct "islands". Pack-objects computes which objects are reachable
from which islands, and refuses to make a delta from an object `A`
against a base which is not present in all of `A`'s islands. This
results in slightly larger packs (because we miss some delta
opportunities), but guarantees that a fetch of one island will not have
to recompute deltas on the fly due to crossing island boundaries.

When repacking with delta islands the delta window tends to get
clogged with candidates that are forbidden by the config. Repacking
with a big --window helps (and doesn't take as long as it otherwise
might because we can reject some object pairs based on islands before
doing any computation on the content).

Islands are configured via the `pack.island` option, which can be
specified multiple times. Each value is a left-anchored regular
expressions matching refnames. For example:

-------------------------------------------
[pack]
island = refs/heads/
island = refs/tags/
-------------------------------------------

puts heads and tags into an island (whose name is the empty string; see
below for more on naming). Any refs which do not match those regular
expressions (e.g., `refs/pull/123`) is not in any island. Any object
which is reachable only from `refs/pull/` (but not heads or tags) is
therefore not a candidate to be used as a base for `refs/heads/`.

Refs are grouped into islands based on their "names", and two regexes
that produce the same name are considered to be in the same
island. The names are computed from the regexes by concatenating any
capture groups from the regex, with a '-' dash in between. (And if
there are no capture groups, then the name is the empty string, as in
the above example.) This allows you to create arbitrary numbers of
islands. Only up to 14 such capture groups are supported though.

For example, imagine you store the refs for each fork in
`refs/virtual/ID`, where `ID` is a numeric identifier. You might then
configure:

-------------------------------------------
[pack]
island = refs/virtual/([0-9]+)/heads/
island = refs/virtual/([0-9]+)/tags/
island = refs/virtual/([0-9]+)/(pull)/
-------------------------------------------

That puts the heads and tags for each fork in their own island (named
"1234" or similar), and the pull refs for each go into their own
"1234-pull".

Note that we pick a single island for each regex to go into, using "last
one wins" ordering (which allows repo-specific config to take precedence
over user-wide config, and so forth).


CONFIGURATION
-------------

Various configuration variables affect packing, see
linkgit:git-config[1] (search for "pack" and "delta").

Notably, delta compression is not used on objects larger than the
`core.bigFileThreshold` configuration variable and on files with the
attribute `delta` set to false.

SEE ALSO
--------
linkgit:git-rev-list[1]
linkgit:git-repack[1]
linkgit:git-prune-packed[1]

GIT
---
Part of the linkgit:git[1] suite

Title: Git Delta Islands Configuration and Usage
Summary
Delta islands in Git allow for grouping refs into distinct islands to optimize delta compression, with configuration via the `pack.island` option using left-anchored regular expressions, and island names computed from regex capture groups, enabling efficient packing and fetching, with additional configuration options and variables affecting packing behavior.