On Thu, 14 Feb 2008, Brian Downing wrote: > On Wed, Feb 13, 2008 at 07:43:21PM -0800, Junio C Hamano wrote: > > People often mistake that the safety of "branch -d" is to not > > lose the commit (i.e. not making it unreachable), but that is > > not the case. That safety already exists in HEAD reflogs. > > > > The "branch -d" safety is about not losing the particular point. > > The information we really are trying to protect is "this branch > > points at _that commit_", which is just as important if not > > more. > > This actually brings up something I've been intending to ask. > > When deleting a branch, is there any reason we can't add a deletion > entry into the reflog and keep the reflog around? This would seem to be > a lot safer; I know I've been burned by expecting the reflog safety net > to be there, and surprised that it's not when I've deleted a branch. No. That would only accumulate dead reflog files in the repository. And as Junio said above, the "HEAD" reflog contains everything you moved to, including detached heads, and of course branch heads that might now be deleted. You can easily retrieve a deleted branch head from there. For example, in my 'git log -g HEAD' output, I have: |commit 40aab8119f38c622f58d8e612e7a632eb1f3ded2 |Reflog: HEAD@{2} (Nicolas Pitre <nico@xxxxxxx>) |Reflog message: checkout: moving from next to master If I accidentally deleted my 'next' branch, I can retrieve it with HEAD@{3} which is the position HEAD was pointing to before moving away from 'next'. So, doing 'git branch next HEAD@{3}' would restore it. 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