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 3, 2012, 19:58 UTC
Message-ID
<7vobuktv6p.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vlipovd4n.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> ...
> And the extent of the design of
>
>     echo "gitdir: $there" >.git && git config core.worktree "$(pwd)"
>
> is to work with the locations of these two places as they are set up.
> Moving one or the other or both may or may not work without adjusting to
> what you did. If you "mv $there $newlocation" (the repository) behind
> Git's back, you may need to update .git to point at the new location of
> the repository.  If you move your working tree woth "mv", you may need to
> update core.worktree to point at the new location of the working tree.
> And until you do so things may not work. That is why we do not explicitly
> say "you can move them to arbitrary places without telling git and things
> will work"---because that is not the case.

Just to avoid any misunderstanding, I still agree with the overall goal of the original patch to allow moving the whole superproject tree, including its submodule repositories in its .git/modules/, and the working trees of itself and its submodules. It is a narrow special case with a very well defined relative relationships between the working tree of submodules and the repositories that control them, and having them point to each other with relative paths will make any post-move adjustments unnecessary, unlike more general unconstrained uses of the "gitdir: $there" mechanism.

Previous: Junio C HamanoNext: Jens Lehmann
Message 5 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.