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

Re: [RFC] Clone repositories recursive with depth 1

From
Stefan Beller <sbeller@google.com>
Date
Nov 12, 2015, 23:47 UTC
Message-ID
<CAGZ79kYNCWXVLWAzTCoFfuHGRkJzzUsojGzK9-f=543FVfVMAg@mail.gmail.com>
In-Reply-To
<19CE7136-E1FD-495A-9BAC-636164757E04@gmail.com>

+cc Stanislav, who came up with the other thread for passing --remote to git submodule

On Thu, Nov 12, 2015 at 1:39 AM, Lars Schneider <larsxschneider@gmail.com> wrote:

Show 9 quoted lines
>> Notice the other email thread, which suggests to include --remote into the
>> call to  git submodule update depending on a branch config option being
>> present in the .gitmodules file.
>
> Can you check "[PATCH v2] add test to demonstrate that shallow recursive clones fail"? This demonstrates the failure that I see. I also tried the "--remote" flag but this does not work either (see test case).
> Can you confirm this behavior?
>
> Cheers,
> Lars
I can confirm it breaks as expected here.
I may have confused you here by pointing to the --remote option.

(git clone is a bit stupid when it comes to submodule handling.) All it does currently is this:

    if --recurseSubmodules option or --recursive option is given:
        run: "git submodule update --init --recursive"

No attention is paid to any other option such as --depth. That's all I wanted to point out there.

Ideally we want to add:
    If there is a branch configured in the .gitmodules file,
    we would want to add the --remote command
    if we have given other options such as --depth or --reference
    we want to pass that along to the called submodule helper.

So I was looking at the internal code structure and think one of the next series I am going to send will touch the code such that we can incorporate the conditions as outlined above easier, because it is not hardcoded into an array ["git", "submodule", "update" "--init", "--recursive"], as I want to add yet another dynamic option to the submodule helper invocation. (I want to add --jobs <n> there)

Cheers, Stefan

Previous: Lars SchneiderNext: Fredrik Gustafsson
Message 5 of 6 in “[RFC] Clone repositories recursive with depth 1”
  1. Lars SchneiderNov 11, 2015
  2. Stefan BellerNov 11, 2015
  3. Stefan BellerNov 11, 2015
  4. Lars SchneiderNov 12, 2015
  5. Stefan BellerNov 12, 2015
  6. Fredrik GustafssonNov 14, 2015

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.