efficient cloning
- From
James Cloos <cloos@jhcloos.com>
- Date
- Mar 19, 2006, 21:16 UTC
- Message-ID
- <m3r74ykue7.fsf@lugabout.cloos.reno.nv.us>
Is there a way to accomplish the effect of this script w/o having to download any unnecessary objects?
================================================== #!/bin/bash
lt="/gits/linux-2.6/.git"
if [ $# -ne 2 ]; then
echo >&2 "Usage: $0 <repo> <target-dir>"
exit 1
figit-clone $1 $2
mkdir -p $2/objects/info
{
test -f "$lt/objects/info/alternates" &&
cat "$lt/objects/info/alternates";
echo "$lt/objects"
} >"$2/objects/info/alternates"cd $2 git-repack -a -d -s git-prune-packed ==================================================
I tried to modify git-clone to add an alternates file before calling fetch, but that file just gets deleted.
I presume I need to clone -s -l the local alternate, re-parent it to the new URL and grab anything missing, but how can I assure that it results in exactly the same repo as this script?
I'm often behind tiny straws, so efficiency is important.
-JimC
-- James H. Cloos, Jr. <cloos@jhcloos.com>