Re: [PATCH] prune: mark rebase autostash and orig-head as reachable
- From
Phil Hord <phil.hord@gmail.com>
- Date
- May 14, 2024, 19:37 UTC
- Message-ID
- <CABURp0oNyOcrDySmMtbnGrFLuWWUybeo7-osS4NqPNBD3wKdaA@mail.gmail.com>
- In-Reply-To
- <xmqqmssan841.fsf@gitster.g>
On Thu, Feb 8, 2024 at 10:08 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> > "Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > Rebase records the oid of HEAD before rebasing and the commit created by > > "--autostash" in files in the rebase state directory. This means that
...
Show 6 quoted lines
> I do not like this kind of special casing in general, but because > these are our tools' droppings, I am OK to grandfather them in, as > long as we promise ourselves that we will not add more of these > ad-hoc "text files" that record object names, loss of which affects > correctness. They should, like "git bisect", be using proper > references to protect these objects instead, of course.
I have long wanted to have a special ref named "AUTOSTASH" since it supports my workflow of applying workdir changes to previous commits during a rebase. For example, I often do this:
$ git rebase -i
Created autostash: c0ffeebea0
...
<stopped to edit some commit in my history>
$ git stash apply c0ffeebea0
$ git commit --amend && git rebase --continueBut it requires me to find the text output after "Created autostash:"
from the original rebase command which may have scrolled a lot by now.
It would be easier to say:
$ git stash apply AUTOSTASHI see that MERGE_AUTOSTASH has been added lately. And I am inferring that there's a desire to remove (eventually) these file-based info trackers such as "rebase-apply/autostash". Is there any reason not to raise the rebase/autostash notation to a proper ref now? Should it be named REBASE_AUTOSTASH if I add this?
Even if we don't remove the file-based notation immediately "rebase-apply/autostash", I would like to add a ref that duplicates the information for my workflow. Maybe we can deprecate the file itself and remove it in some future version.