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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Shawn O. Pearce <spearce@...>
Cc: <git@...>
Date: Wednesday, June 6, 2007 - 2:50 pm

Shawn O. Pearce wrote:

ok. I just want to make sure this is not really about prune'ing.

In the following, source and --shared repos are identical except...
1) Source repo contains loose objects which are new commits.
    --shared repo does git-pull.
    we fast-forward, copying very little.
    success.
2) Source repo contains loose objects which are new commits.
    Source repo does git-gc, which repacks but doesn't prune.
    --shared repo does git-pull.
    success?
3) Source repo deletes a branch that --shared repo also has.
    This deletion creates dangling unreferenced objects.
** --shared repo still ok here, right?
    Source repo does git-gc, which repacks but doesn't prune.
** Is --shared screwed at this point? (This is what I understand
      you to say above) Or do the dangling objects still exist,
      so --shared is still ok?
    git gc --prune
    --shared is fubar, at least on the deleted branch.


The docs (git-repack.txt) seem to suggest that git-repack (without -d) 
does not delete any objects. And if -d is used, then at most objects 
already referenced in other packs will be deleted. This makes me think 
that repack is safe on the source repository.

If the above is wrong, then I'm missing a clue about git-rebase. And 
don't feel like you have to explain it to me. Do feel free to give a 
short *NO!! REPACK IS DANGEROUS ON SHARED REPOS YOU IDIOT!!* or other 
such beating. But if you see what I'm misunderstanding please let me know.

If the above is right, then it seems like the source repo developer 
should be able to go about his developing, and git-gc'ing without
regard for other developers who may be --share'ing. And only when the
source developer wants to do a prune of dangling objects must something 
special be done. git-prune.txt suggests:

     git prune $(cd ../another && $(git-rev-parse --all))


Ahh, now that's interesting.

Could I create something like that by doing something like this:

(in a cloned repository with only a master branch)
git reset --hard HEAD^     # I know, HEAD is still in the history
git gc --prune             # log so it doesn't get pruned, but
                            # it's just an example

(now back in my devel repo)
<add archive repo to alternates>
git prune-packed

Now most everything is likely referenced in the archive repo except the 
last commit. Well, maybe even the HEAD commit due to the history log.

Depending on how you reply above, a periodic pull into the archive repo 
(and a repack?), then a 'git prune-packed' from the sharers could allow 
good sharing? <waiting for a "NO, YOU IDIOT!"> If not, then I guess the 
archive creation steps could be repeated periodically.

-brandon

-
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)