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

Re: [long] worktree setup cases

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 23, 2010, 10:12 UTC
Message-ID
<AANLkTin-W_GF97APs8fHJim0pFbNDGKv6KAnWPDVbiKP@mail.gmail.com>
In-Reply-To
<20101021160134.GA3732@burratino>
On Thu, Oct 21, 2010 at 11:01 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 11 quoted lines
> Nguyen Thai Ngoc Duy wrote:
>> On Thu, Oct 21, 2010 at 10:30 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>
>>> Speaking of which, it is not clear to me that core.worktree should
>>> fall under the forbidden case discussed above.  If it does, what is
>>> the point of making it configurable?
>>
>> I was not the one who introduced core.worktree, so I can't really
>> tell. Maybe less keystrokes?
>
> Yeah, it seems you're totally right. :(

Actually I have my part in this mess too: f5e025a (Documentation: always respect core.worktree if set - 2009-12-29). I probably just updated the document according to the code. It matches what Enrico expects (i.e after .git discovery, worktree defaults is "../", if core.worktree exists, follow it instead). Going back to the first commit that introduced separate worktree, 892c41b (introduce GIT_WORK_TREE to specify the work tree - 2007-06-06), core.worktree is no different than --work-tree.

So what should it behave? Either revert f5e025a and update the code to disregard/warn core.worktree if GIT_DIR/--work-tree is unset, or keep the current behavior, i.e. core.worktree is different from --work-tree/GIT_WORK_TREE.

The cleanup commit, e90fdc3 (Clean up work-tree handling - 2007-08-01), also gives something interesting regarding bare repo: "--work-tree=bla overrides GIT_WORK_TREE, _which overrides core.bare = true_, which overrides core.worktree, which overrides GIT_DIR/.. when GIT_DIR ends in /.git, which overrides the directory in which .git/ was found.". I don't like this overriding chain, which is why I proposed to die() if core.bare is set and worktree is explicitly specified.

-- 
Duy
Previous: Jonathan NiederNext: Enrico Weigelt
Message 8 of 17 in “[long] worktree setup cases”
  1. Nguyen Thai Ngoc DuyOct 20, 2010
  2. Jonathan NiederOct 20, 2010
  3. Jonathan NiederOct 20, 2010
  4. Nguyen Thai Ngoc DuyOct 21, 2010
  5. Jonathan NiederOct 21, 2010
  6. Nguyen Thai Ngoc DuyOct 21, 2010
  7. Jonathan NiederOct 21, 2010
  8. Nguyen Thai Ngoc DuyOct 23, 2010
  9. Enrico WeigeltOct 21, 2010
  10. Nguyen Thai Ngoc DuyOct 22, 2010
  11. Enrico WeigeltOct 22, 2010
  12. .git file (Re: [long] worktree setup cases)Jonathan Nieder, Oct 22, 2010
  13. Nguyen Thai Ngoc DuyOct 22, 2010
  14. Junio C HamanoOct 20, 2010
  15. Nguyen Thai Ngoc DuyOct 21, 2010
  16. Enrico WeigeltOct 21, 2010
  17. Junio C HamanoOct 21, 2010

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.