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

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 --continue
But 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 AUTOSTASH

I 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.

Previous: Phillip WoodNext: Phillip Wood via GitGitGadget
Message 6 of 8 in “prune: mark rebase autostash and orig-head as reachable”
  1. prune: mark rebase autostash and orig-head as reachablePhillip Wood via GitGitGadget, Feb 8, 2024
  2. Eric SunshineFeb 8, 2024
  3. Phillip WoodFeb 9, 2024
  4. Junio C HamanoFeb 8, 2024
  5. Phillip WoodFeb 9, 2024
  6. Phil HordMay 14, 2024
  7. prune: mark rebase autostash and orig-head as reachablePhillip Wood via GitGitGadget, Feb 9, 2024
  8. Junio C HamanoFeb 9, 2024

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.