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

Re: [PATCH 4/7] sequencer: introduce functions to handle autostashes via refs

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 22, 2024, 10:51 UTC
Message-ID
<Za5IoEjs0q7cf354@tanuki>
In-Reply-To
<xmqqbk9hjdai.fsf@gitster.g>
On Fri, Jan 19, 2024 at 12:09:25PM -0800, Junio C Hamano wrote:
Show 14 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > We're about to convert the MERGE_AUTOSTASH ref to become non-special,
> > using the refs API instead of direct filesystem access to both read and
> > write the ref. The current interfaces to write autostashes is entirely
> > path-based though, so we need to extend them to also support writes via
> > the refs API instead.
> >
> > Ideally, we would be able to fully replace the old set of path-based
> > interfaces. But the sequencer will continue to write state into
> > "rebase-merge/autostash". This path is not considered to be a ref at all
> > and will thus stay is-is for now, which requires us to keep both path-
> 
> "is-is"???
Oops, "as-is" :)
Show 11 quoted lines
> > and refs-based interfaces to handle autostashes.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> >  sequencer.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++----
> >  sequencer.h |  3 +++
> >  2 files changed, 64 insertions(+), 5 deletions(-)
> 
> The conversion (rather, the introduction to allow refs API to be
> used to access them) look correct, but offhand I do not know what
> the implication of leaving the file based interface would be.

We have said in past discussions that the sequencer state should remain self contained, and that requires us to keep the files-based interface. Refactoring it would likely be a larger undertaking, as we have also said that refs must either have pseudo-ref syntax or start with "refs/".

The sequencer with its "rebase-merge/autostash" files doesn't conform to either of those requirements, so we would also have to rename those reflike files. I doubt that this is really worth it, so I would keep those around as internal implementation details of how the sequencer works. These refs are not supposed to be accessed by the user in the first place, and we do not document their existence to the best of my knowledge. Also, `git rev-parse rebase-merge/autostash` would fail.

So overall I think it's fine to leave this internal sequencer state as self-contained as it is.

Patrick
Previous: Junio C HamanoNext: Phillip Wood
Message 15 of 23 in “refs: convert special refs to become normal pseudo-refs”
  1. 0/7 refs: convert special refs to become normal pseudo-refsPatrick Steinhardt, Jan 19, 2024
  2. 1/7 sequencer: clean up pseudo refs with REF_NO_DEREFPatrick Steinhardt, Jan 19, 2024
  3. Junio C HamanoJan 19, 2024
  4. Patrick SteinhardtJan 22, 2024
  5. Karthik NayakJan 22, 2024
  6. Patrick SteinhardtJan 22, 2024
  7. 2/7 sequencer: delete REBASE_HEAD in correct repo when picking commitsPatrick Steinhardt, Jan 19, 2024
  8. 3/7 refs: convert AUTO_MERGE to become a normal pseudo-refPatrick Steinhardt, Jan 19, 2024
  9. Junio C HamanoJan 19, 2024
  10. Patrick SteinhardtJan 22, 2024
  11. Elijah NewrenJan 24, 2024
  12. Karthik NayakJan 22, 2024
  13. 4/7 sequencer: introduce functions to handle autostashes via refsPatrick Steinhardt, Jan 19, 2024
  14. Junio C HamanoJan 19, 2024
  15. Patrick SteinhardtJan 22, 2024
  16. Phillip WoodJan 22, 2024
  17. Junio C HamanoJan 22, 2024
  18. 5/7 refs: convert MERGE_AUTOSTASH to become a normal pseudo-refPatrick Steinhardt, Jan 19, 2024
  19. 6/7 refs: redefine special refsPatrick Steinhardt, Jan 19, 2024
  20. Junio C HamanoJan 19, 2024
  21. 7/7 Documentation: add "special refs" to the glossaryPatrick Steinhardt, Jan 19, 2024
  22. Phillip WoodJan 23, 2024
  23. Patrick SteinhardtJan 24, 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.