On Thu, 11 Sep 2008, Stephen R. van den Berg wrote: > Theodore Tso wrote: > >On Thu, Sep 11, 2008 at 05:32:02PM +0200, Stephen R. van den Berg wrote: > >> gc will preserve the commits the origin links point to once they are > >> reachable. I.e. if the developer doesn't care about the commits the > >> origin links point to (i.e. if the branches are not reachable) then gc > >> just skips them, if the developer *does* care, the origin links are used > >> to keep those objects alive (and, of course, all their parenthood). > > >This seems wrong. OK, suppose you have branches A, B, C, and D, while > >you are on branch C, you cherry pick commit 'p' from branch B, so that > >there is a new commit q on branch C which has an origin link > >containing the commit ID's p^ and 'p. > > Ok. > > >Now suppose branch B gets deleted, and you do a "git gc". All of the > >commits that were part of branch B will vanish except for p^ and p, > > Not quite. Obviously all parents of p and p^ will continue to exist. > I.e. deleting branch B will cause all commits from p till the tip of B > (except p itself) to vanish. Keeping p implies that the whole chain of > parents below p will continue to exist and be reachable. That's the way > a git repository works. And that's what I called stupid in my earlier reply to you. Either you have proper branches or tags keeping P around, or deleting B brings everything not reachable through other branches or tags (or reflog) away too. Otherwise there is no point making a dangling origin link valid. Nicolas -- 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