summaryrefslogtreecommitdiff
path: root/Documentation/git-index-pack.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-03-03 12:51:54 -0800
committerJunio C Hamano <gitster@pobox.com>2016-03-03 14:28:09 -0800
commit81a04b016d2bb929e94c3b1af6df1309c373208f (patch)
treed07d35cb0ede3b7fd3404f67ee2a89088dcb462a /Documentation/git-index-pack.txt
parent505c99fdd4ba69195fcce0fc8822522cc8af0c72 (diff)
downloadgit-jc/bundle.tar.gz
index-pack: --clone-bundle optionjc/bundle
Teach a new option "--clone-bundle" to "git index-pack" to create a split bundle file that uses an existing packfile as its data part. The expected "typical" preparation for helping initial clone would start by preparing a packfile that contains most of the history and add another packfile that contains the remainder (e.g. the objects that are only reachable from reflog entries). The first pack can then be used as the data part of a split bundle and these two files can be served as static files to bootstrap the clients without incurring any more CPU cycles to the server side. Among the objects in the packfile, the ones that are not referenced by no other objects are identified and recorded as the "references" in the resulting bundle. As the packfile does not record any ref information, however, the names of the "references" recorded in the bundle need to be synthesized; we arbitrarily choose to record the object whose name is $SHA1 as refs/objects/$SHA1. Note that this name choice does not matter very much in the larger picture. As an initial clone that bootstraps from a clone-bundle is expected to do a rough equivalent of: # create a new repository git init new-repository && git remote add origin $URL && # prime the object store and anchor the history to temporary # references git fetch $bundle 'refs/*:refs/temporary/*' && # fetch the more recent history from the true origin git fetch origin && git checkout -f && # remove the temporary refs git for-each-ref -z --format=%(refname) refs/temporary/ | xargs -0 git update-ref -d the names recorded in the bundle will not really matter to the end result. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-index-pack.txt')
-rw-r--r--Documentation/git-index-pack.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/git-index-pack.txt b/Documentation/git-index-pack.txt
index 7a4e055520..ade28126ab 100644
--- a/Documentation/git-index-pack.txt
+++ b/Documentation/git-index-pack.txt
@@ -9,7 +9,7 @@ git-index-pack - Build pack index file for an existing packed archive
SYNOPSIS
--------
[verse]
-'git index-pack' [-v] [-o <index-file>] <pack-file>
+'git index-pack' [-v] [-o <index-file>] [--clone-bundle] <pack-file>
'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
[<pack-file>]
@@ -35,6 +35,14 @@ OPTIONS
fails if the name of packed archive does not end
with .pack).
+--clone-bundle::
+ Write a split bundle file that uses the <pack-file> as its
+ data. The <pack-file> must not contain any broken links, or
+ the bundle file will not be written. The prerequisite list
+ of the resulting bundle will be empty. The reference list
+ of the resulting bundle points at tips of the history in the
+ <pack-file>.
+
--stdin::
When this flag is provided, the pack is read from stdin
instead and a copy is then written to <pack-file>. If