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

Annoying absolute path for "core.worktree" to submodule

From
Christian Hammerl <info@christian-hammerl.de>
Date
Mar 20, 2012, 09:52 UTC
Message-ID
<20120320105243.2e8a489b@christian-hammerl.de>
Hey folks,

I really love the work you are doing on GIT but the last update regarding submodules is a bit annoying. Although the path inside the ".git" file is stored relative to the submodule's path, the path in ".git/modules/path-to-submodule/config" is stored as an absolute path for "core.worktree".

I develop (for some projects) within a chroot where I have a different username and therefore the path differs if I am currently inside the chroot or not. If the submodule is initialized inside the chroot, I always get this message when I cd into the project's directory outside of the chroot:

fatal: Could not switch to '/home/chroot-username/parent-path-of-submodule': File or directory not found fatal: 'git status --porcelain' failed in submodule relative-path-to-submodule

This is caused by using `__git_ps1` for my bash-prompt. I don't know exactly where the problem is and what actions (called by __git_ps1) are responsible for this.

Any suggestions how to deal with this?

And no, removing __git_ps1 from my bash-prompt is not the answer, I like this feature very much. ;-)

Thanks in advance Christian

Next: Antony Male
Message 1 of 5 in “Annoying absolute path for "core.worktree" to submodule”
  1. Christian HammerlMar 20, 2012
  2. Antony MaleMar 20, 2012
  3. Holding, LawrenceMar 20, 2012
  4. Jens LehmannMar 21, 2012
  5. Christian HammerlMar 21, 2012

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.