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

Re: [PATCH] Submodules always use a relative path to gitdir

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2012, 00:11 UTC
Message-ID
<7vlipllmfh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F0629C6.9010908@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
> So in the long run I suspect we might have to change core git anyways
> to make moving submodules easy for the user (surely "git mv" and maybe
> also the setup and gitfile code). Does that make more sense?

If you need to change "git mv" anyway to help moving submodule checkout, then how gitfile points into .git/modules/ hierarchy of the superproject becomes an implementation detail the end users should not have to care about.

What does "if we reached thru a gitfile, then the working tree is where you found that gitfile" really solve? The way you found that gitfile is by traversing the directory hierarchy upwards from a subdirectory of a working tree of a submodule, and you already know where the top of that working tree is, no?

And the heuristics would not work if somebody goes into the $GIT_DIR/ that governs the submodule as going upwards from there will not hit gitfile, so we would need help from core.worktree anyway. A non-submodule setting that uses gitfile would need to worry about core.worktree, too, so I'd rather avoid loading more heuristics to gitfile handling unless there is a clear advantage for doing so, which I am not really seeing here.

That is not really a "If not" below (i.e. I am not saying it is _not_ OK. I am saying I don't know what the advantage of that approach is), but ...

> If not I'm fine with just setting core.worktree to a relative path in
> the git-submodule.sh script (like I did for the gitfile). And I'll look
> into teaching "git mv" about submodules right after that.

... teaching "git mv" may be a good move, I would think. I do think keeping core.worktree pointing at the right directory is necessary, but I do not see much point in making it a relative path, though.

Previous: Jens LehmannNext: Phil Hord
Message 11 of 16 in “Submodules always use a relative path to gitdir”
  1. Submodules always use a relative path to gitdirAntony Male, Dec 29, 2011
  2. Junio C HamanoDec 29, 2011
  3. Phil HordDec 31, 2011
  4. Junio C HamanoJan 3, 2012
  5. Junio C HamanoJan 3, 2012
  6. Jens LehmannJan 1, 2012
  7. Junio C HamanoJan 3, 2012
  8. Jens LehmannJan 3, 2012
  9. Junio C HamanoJan 3, 2012
  10. Jens LehmannJan 5, 2012
  11. Junio C HamanoJan 6, 2012
  12. Phil HordJan 6, 2012
  13. Nguyen Thai Ngoc DuyJan 6, 2012
  14. Junio C HamanoJan 6, 2012
  15. Fredrik GustafssonDec 29, 2011
  16. Phil HordDec 31, 2011

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.