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

Re: bug: git submodule add fails when .git is a symlink

From
Stefan Beller <sbeller@google.com>
Date
Apr 20, 2016, 16:41 UTC
Message-ID
<CAGZ79kbpyu34kz7gRgro-HZqNvpmRoCsyQatZRbxP19bk1gkfg@mail.gmail.com>
In-Reply-To
<20160302084904.GA30295@sigill.intra.peff.net>
On Wed, Mar 2, 2016 at 12:49 AM, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> On Tue, Mar 01, 2016 at 07:17:20PM -0400, Joey Hess wrote:
>
>> Junio C Hamano wrote:
>> > A more pertinent question may be which version of Git did the above
>> > ever work, I guess.  We fairly liberally chdir around and I do not
>> > think we deliberately avoid assuming that "cd .git && cd .." might
>> > not come back to the original directory, for example, so I wouldn't
>> > be surprised if it never worked.
>>
>> IIRC git used symlinks for .git in submodules before version 1.7.8, so I
>> guess that older versions supported that pretty well.
>>
>> This one case is the only time I've seen a symlink for .git present a
>> problem so far.
>
> Fortunately you provided a simple reproduction case, so it is easy to
> bisect. It did work in v1.7.8, and broke in d75219b (submodules: always
> use a relative path from gitdir to work tree, 2012-03-04). Not
> surprising, I guess. It presumably worked before only because we were
> using absolute paths.
So I was looking into this bug again, as it was linked from another bug report.
fatal: Could not chdir to '../../../sub': No such file or directory
sounds like a path issue with the prefix thing.

Using the " echo "gitdir: ../gitdir/.git" > .git" workaround does still work, I'll see if there is another way to fix it with actual links.

Show 6 quoted lines
>
> -Peff
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Jeff KingNext: Stefan Beller
Message 8 of 9 in “bug: git submodule add fails when .git is a symlink”
  1. Joey HessMar 1, 2016
  2. Stefan BellerMar 1, 2016
  3. Stefan BellerMar 1, 2016
  4. Joey HessMar 1, 2016
  5. Junio C HamanoMar 1, 2016
  6. Joey HessMar 1, 2016
  7. Jeff KingMar 2, 2016
  8. Stefan BellerApr 20, 2016
  9. Stefan BellerApr 20, 2016

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.