Re: Question about 'branch -d' safety
- From
Clemens Buchacher <drizzd@aon.at>
- Date
- Jul 13, 2010, 07:13 UTC
- Message-ID
- <20100713071317.GA26348@localhost>
- In-Reply-To
- <7v39vo8dkn.fsf@alter.siamese.dyndns.org>
On Mon, Jul 12, 2010 at 04:50:32PM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> > I am not entirely unsympathetic to add "git branch --undelete frotz" to our > vocabulary, but then we should leave users an easy way to really remove > things, and it shouldn't be "git branch -d --i-really-mean-it frotz". > > It would probably be more like "git branch -d frotz" followed by "git > branch --purge frotz" or "git branch --purge \*" (if we name the operation > to remove cruft for undelete "purge", that is).
Why would we need that? Even now, it is not enough to do "git branch -D frotz; git gc --prune". You need to expire the reflog, since HEAD may still have a reference to it. So instead you would need
git branch -D frotz git reflog expire --expire=now HEAD frotz git gc --prune
Purging a branch becomes just a special case of purging anything from history.
Clemens