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

Re: [PATCH] refs: support migration with worktrees

From
Ben Knoble <ben.knoble@gmail.com>
Date
Oct 29, 2025, 16:22 UTC
Message-ID
<598941EF-43F6-4642-B665-C0D65C5CDABB@gmail.com>
In-Reply-To
<85d6fdcc-cee3-448a-8bda-72791f342be3@app.fastmail.com>
Show 5 quoted lines
> Le 29 oct. 2025 à 07:37, Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> a écrit :
> 
> On Wed, Oct 29, 2025, at 11:10, Patrick Steinhardt wrote:
>>> On Tue, Oct 28, 2025 at 09:00:43AM -0700, Junio C Hamano wrote:
>>> Patrick Steinhardt <ps@pks.im> writes:
[snip]
Show 19 quoted lines
>>> * If "you must do so from the primary worktree and we convert all
>>>   the worktrees attached to the same repository" is the only mode
>>>   of operation we support (which by the way I have no problem
>>>   with---the first bullet point above was asking question, not
>>>   suggesting change of design), then would it be easier for the
>>>   user to use if the command noticed that it is not in the primary
>>>   worktree and switched to it for the user, instead of complaining
>>>   and failing?
>> 
>> I'm not sure. The question is whether the user recognizes that migrating
>> references in the worktree would also migrate references in the main
>> repository. It might be surprising behaviour if we did that without
>> asking.
> 
> On the contrary, as a user I think it mattering what worktree I run this
> command from sounds very weird.  (But again I can tolerate it requiring
> me to run it from the main worktree if there are technical difficulties/
> limitations.  But using different backends for different
> worktrees is very weird, again.)
[snip]
The fewer concepts we ask a user to manage at a time, likely the better. In this case, “migrate the refs” should probably just work. While things are experimental, rough edges are more tolerable of course, but as we are lifting limitations towards making things official I think polishing such edges is a good idea.
In sum, it can be done later, but I think automatically changing the process directory to the main worktree and carrying on is fine. The curious folks would even see that under the TRACE output ;)
Previous: Kristoffer HaugsbakkNext: Patrick Steinhardt
Message 6 of 8 in “refs: support migration with worktrees”
  1. refs: support migration with worktreesSam Bostock via GitGitGadget, Oct 27, 2025
  2. Patrick SteinhardtOct 28, 2025
  3. Junio C HamanoOct 28, 2025
  4. Patrick SteinhardtOct 29, 2025
  5. Kristoffer HaugsbakkOct 29, 2025
  6. Ben KnobleOct 29, 2025
  7. Patrick SteinhardtOct 30, 2025
  8. Junio C HamanoOct 29, 2025

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.