diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-03-03 12:51:54 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-03 14:28:09 -0800 |
commit | 81a04b016d2bb929e94c3b1af6df1309c373208f (patch) | |
tree | d07d35cb0ede3b7fd3404f67ee2a89088dcb462a /builtin/count-objects.c | |
parent | 505c99fdd4ba69195fcce0fc8822522cc8af0c72 (diff) | |
download | git-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 'builtin/count-objects.c')
0 files changed, 0 insertions, 0 deletions