Re: Removing redundant packs

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

 



On Sat, Dec 08, 2007 at 01:37:44PM -0800, Junio C Hamano wrote:

>  (1) In each repository, run "repack -a -d".  That would ensure that
>      everybody has the necessary objects that they themselves need.  By
>      doing this for a repository that borrows from another makes sure
>      pruning the latter would not break the former, so you start from
>      leaves and move on to the repositories they borrow from.

I'm not sure this works. Try this:

# make parent repo with two commits, fully packed
mkdir parent && cd parent && git init &&
echo content >file && git add file && git commit -m added &&
echo more >>file && git commit -m more -a &&
git repack -a -d

# clone child repo with alternates
git clone -s . ../child

# and now forget about the second commit in the parent
git reset --hard HEAD^
rm -rf .git/logs

# at this point the "parent" repo doesn't know anything about the second
# commit, but contains the objects; the child repo does know about it,
# but relies on the pack in the parent for the objects

# so your advice is to "repack -a -d" first in the child, then in the
# parent.
# child first; output will be: "Nothing new to pack."
cd ../child && git repack -a -d
# and then parent, which will lose the objects for the second commit
cd ../parent && git repack -a -d

# and confirm that child is broken
# output is: "fatal: bad object HEAD"
cd ../child && PAGER=cat git show

You seem to think that repacking without "-l" will pull objects from
alternates, but it doesn't (I have also seen "repack -a -d" recommended
for "how do I break alternates dependencies", but it obviously also
doesn't work for that).

-Peff
-
To unsubscribe from this list: 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]

  Powered by Linux