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

[PATCH v3 0/4] submodules: Use relative paths to gitdir and work tree

From
Jens Lehmann <jens.lehmann@web.de>
Date
Mar 4, 2012, 21:11 UTC
Message-ID
<4F53DA95.2020402@web.de>

This is the third round of the former two patch series. It applies cleanly on current master and maint and IMO is maint stuff as it fixes bugs related to submodules. Those were introduced when moving the git directory into that of the superproject and using a gitfile instead.

The first patch is unchanged from version one, in the second I did address the concerns raised about the while loop. Those two patches make superprojects movable again.

The third patch started as a mere refactoring, but while working on it I noticed it also fixes an issue when submodules are moved around inside a superproject.

The forth patch is provided by Johannes Sixt and addresses the issue that under windows both POSIX and Windows style paths may occur which sometimes broke the computation of relative paths.

Now all issues I'm aware of are fixed and tested for. In the next step
I'll be looking into teaching git mv to handle submodules, as just
mv'ing them someplace else, upating .gitmodules and adding the paths
isn't sufficient anymore. The core.worktree setting - and sometimes the
gitfile too (when the submodule is moved to a different directory level)
- have to be updated too to make that work (That would be easier if git
could treat the directory a gitfile was found in as a candidate for the
work tree, as then we could get rid of the core.worktree setting, but
we don't have that functionality).
Jens Lehmann (4):
  submodules: always use a relative path to gitdir
  submodules: always use a relative path from gitdir to work tree
  submodules: refactor computation of relative gitdir path
  submodules: fix ambiguous absolute paths under Windows
 git-submodule.sh            |   58 +++++++++++++++++++++----------------------
 t/t7400-submodule-basic.sh  |   22 ++++++++++++++++
 t/t7406-submodule-update.sh |   17 +++++++++++++
 3 files changed, 68 insertions(+), 29 deletions(-)
-- 
1.7.9.2.362.g684a8
Next: Jens Lehmann
Message 1 of 7 in “submodules: Use relative paths to gitdir and work tree”
  1. 0/4 submodules: Use relative paths to gitdir and work treeJens Lehmann, Mar 4, 2012
  2. 1/4 submodules: always use a relative path to gitdirJens Lehmann, Mar 4, 2012
  3. 2/4 submodules: always use a relative path from gitdir to work treeJens Lehmann, Mar 4, 2012
  4. 3/4 submodules: refactor computation of relative gitdir pathJens Lehmann, Mar 4, 2012
  5. 4/4 submodules: fix ambiguous absolute paths under WindowsJens Lehmann, Mar 4, 2012
  6. Junio C HamanoMar 7, 2012
  7. Johannes SixtMar 7, 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.