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

Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'

From
LALoet Avramson <loet@forter.com>
Date
May 5, 2016, 19:20 UTC
Message-ID
<CAK1enhO-2Ne4XVqRNXz+6Jd7uEEHde8-_xzwWzXh=b01bZhj0g@mail.gmail.com>
In-Reply-To
<CAGZ79kYmh9wtzXdThzPTdEZ5SsKznYxze6EvmbaZdGog4yydNA@mail.gmail.com>

It happened on 2.8.1, also reproducible on 2.8.2. Haven't had the time to dive deeper into the code but my guess is that relative_path() returns different results in those 2 cases or maybe the way git-submodule.sh handles it.

On Thu, May 5, 2016 at 8:22 PM, Stefan Beller <sbeller@google.com> wrote:
Show 47 quoted lines
> On Thu, May 5, 2016 at 5:51 AM, Loet Avramson <loet@forter.com> wrote:
>> Hi,
>>
>> According to git-clone man page - running 'git clone --recursive' "...is
>> equivalent to running 'git submodule update --init --recursive' immediately
>> after the clone is finished...", though I found a little difference between
>> the two regarding the submodule's .git file:
>>
>> 1. Running 'git clone' and 'git submodule update --init --recursive'
>> separately will create the .git file in each submodule containing a relative
>> path to the superproject's .git directory as expected.
>>
>> 2. Running 'git clone --recursive' will create the .git file containing an
>> *absolute* path to the superproject's .git directory. (as it was expected
>> using git versions 1.7.8 - 1.7.10 as far as I understand)
>>
>> Not sure if that's a bug but it got stuff behaving really weird in a specific
>> usecase on one of our environments. It would be highly appreciated to update
>> the docs at least.
>
> Which version of Git are you using?
>
> See[1] for how clone handles submodules. (It's a call to submodule
> update --init --recursive)
>
> There was a bug with recursive submodules in the 2.7 time frame and
> that got fixed in [2].
>
> So could you make sure your version of Git contains these fixes?
>
>
>
> [1] https://kernel.googlesource.com/pub/scm/git/git/+/master/builtin/clone.c#734
> [2] https://kernel.googlesource.com/pub/scm/git/git/+/7307dd898988c79fc687051e783b3cac8488a559
> specially https://kernel.googlesource.com/pub/scm/git/git/+/f8eaa0ba98b3bd9cb9035eba184a2d9806d30b27
>
>
>
>>
>> Thanks.
>>
>>  -Loet
>>
>> --
>> 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: Stefan BellerNext: Stefan Beller
Message 4 of 7 in “Submodule's .git file contains absolute path when created using 'git clone --recursive'”
  1. Loet AvramsonMay 5, 2016
  2. Junio C HamanoMay 5, 2016
  3. Stefan BellerMay 5, 2016
  4. Loet AvramsonMay 5, 2016
  5. Stefan BellerMay 5, 2016
  6. Ricardo Sánchez-SáezJul 12, 2016
  7. Stefan BellerJul 12, 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.