Re: Question about 'branch -d' safety

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 12, 2010 at 04:50:32PM -0700, Junio C Hamano wrote:
> 
> 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

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]