Re: [PATCH] logging branch deletion to help recovering from mistakes
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Dec 7, 2010, 16:22 UTC
- Message-ID
- <m3fwu9365i.fsf@localhost.localdomain>
- In-Reply-To
- <AANLkTinDyix3KEdLLGJEWQ8X+a3zQZOAiTh2mLf5wuvQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 27 quoted lines
> On Tue, Dec 7, 2010 at 1:28 PM, Junio C Hamano <gitster@pobox.com> wrote: >> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes: >> >>> On Tue, Dec 7, 2010 at 4:16 AM, Junio C Hamano <gitster@pobox.com> wrote: >>>> +#define BRANCH_DELETION_LOG "DELETED-REFS" >>>> + >>> >>> Should this special log be mentioned in git-update-ref.txt or >>> gitrepository-layout.txt? >> >> Perhaps, but I wasn't sure if this patch itself is a good idea to begin >> with. Not the problem it tries to solve, but its approach. >> >> For example, this cannot be shown with "reflog show" or "log -g" due to >> the way these frontends locate the reflog file to read (the logic wants to >> have an underlying ref). >> > > I think you have thought of this. What's wrong with keeping reflog > when a branch is removed and appending "delete" line to the said > reflog? I don't know how reflogs are managed, but those reflogs > without associated branch will (or should) be cleaned when they are > expired. > > I stick with this idea because I also want to archive old branches and > am thinking those reflogs ending with "archive" line will be kept > forever, or until I feel like digging up them again.
The problem with this idea is deleting branch 'foo' and creating 'foo/bar', or deleting branch 'foo/bar' and creating branch 'foo'. Old reflog with "delete" line would block creating reflog for new branch.
-- Jakub Narebski Poland ShadeHawk on #git