1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=UTF-8" />
7 <meta name=
"generator" content=
"AsciiDoc 10.2.0" />
8 <title>git-pack-objects(
1)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.5em;
129 margin-bottom:
1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
228 div.imageblock div.content { padding-left:
0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size:
2em; }
411 span.small { font-size:
0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
443 div.tableblock
> table[
frame=
"hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock
> table[
frame=
"vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
480 border-color: #
527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-top {
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September
2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September
2006. License: GPL */
559 /* modified by Stuart Rackham,
2006,
2009. License: GPL */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([
1-'+(toclevels+
1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType ==
1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute(
"class") || i.getAttribute(
"className")) !=
"float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[
1]-
1);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
610 for (i =
0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute(
"class")
614 && entry.getAttribute(
"class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i =
0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById(
"content"), toclevels);
623 for (var i =
0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id ==
"")
626 entry.element.id =
"_toc_" + i;
627 var a = document.createElement(
"a");
628 a.href =
"#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement(
"div");
632 div.className =
"toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length ==
0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/
2005/
07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
651 var noteholder = document.getElementById(
"footnotes");
655 var entriesToRemove = [];
656 for (i =
0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute(
"class") ==
"footnote")
659 entriesToRemove.push(entry);
661 for (i =
0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById(
"content");
667 var spans = cont.getElementsByTagName(
"span");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-note");
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[
1];
679 "[<a id='_footnoteref_" + n +
"' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n +
"</a>]";
681 spans[i].setAttribute(
"data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n +
"'>" +
685 "<a href='#_footnoteref_" + n +
"' title='Return to text'>" +
686 n +
"</a>. " + note +
"</div>";
687 var id =spans[i].getAttribute(
"id");
688 if (id != null) refs[
"#"+id] = n;
692 noteholder.parentNode.removeChild(noteholder);
694 // Process footnoterefs.
695 for (i=
0; i
<spans.length; i++) {
696 if (spans[i].className ==
"footnoteref") {
697 var href = spans[i].getElementsByTagName(
"a")[
0].getAttribute(
"href");
698 href = href.match(/#.*/)[
0]; // Because IE return full URL.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 git-pack-objects(
1) Manual Page
741 <div class=
"sectionbody">
742 <p>git-pack-objects -
743 Create a packed archive of objects
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"verseblock">
752 <pre class=
"content"><em>git pack-objects
</em> [-q | --progress | --all-progress] [--all-progress-implied]
753 [--no-reuse-delta] [--delta-base-offset] [--non-empty]
754 [--local] [--incremental] [--window=
<n
>] [--depth=
<n
>]
755 [--revs [--unpacked | --all]] [--keep-pack=
<pack-name
>]
756 [--cruft] [--cruft-expiration=
<time
>]
757 [--stdout [--filter=
<filter-spec
>] |
<base-name
>]
758 [--shallow] [--keep-true-parents] [--[no-]sparse]
< <object-list
></pre>
759 <div class=
"attribution">
764 <h2 id=
"_description">DESCRIPTION
</h2>
765 <div class=
"sectionbody">
766 <div class=
"paragraph"><p>Reads list of objects from the standard input, and writes either one or
767 more packed archives with the specified base-name to disk, or a packed
768 archive to the standard output.
</p></div>
769 <div class=
"paragraph"><p>A packed archive is an efficient way to transfer a set of objects
770 between two repositories as well as an access efficient archival
771 format. In a packed archive, an object is either stored as a
772 compressed whole or as a difference from some other object.
773 The latter is often called a delta.
</p></div>
774 <div class=
"paragraph"><p>The packed archive format (.pack) is designed to be self-contained
775 so that it can be unpacked without any further information. Therefore,
776 each object that a delta depends upon must be present within the pack.
</p></div>
777 <div class=
"paragraph"><p>A pack index file (.idx) is generated for fast, random access to the
778 objects in the pack. Placing both the index file (.idx) and the packed
779 archive (.pack) in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
780 any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
781 enables Git to read from the pack archive.
</p></div>
782 <div class=
"paragraph"><p>The
<em>git unpack-objects
</em> command can read the packed archive and
783 expand the objects contained in the pack into
"one-file
784 one-object" format; this is typically done by the smart-pull
785 commands when a pack is created on-the-fly for efficient network
786 transport by their peers.
</p></div>
790 <h2 id=
"_options">OPTIONS
</h2>
791 <div class=
"sectionbody">
792 <div class=
"dlist"><dl>
798 Write into pairs of files (.pack and .idx), using
799 <base-name
> to determine the name of the created file.
800 When this option is used, the two files in a pair are written in
801 <base-name
>-
<SHA-
1>.{pack,idx} files.
<SHA-
1> is a hash
802 based on the pack content and is written to the standard
803 output of the command.
811 Write the pack contents (what would have been written to
812 .pack file) out to the standard output.
820 Read the revision arguments from the standard input, instead of
821 individual object names. The revision arguments are processed
822 the same way as
<em>git rev-list
</em> with the
<code>--objects
</code> flag
823 uses its
<code>commit
</code> arguments to build the list of objects it
824 outputs. The objects on the resulting list are packed.
825 Besides revisions,
<code>--not
</code> or
<code>--shallow
<SHA-
1></code> lines are
834 This implies
<code>--revs
</code>. When processing the list of
835 revision arguments read from the standard input, limit
836 the objects packed to those that are not already packed.
844 This implies
<code>--revs
</code>. In addition to the list of
845 revision arguments read from the standard input, pretend
846 as if all refs under
<code>refs/
</code> are specified to be
855 Include unasked-for annotated tags if the object they
856 reference was included in the resulting packfile. This
857 can be useful to send new tags to native Git clients.
865 Read the basenames of packfiles (e.g.,
<code>pack-
1234abcd.pack
</code>)
866 from the standard input, instead of object names or revision
867 arguments. The resulting pack contains all objects listed in the
868 included packs (those not beginning with
<code>^
</code>), excluding any
869 objects listed in the excluded packs (beginning with
<code>^
</code>).
871 <div class=
"paragraph"><p>Incompatible with
<code>--revs
</code>, or options that imply
<code>--revs
</code> (such as
872 <code>--all
</code>), with the exception of
<code>--unpacked
</code>, which is compatible.
</p></div>
879 Packs unreachable objects into a separate
"cruft" pack, denoted
880 by the existence of a
<code>.mtimes
</code> file. Typically used by
<code>git
881 repack --cruft
</code>. Callers provide a list of pack names and
882 indicate which packs will remain in the repository, along with
883 which packs will be deleted (indicated by the
<code>-
</code> prefix). The
884 contents of the cruft pack are all objects not contained in the
885 surviving packs which have not exceeded the grace period (see
886 <code>--cruft-expiration
</code> below), or which have exceeded the grace
887 period, but are reachable from an other object which hasn
’t.
889 <div class=
"paragraph"><p>When the input lists a pack containing all reachable objects (and lists
890 all other packs as pending deletion), the corresponding cruft pack will
891 contain all unreachable objects (with mtime newer than the
892 <code>--cruft-expiration
</code>) along with any unreachable objects whose mtime is
893 older than the
<code>--cruft-expiration
</code>, but are reachable from an
894 unreachable object whose mtime is newer than the
<code>--cruft-expiration
</code>).
</p></div>
895 <div class=
"paragraph"><p>Incompatible with
<code>--unpack-unreachable
</code>,
<code>--keep-unreachable
</code>,
896 <code>--pack-loose-unreachable
</code>,
<code>--stdin-packs
</code>, as well as any other
897 options which imply
<code>--revs
</code>. Also incompatible with
<code>--max-pack-size
</code>;
898 when this option is set, the maximum pack size is not inferred from
899 <code>pack.packSizeLimit
</code>.
</p></div>
902 --cruft-expiration=
<approxidate
>
906 If specified, objects are eliminated from the cruft pack if they
907 have an mtime older than
<code><approxidate
></code>. If unspecified (and
908 given
<code>--cruft
</code>), then no objects are eliminated.
919 These two options affect how the objects contained in
920 the pack are stored using delta compression. The
921 objects are first internally sorted by type, size and
922 optionally names and compared against the other objects
923 within --window to see if using delta compression saves
924 space. --depth limits the maximum delta depth; making
925 it too deep affects the performance on the unpacker
926 side, because delta data needs to be applied that many
927 times to get to the necessary object.
929 <div class=
"paragraph"><p>The default value for --window is
10 and --depth is
50. The maximum
930 depth is
4095.
</p></div>
933 --window-memory=
<n
>
937 This option provides an additional limit on top of
<code>--window
</code>;
938 the window size will dynamically scale down so as to not take
939 up more than
<em><n
></em> bytes in memory. This is useful in
940 repositories with a mix of large and small objects to not run
941 out of memory with a large window, but still be able to take
942 advantage of the large window for the smaller objects. The
943 size can be suffixed with
"k",
"m", or
"g".
944 <code>--window-memory=
0</code> makes memory usage unlimited. The default
945 is taken from the
<code>pack.windowMemory
</code> configuration variable.
949 --max-pack-size=
<n
>
953 In unusual scenarios, you may not be able to create files
954 larger than a certain size on your filesystem, and this option
955 can be used to tell the command to split the output packfile
956 into multiple independent packfiles, each not larger than the
957 given size. The size can be suffixed with
958 "k",
"m", or
"g". The minimum size allowed is limited to
1 MiB.
959 The default is unlimited, unless the config variable
960 <code>pack.packSizeLimit
</code> is set. Note that this option may result in
961 a larger and slower repository; see the discussion in
962 <code>pack.packSizeLimit
</code>.
970 This flag causes an object already in a local pack that
971 has a .keep file to be ignored, even if it would have
972 otherwise been packed.
976 --keep-pack=
<pack-name
>
980 This flag causes an object already in the given pack to be
981 ignored, even if it would have otherwise been
982 packed.
<code><pack-name
></code> is the pack file name without
983 leading directory (e.g.
<code>pack-
123.pack
</code>). The option could be
984 specified multiple times to keep multiple packs.
992 This flag causes an object already in a pack to be ignored
993 even if it would have otherwise been packed.
1001 This flag causes an object that is borrowed from an alternate
1002 object store to be ignored even if it would have otherwise been
1006 <dt class=
"hdlist1">
1011 Only create a packed archive if it would contain at
1015 <dt class=
"hdlist1">
1020 Progress status is reported on the standard error stream
1021 by default when it is attached to a terminal, unless -q
1022 is specified. This flag forces progress status even if
1023 the standard error stream is not directed to a terminal.
1026 <dt class=
"hdlist1">
1031 When --stdout is specified then progress report is
1032 displayed during the object count and compression phases
1033 but inhibited during the write-out phase. The reason is
1034 that in some cases the output stream is directly linked
1035 to another command which may wish to display progress
1036 status of its own as it processes incoming pack data.
1037 This flag is like --progress except that it forces progress
1038 report for the write-out phase as well even if --stdout is
1042 <dt class=
"hdlist1">
1043 --all-progress-implied
1047 This is used to imply --all-progress whenever progress display
1048 is activated. Unlike --all-progress this flag doesn
’t actually
1049 force any progress display by itself.
1052 <dt class=
"hdlist1">
1057 This flag makes the command not to report its progress
1058 on the standard error stream.
1061 <dt class=
"hdlist1">
1066 When creating a packed archive in a repository that
1067 has existing packs, the command reuses existing deltas.
1068 This sometimes results in a slightly suboptimal pack.
1069 This flag tells the command not to reuse existing deltas
1070 but compute them from scratch.
1073 <dt class=
"hdlist1">
1078 This flag tells the command not to reuse existing object data at all,
1079 including non deltified object, forcing recompression of everything.
1080 This implies --no-reuse-delta. Useful only in the obscure case where
1081 wholesale enforcement of a different compression level on the
1082 packed data is desired.
1085 <dt class=
"hdlist1">
1086 --compression=
<n
>
1090 Specifies compression level for newly-compressed data in the
1091 generated pack. If not specified, pack compression level is
1092 determined first by pack.compression, then by core.compression,
1093 and defaults to -
1, the zlib default, if neither is set.
1094 Add --no-reuse-object if you want to force a uniform compression
1095 level on all data no matter the source.
1098 <dt class=
"hdlist1">
1103 Toggle the
"sparse" algorithm to determine which objects to include in
1104 the pack, when combined with the
"--revs" option. This algorithm
1105 only walks trees that appear in paths that introduce new objects.
1106 This can have significant performance benefits when computing
1107 a pack to send a small change. However, it is possible that extra
1108 objects are added to the pack-file if the included commits contain
1109 certain types of direct renames. If this option is not included,
1110 it defaults to the value of
<code>pack.useSparse
</code>, which is true unless
1111 otherwise specified.
1114 <dt class=
"hdlist1">
1119 Create a
"thin" pack by omitting the common objects between a
1120 sender and a receiver in order to reduce network transfer. This
1121 option only makes sense in conjunction with --stdout.
1123 <div class=
"paragraph"><p>Note: A thin pack violates the packed archive format by omitting
1124 required objects and is thus unusable by Git without making it
1125 self-contained. Use
<code>git index-pack --fix-thin
</code>
1126 (see
<a href=
"git-index-pack.html">git-index-pack(
1)
</a>) to restore the self-contained property.
</p></div>
1128 <dt class=
"hdlist1">
1133 Optimize a pack that will be provided to a client with a shallow
1134 repository. This option, combined with --thin, can result in a
1135 smaller pack at the cost of speed.
1138 <dt class=
"hdlist1">
1143 A packed archive can express the base object of a delta as
1144 either a
20-byte object name or as an offset in the
1145 stream, but ancient versions of Git don
’t understand the
1146 latter. By default,
<em>git pack-objects
</em> only uses the
1147 former format for better compatibility. This option
1148 allows the command to use the latter format for
1149 compactness. Depending on the average delta chain
1150 length, this option typically shrinks the resulting
1151 packfile by
3-
5 per-cent.
1153 <div class=
"paragraph"><p>Note: Porcelain commands such as
<code>git gc
</code> (see
<a href=
"git-gc.html">git-gc(
1)
</a>),
1154 <code>git repack
</code> (see
<a href=
"git-repack.html">git-repack(
1)
</a>) pass this option by default
1155 in modern Git when they put objects in your repository into pack files.
1156 So does
<code>git bundle
</code> (see
<a href=
"git-bundle.html">git-bundle(
1)
</a>) when it creates a bundle.
</p></div>
1158 <dt class=
"hdlist1">
1163 Specifies the number of threads to spawn when searching for best
1164 delta matches. This requires that pack-objects be compiled with
1165 pthreads otherwise this option is ignored with a warning.
1166 This is meant to reduce packing time on multiprocessor machines.
1167 The required amount of memory for the delta search window is
1168 however multiplied by the number of threads.
1169 Specifying
0 will cause Git to auto-detect the number of CPU
’s
1170 and set the number of threads accordingly.
1173 <dt class=
"hdlist1">
1174 --index-version=
<version
>[,
<offset
>]
1178 This is intended to be used by the test suite only. It allows
1179 to force the version for the generated pack index, and to force
1180 64-bit index entries on objects located above the given offset.
1183 <dt class=
"hdlist1">
1188 With this option, parents that are hidden by grafts are packed
1192 <dt class=
"hdlist1">
1193 --filter=
<filter-spec
>
1197 Requires
<code>--stdout
</code>. Omits certain objects (usually blobs) from
1198 the resulting packfile. See
<a href=
"git-rev-list.html">git-rev-list(
1)
</a> for valid
1199 <code><filter-spec
></code> forms.
1202 <dt class=
"hdlist1">
1207 Turns off any previous
<code>--filter=
</code> argument.
1210 <dt class=
"hdlist1">
1211 --missing=
<missing-action
>
1215 A debug option to help with future
"partial clone" development.
1216 This option specifies how missing objects are handled.
1218 <div class=
"paragraph"><p>The form
<em>--missing=error
</em> requests that pack-objects stop with an error if
1219 a missing object is encountered. If the repository is a partial clone, an
1220 attempt to fetch missing objects will be made before declaring them missing.
1221 This is the default action.
</p></div>
1222 <div class=
"paragraph"><p>The form
<em>--missing=allow-any
</em> will allow object traversal to continue
1223 if a missing object is encountered. No fetch of a missing object will occur.
1224 Missing objects will silently be omitted from the results.
</p></div>
1225 <div class=
"paragraph"><p>The form
<em>--missing=allow-promisor
</em> is like
<em>allow-any
</em>, but will only
1226 allow object traversal to continue for EXPECTED promisor missing objects.
1227 No fetch of a missing object will occur. An unexpected missing object will
1228 raise an error.
</p></div>
1230 <dt class=
"hdlist1">
1231 --exclude-promisor-objects
1235 Omit objects that are known to be in the promisor remote. (This
1236 option has the purpose of operating only on locally created objects,
1237 so that when we repack, we still maintain a distinction between
1238 locally created objects [without .promisor] and objects from the
1239 promisor remote [with .promisor].) This is used with partial clone.
1242 <dt class=
"hdlist1">
1247 Objects unreachable from the refs in packs named with
1248 --unpacked= option are added to the resulting pack, in
1249 addition to the reachable objects that are not in packs marked
1250 with *.keep files. This implies
<code>--revs
</code>.
1253 <dt class=
"hdlist1">
1254 --pack-loose-unreachable
1258 Pack unreachable loose objects (and their loose counterparts
1259 removed). This implies
<code>--revs
</code>.
1262 <dt class=
"hdlist1">
1263 --unpack-unreachable
1267 Keep unreachable objects in loose form. This implies
<code>--revs
</code>.
1270 <dt class=
"hdlist1">
1275 Restrict delta matches based on
"islands". See DELTA ISLANDS
1283 <h2 id=
"_delta_islands">DELTA ISLANDS
</h2>
1284 <div class=
"sectionbody">
1285 <div class=
"paragraph"><p>When possible,
<code>pack-objects
</code> tries to reuse existing on-disk deltas to
1286 avoid having to search for new ones on the fly. This is an important
1287 optimization for serving fetches, because it means the server can avoid
1288 inflating most objects at all and just send the bytes directly from
1289 disk. This optimization can
’t work when an object is stored as a delta
1290 against a base which the receiver does not have (and which we are not
1291 already sending). In that case the server
"breaks" the delta and has to
1292 find a new one, which has a high CPU cost. Therefore it
’s important for
1293 performance that the set of objects in on-disk delta relationships match
1294 what a client would fetch.
</p></div>
1295 <div class=
"paragraph"><p>In a normal repository, this tends to work automatically. The objects
1296 are mostly reachable from the branches and tags, and that
’s what clients
1297 fetch. Any deltas we find on the server are likely to be between objects
1298 the client has or will have.
</p></div>
1299 <div class=
"paragraph"><p>But in some repository setups, you may have several related but separate
1300 groups of ref tips, with clients tending to fetch those groups
1301 independently. For example, imagine that you are hosting several
"forks"
1302 of a repository in a single shared object store, and letting clients
1303 view them as separate repositories through
<code>GIT_NAMESPACE
</code> or separate
1304 repos using the alternates mechanism. A naive repack may find that the
1305 optimal delta for an object is against a base that is only found in
1306 another fork. But when a client fetches, they will not have the base
1307 object, and we
’ll have to find a new delta on the fly.
</p></div>
1308 <div class=
"paragraph"><p>A similar situation may exist if you have many refs outside of
1309 <code>refs/heads/
</code> and
<code>refs/tags/
</code> that point to related objects (e.g.,
1310 <code>refs/pull
</code> or
<code>refs/changes
</code> used by some hosting providers). By
1311 default, clients fetch only heads and tags, and deltas against objects
1312 found only in those other groups cannot be sent as-is.
</p></div>
1313 <div class=
"paragraph"><p>Delta islands solve this problem by allowing you to group your refs into
1314 distinct
"islands". Pack-objects computes which objects are reachable
1315 from which islands, and refuses to make a delta from an object
<code>A
</code>
1316 against a base which is not present in all of
<code>A
</code>'s islands. This
1317 results in slightly larger packs (because we miss some delta
1318 opportunities), but guarantees that a fetch of one island will not have
1319 to recompute deltas on the fly due to crossing island boundaries.
</p></div>
1320 <div class=
"paragraph"><p>When repacking with delta islands the delta window tends to get
1321 clogged with candidates that are forbidden by the config. Repacking
1322 with a big --window helps (and doesn
’t take as long as it otherwise
1323 might because we can reject some object pairs based on islands before
1324 doing any computation on the content).
</p></div>
1325 <div class=
"paragraph"><p>Islands are configured via the
<code>pack.island
</code> option, which can be
1326 specified multiple times. Each value is a left-anchored regular
1327 expressions matching refnames. For example:
</p></div>
1328 <div class=
"listingblock">
1329 <div class=
"content">
1331 island = refs/heads/
1332 island = refs/tags/
</code></pre>
1334 <div class=
"paragraph"><p>puts heads and tags into an island (whose name is the empty string; see
1335 below for more on naming). Any refs which do not match those regular
1336 expressions (e.g.,
<code>refs/pull/
123</code>) is not in any island. Any object
1337 which is reachable only from
<code>refs/pull/
</code> (but not heads or tags) is
1338 therefore not a candidate to be used as a base for
<code>refs/heads/
</code>.
</p></div>
1339 <div class=
"paragraph"><p>Refs are grouped into islands based on their
"names", and two regexes
1340 that produce the same name are considered to be in the same
1341 island. The names are computed from the regexes by concatenating any
1342 capture groups from the regex, with a
<em>-
</em> dash in between. (And if
1343 there are no capture groups, then the name is the empty string, as in
1344 the above example.) This allows you to create arbitrary numbers of
1345 islands. Only up to
14 such capture groups are supported though.
</p></div>
1346 <div class=
"paragraph"><p>For example, imagine you store the refs for each fork in
1347 <code>refs/virtual/ID
</code>, where
<code>ID
</code> is a numeric identifier. You might then
1348 configure:
</p></div>
1349 <div class=
"listingblock">
1350 <div class=
"content">
1352 island = refs/virtual/([
0-
9]+)/heads/
1353 island = refs/virtual/([
0-
9]+)/tags/
1354 island = refs/virtual/([
0-
9]+)/(pull)/
</code></pre>
1356 <div class=
"paragraph"><p>That puts the heads and tags for each fork in their own island (named
1357 "1234" or similar), and the pull refs for each go into their own
1358 "1234-pull".
</p></div>
1359 <div class=
"paragraph"><p>Note that we pick a single island for each regex to go into, using
"last
1360 one wins" ordering (which allows repo-specific config to take precedence
1361 over user-wide config, and so forth).
</p></div>
1365 <h2 id=
"_configuration">CONFIGURATION
</h2>
1366 <div class=
"sectionbody">
1367 <div class=
"paragraph"><p>Various configuration variables affect packing, see
1368 <a href=
"git-config.html">git-config(
1)
</a> (search for
"pack" and
"delta").
</p></div>
1369 <div class=
"paragraph"><p>Notably, delta compression is not used on objects larger than the
1370 <code>core.bigFileThreshold
</code> configuration variable and on files with the
1371 attribute
<code>delta
</code> set to false.
</p></div>
1375 <h2 id=
"_see_also">SEE ALSO
</h2>
1376 <div class=
"sectionbody">
1377 <div class=
"paragraph"><p><a href=
"git-rev-list.html">git-rev-list(
1)
</a>
1378 <a href=
"git-repack.html">git-repack(
1)
</a>
1379 <a href=
"git-prune-packed.html">git-prune-packed(
1)
</a></p></div>
1383 <h2 id=
"_git">GIT
</h2>
1384 <div class=
"sectionbody">
1385 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1389 <div id=
"footnotes"><hr /></div>
1391 <div id=
"footer-text">
1393 2022-
06-
03 15:
24:
31 PDT