Re: Keeping reflogs on branch deletion

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

 



On Thu, Feb 14, 2008 at 10:00:58AM -0500, Nicolas Pitre wrote:

> > 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.

How is that any different than accumulating old entries in reflog files
for branches that _do_ exist? In both cases, they should be dealt with
via time-based pruning.

> 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.

By that rationale, why do we bother keeping any reflog besides HEAD in
the first place? I can think of two reasons:

  1. it's much more convenient to type branch@{1} than to sift through
     HEAD's reflog looking for checkout events and guessing which branch
     we were on
  2. it's possible to change a ref without it being on the HEAD, in
     which case the HEAD reflog doesn't contain the change.

In other words, I don't see "oops, I deleted this branch and its history
is valuable to me" as significantly less likely than "oops, I got rid of
this commit and its history is valuable to me."

-Peff
-
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

[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]

  Powered by Linux