Messages in this thread | | | From | Linus Torvalds <> | Date | Mon, 10 Dec 2012 11:30:55 -0800 | Subject | Re: Missing tags in my local stable git repo |
| |
On Mon, Dec 10, 2012 at 11:15 AM, Steven Rostedt <rostedt@goodmis.org> wrote: > > That's a scary thought... git gc will just prune stuff you haven't used > in a while? I hope that's not the case.
git gc should only prune stuff that is no longer *reachable*.
If the alternate tree is entirely stable, that should be perfectly fine.
HOWEVER.
Any tree that is an alternate and ever has *any* objects in it that can become unreachable is a really really really bad idea.
Note that the "any objects" can be because it has fetched temporary branches (even if they were never merged). So you may think that you didn't do anything unstable, but even just using that tree to fetch something to look at - and then not using the end result - is a major mistake in an alternates tree.
Also, you should never *ever* make an alternate object store be *another* alternate object store, and I think that may be the problem in your case. Iirc git doesn't follow alternates recursively. So what can happen is that you got objects in the "middle" alternate, that then get pruned away by "git gc" (because they exist in the origin repository), but they got pruned away from the furthest alternate in the meantime, and now the objects are "two hops" away, and will not ever be seen.
Moral of the story: be *very* careful when using alternates. Only ever point the alternate file at a *real* repository (not another one with alternates), and only one that never has references removed.
Linus
| |