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

Re: GIT_DIR output from git worktree list

From
Duy Nguyen <pclouds@gmail.com>
Date
Dec 9, 2020, 09:30 UTC
Message-ID
<CACsJy8Dq9Lz1YkkqvR0Fa1PLUBJhNJTmLtnRssi=DDpWAQTWww@mail.gmail.com>
In-Reply-To
<CAPig+cQad_yyVgwQQ-NZyy7SergM-fUMeMAm9RsV4zEqNt9TDg@mail.gmail.com>
On Wed, Dec 9, 2020 at 2:27 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 8 quoted lines
> What I was suggesting was that it might be the case that the only way
> to solve this would be to store the location of the main worktree
> somewhere within <repo> in some file, and then `git worktree list`
> would consult that file to learn the location of the main worktree.
> This is complicated by the fact that that file would have to be
> updated automatically if the main worktree directory is ever moved. It
> also needs to be done in such a way that it is easy for other Git
> implementations to understand and not trip over.

Not that it matters because I don't do Git anymore. But when I was doing this I imagined unify main and secondary worktrees. When you switch from single to multiple worktrees, there is no main worktree anymore. The place that is main worktree still has your files, but it has the same status and treatment as any other worktree. And the repo is tucked away somewhere safe.

-- 
Duy
Previous: Eric SunshineNext: Eric Sunshine
Message 8 of 9 in “GIT_DIR output from git worktree list”
  1. Gabriel NütziSep 29, 2020
  2. Eric SunshineSep 30, 2020
  3. Gabriel NütziSep 30, 2020
  4. Eric SunshineSep 30, 2020
  5. Eric SunshineDec 7, 2020
  6. Ganriel NütziDec 7, 2020
  7. Eric SunshineDec 8, 2020
  8. Duy NguyenDec 9, 2020
  9. Eric SunshineDec 13, 2020

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.