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

Re: [PATCH 0/2] Support relative .git file in a submodule

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jan 8, 2010, 23:24 UTC
Message-ID
<32541b131001081524g43d54a44i582dd286c1dfe7a5@mail.gmail.com>
In-Reply-To
<7vocl4urc6.fsf@alter.siamese.dyndns.org>
On Fri, Jan 8, 2010 at 6:09 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Brad King <brad.king@kitware.com> writes:
>
>> ... if a submodule
>> has a .git file "symlink" with a relative path to the real submodule
>> repository then ...
>
> ... then I've always thought that is simply a misconfiguration (t0002
> seems to use full path for this exact reason).  Is there a reason why
> relative path should be used/usable here, other than "being able to is
> better than not being able to"???

If I have a bunch of git repos in ~/src, and I decide I'd rather rename it all to ~/source, it seems like it would be nice for all my links not to be broken. This sort of thing can also happen if you have NFS-mounted home directories on a farm of machines, and some of them automount in /u/username and others use /home/username, for example. I think this is the same reason that common sysadmin advice is to use relative symlinks instead of absolute links.

This problem seems especially true with submodules. If the submodule's repo is something like supermodule/.git/submodule.git, a relative path would almost always be a appropriate, no?

Have fun,
Avery
Previous: Junio C HamanoNext: Brad King
Message 5 of 9 in “Support relative .git file in a submodule”
  1. 0/2 Support relative .git file in a submoduleBrad King, Jan 8, 2010
  2. 1/2 Test update-index for a gitlink to a .git fileBrad King, Jan 8, 2010
  3. 2/2 Handle relative paths in submodule .git filesBrad King, Jan 8, 2010
  4. Junio C HamanoJan 8, 2010
  5. Avery PennarunJan 8, 2010
  6. 0/2 Support relative .git file in a submoduleBrad King, Jan 9, 2010
  7. Junio C HamanoJan 9, 2010
  8. 1/2 Test update-index for a gitlink to a .git fileBrad King, Jan 9, 2010
  9. 2/2 Handle relative paths in submodule .git filesBrad King, Jan 9, 2010

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.