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

RE: Annoying absolute path for "core.worktree" to submodule

From
HLHolding, Lawrence <lawrence.holding@cubic.com>
Date
Mar 20, 2012, 21:39 UTC
Message-ID
<A5E8E180685CEF45AB9E737A010799802D9872@cdnz-ex1.corp.cubic.cub>
In-Reply-To
<4F6886A6.3010805@gmail.com>
Show 8 quoted lines
> Antony Male wrote:
> On 20/03/2012 9:52 am, Christian Hammerl wrote:
> > 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
Show 9 quoted lines
> > for "core.worktree".
> 
> What are you referring to as the "last update"? v1.7.8 introduced the
> separate git dir for submodules, and used an absolute path.
> 
> This absolute path was changed to a relative path in the patchset at
> [1], which is present in v1.7.10-rc1.
> 
> [1]: http://thread.gmane.org/gmane.comp.version-control.git/192173

Slightly off topic, but related, what is the recommended way for finding the git folder from the top level project or any of the submodules? And of finding the working tree from inside a hook script?

Context: One of the (optional) steps in our build process installs
pre-commit hooks into the git/hooks folder of the tools submodule and
into the git/hooks folder of the next level up project. Then on commit
the hook reads the config file from inside the tools submodule and
checks file formats and naming standards before permitting the commit.
The current implementation has the paths hard coded between the two
location, now with some having the old layout and some the new, we are
looking for a consistent solution without duplicating the logic in the
git executables.
Previous: Antony MaleNext: Jens Lehmann
Message 3 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.