Re: Question about 'branch -d' safety
- From
Will Palmer <wmpalmer@gmail.com>
- Date
- Jul 13, 2010, 09:00 UTC
- Message-ID
- <1279011633.2030.17.camel@wpalmer.simply-domain>
- In-Reply-To
- <4C3C2435.8010500@viscovery.net>
On Tue, 2010-07-13 at 10:30 +0200, Johannes Sixt wrote:
Show 6 quoted lines
> With that in mind, shouldn't it be exactly the other way around, i.e., > dump the reflog (the objects are still referenced from HEAD's reflog), but > keep the ref around in some attic, just in case the branch is so old that > its reflog was empty and its objects would otherwise be pruned right away? > > -- Hannes
It would probably be more sensible to add a "deleted" entry to the reflog just prior to removing the ref (yes, this will make HEAD@{1} equal to HEAD@{0} in many cases). Keeping the ref itself around in an attic doesn't make sense - the reflog can act as a better "attic" anyway, if we stop deleting nonempty reflogs just because they don't have a live ref associated with them.
Having a separate "attic" just runs into problems of "what if you delete the ref twice?" and adds an entirely separate mechanism for tracking something which we already have a perfectly good method of tracking: the previous state of a ref.