efficient cloning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
fi

git-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@xxxxxxxxxxx>
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]