Re: clarify git clone --local --shared --reference

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Brandon Casey <casey@...>
Cc: <git@...>
Date: Friday, June 8, 2007 - 1:37 am

Brandon Casey <casey@nrlssc.navy.mil> wrote:

Copying nothing actually.  All of the objects required are in the
source repository, so --shared needs nothing additional.


Yes, same as above.  Except: If --shared has a branch that points
at a commit that used to be in source (hence its data isn't in
--shared) and that data used to be packed, but source no longer
has a reference to it.  When you repack source we won't include
that commit in the new pack, but we will delete the old pack.
That means the commit goes away.


Yes... see above about the repack problem.


Broken.  The repack didn't include the dangling objects.


--shared is fubar, on the deleted branch.


also fubar, on the deleted branch.


You are correct that leaving off the '-d' won't delete objects.
But a pack is created by listing the objects we need, and if we don't
need the object in source, we don't include it into the new pack.

-a -d implies delete all packs that existed when we started the
repack.  So if an object was in the old packfile, and we didn't
copy it to the new packfile, it gets deleted.  ;-)

Packfiles are immutable.  We cannot delete something from it without
deleting the entire packfile.
 

;-)

NO!! REPACK IS DANGEROUS ON SHARED REPOS YOU IDIOT!!

Exactly because of what I'm saying above, and what you mention about
source deleting a branch and repacking or pruning, and --shared
then being corrupt because its now missing at least one object it
wants to have.
 

Right; but the thing that is shocking to some people (me in my
early days with Git) is that a repack is *also* doing a prune if
you add -d.  Its not quite the same type of prune as it prunes only
previously packed objects, but its still a prune.
 

Actually you want `git gc` in your --shared repo now.  That way it
minimizes the current packfiles.  prune-packed only applies to loose
objects; not already packed stuff.  Since you added a repo with a
large packfile to your alternates list you probably want to shrink
your own packfile down as much as possible.  That works because
`git gc` is actually running `git repack -a -d -l`.  The -l means
"only things that are local to this --shared repository.
 

Right.
 

Yes, exactly.  The trick here is that once something enters the
shared repo IT MUST STAY THERE.  You cannot allow a branch to be
deleted from the shared repo, unless it is fully merged into another
branch (or tag) that is staying.  You also cannot rewind a branch
(e.g. push with --force).

But I do exactly what you are suggesting.  I pull every so often
into a the shared common repo and repack it.  And then everyone
else can repack and their repack deletes things that are in the
shared common repo.

Just make sure you have a good backup of the shared common repo.  :)

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
clarify git clone --local --shared --reference, Brandon Casey, (Mon Jun 4, 7:53 pm)
Re: clarify git clone --local --shared --reference, Shawn O. Pearce, (Tue Jun 5, 12:50 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Tue Jun 5, 12:30 pm)
Re: clarify git clone --local --shared --reference, Shawn O. Pearce, (Wed Jun 6, 1:11 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Wed Jun 6, 2:50 pm)
Re: clarify git clone --local --shared --reference, Shawn O. Pearce, (Fri Jun 8, 1:37 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Wed Jun 13, 7:07 pm)
RE: clarify git clone --local --shared --reference, Loeliger Jon-LOELIGER, (Fri Jun 8, 11:57 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Fri Jun 8, 2:35 pm)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Wed Jun 6, 2:55 pm)