git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: can we prevent reflog deletion when branch is deleted?

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Jun 1, 2013, 17:25 UTC
Message-ID
<CAMK1S_hPups3SCwxhHRYWBJzpPreNVUfNdx1+_Hjy2_d0MMpaA@mail.gmail.com>
In-Reply-To
<CALkWK0mwAc0bFon7B7nw1Nbvcwdf8m2_531qtrN-r28r9F+70Q@mail.gmail.com>
On Sat, Jun 1, 2013 at 3:17 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 22 quoted lines
> Jeff King wrote:
>> Why don't the branch names have significance? If I deleted branch "foo"
>> yesterday evening, wouldn't I want to be able to say "show me foo from
>> 2pm yesterday" or even "show me all logs for foo, so that I can pick the
>> useful bit from the list"?
>
> Oh, I misunderstood then.  I didn't realize that your usecase was actually
>
>     git log foo@{yesterday}
>
> where foo is a deleted branch.  Just to give some perspective, so we
> don't limit our problem space:
>
> I only ever batch-delete "cold" branches: if I haven't touched a
> branch in ~2 months, I consider the work abandoned (due to disinterest
> or otherwise) and remove it.  Most of my branches are short-lived, and
> I don't remember branch names, much less of the names of the cold
> branches I deleted.  My usecase for a graveyeard is "I lost something,
> and I need to find it": I don't want to have to remember the original
> branch name "foo"; if you can tell everything I deleted yesterday, I
> can spot foo and the commit I was looking for.  The HEAD reflog is
> almost good enough for me.

I think I'd have to be playing with *several* branches simultaneously before I got to the point of forgetting the branch name!

More to the point, your use case may be relevant for a non-bare repo where "work" is being done, but for a bare repo on a server, I think the branch name *does* have significance, because it's what people are collaborating on.

(Imagine someone accidentally nukes a branch, and then someone else tries to "git pull" and finds it gone. Any recovery at that point must necessarily use the branch name).

PS: I am assuming core.logAllRefUpdates is on
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 7 of 21 in “can we prevent reflog deletion when branch is deleted?”
  1. Sitaram ChamartyJun 1, 2013
  2. Michael HaggertyJun 1, 2013
  3. Jeff KingJun 1, 2013
  4. Ramkumar RamachandraJun 1, 2013
  5. Jeff KingJun 1, 2013
  6. Ramkumar RamachandraJun 1, 2013
  7. Sitaram ChamartyJun 1, 2013
  8. Ramkumar RamachandraJun 1, 2013
  9. Sitaram ChamartyJun 2, 2013
  10. Sitaram ChamartyNov 14, 2013
  11. Thomas RastNov 14, 2013
  12. Jeff KingNov 14, 2013
  13. Sitaram ChamartyNov 14, 2013
  14. Jeff KingNov 14, 2013
  15. Luca MilanesioNov 14, 2013
  16. Sitaram ChamartyNov 14, 2013
  17. Sitaram ChamartyNov 14, 2013
  18. Jeff KingNov 14, 2013
  19. Stephen BashNov 14, 2013
  20. Sitaram ChamartyNov 14, 2013
  21. Sitaram ChamartyNov 14, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.