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

Bug: relative core.worktree is resolved from symlink and not its target

From
DHDaniel Hahler <genml+git-2014@thequod.de>
Date
Feb 4, 2014, 10:20 UTC
Message-ID
<52F0BEF7.5020600@thequod.de>
Hi,
when using a submodule "sm", there is a relative worktree in its config:
   .git/modules/sm/config:
   [core]
    worktree = ../../../smworktree
git-new-worktree (from contrib) symlinks this config the new worktree.

From inside the new worktree, git reads the config, but resolves the relative worktree setting based on the symlink's location.

A fix would be to resolve any relative worktree setting based on the symlink target's location (the actual config file), and not from the symlink.

This is with git version 1.8.5.3.
Please consider fixing this.

(I know about various workarounds, e.g. copying and adjusting "config" or manually setting $GIT_WORK_TREE; more relevant discussion would be at http://comments.gmane.org/gmane.comp.version-control.git/196019)

Thanks, Daniel.

-- 
http://daniel.hahler.de/
Next: Duy Nguyen
Message 1 of 4 in “Bug: relative core.worktree is resolved from symlink and not its target”
  1. Daniel HahlerFeb 4, 2014
  2. Duy NguyenFeb 9, 2014
  3. Daniel HahlerFeb 17, 2014
  4. Duy NguyenFeb 17, 2014

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.