Keeping reflogs on branch deletion

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: David Symonds <dsymonds@...>, Bill Lear <rael@...>, Jay Soffian <jaysoffian@...>, Git Mailing List <git@...>
Date: Thursday, February 14, 2008 - 10:01 am

On Wed, Feb 13, 2008 at 07:43:21PM -0800, Junio C Hamano wrote:

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.

I expect that the reflog entry would look something like this:

0000000000000000000000000000000000000000 4685dfedd47683a476e75166b5c273c0269b7e54 Brian Downing <bdowning@lavos.net> 1202996833 -0600   branch: Created from ubuntu-dapper
4685dfedd47683a476e75166b5c273c0269b7e54 0000000000000000000000000000000000000000 Brian Downing <bdowning@lavos.net> 1202996863 -0600   branch: Deleted

A couple of problems I've noticed that would have to be fixed for this
to work:

* git log -g (and anything else that can take a reflog) would have to be
  fixed or modified to allow for taking branches that no longer exist:

  :; ls .git/logs/refs/heads/foo
  .git/logs/refs/heads/foo
  :; git log -g foo
  fatal: ambiguous argument 'foo': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions

  My uneducated suspicion is that this may be somewhat hard.

* If the above did work, it would be nice for the deletion entry to
  result in a nice "branch was deleted" entry in log -g output.  Today,
  that entry is missing in its entirety.

-bcd
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
A couple branch questions, Jay Soffian, (Wed Feb 13, 9:39 pm)
Re: A couple branch questions, David Symonds, (Wed Feb 13, 9:45 pm)
Re: A couple branch questions, Bill Lear, (Wed Feb 13, 10:24 pm)
Re: A couple branch questions, David Symonds, (Wed Feb 13, 11:03 pm)
Re: A couple branch questions, Junio C Hamano, (Wed Feb 13, 11:43 pm)
Keeping reflogs on branch deletion, Brian Downing, (Thu Feb 14, 10:01 am)
Re: Keeping reflogs on branch deletion, Jakub Narebski, (Thu Feb 14, 12:35 pm)
Re: Keeping reflogs on branch deletion, Nicolas Pitre, (Thu Feb 14, 11:00 am)
Re: Keeping reflogs on branch deletion, Jeff King, (Thu Feb 14, 11:17 am)
Re: Keeping reflogs on branch deletion, Nicolas Pitre, (Thu Feb 14, 12:16 pm)
Re: Keeping reflogs on branch deletion, Jeff King, (Thu Feb 14, 12:31 pm)
Re: Keeping reflogs on branch deletion, Nicolas Pitre, (Thu Feb 14, 1:32 pm)
Re: Keeping reflogs on branch deletion, Jeff King, (Thu Feb 14, 1:57 pm)
Re: Keeping reflogs on branch deletion, Wincent Colaiuta, (Thu Feb 14, 4:17 pm)
Re: Keeping reflogs on branch deletion, Johannes Schindelin, (Thu Feb 14, 11:08 am)