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