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

Re: [PATCH 2/4] submodule.c: uninitialized submodules are ignored in recursive commands

From
Stefan Beller <sbeller@google.com>
Date
Apr 13, 2017, 19:12 UTC
Message-ID
<CAGZ79kZybFNPPAuw4GmVUSmQVBcCG402uCur8M9hSoY3CbhbXw@mail.gmail.com>
In-Reply-To
<20170413190541.GD96917@google.com>
On Thu, Apr 13, 2017 at 12:05 PM, Brandon Williams <bmwill@google.com> wrote:
Show 8 quoted lines
> On 04/11, Stefan Beller wrote:
>> This was an oversight when working on the working tree modifying commands
>> recursing into submodules.
>>
>> To test for uninitialized submodules, introduce another submodule, that is
>> uninitialized in the actual tests. By adding it to the branch "add_sub1",
>> which is the starting point of all other branches, we have wide coverage.
>>
...
>
> The 'submodule add' command will make the submodule active, so you'll
> need to add in a line to subsequently make the submodule inactive for
> this to work, unless you do in at a later point in time.

Yes, it will make it active, but that doesn't matter here, because at this point (in create_lib_submodule_repo) we prepare an upstream in submodule_update_repo

Any later test follows the structure of
    prolog &&
    reset_work_tree_to no_submodule &&
    (
        cd submodule_update &&
        # do actual test here, in submodule_update
    )

Note that 'prolog' performs a clone of submodule_update_repo to submodule_update, manually setting 'sub1' to active.

'uninitialized_sub' is not active.
I tried to explain it via
    To test for uninitialized submodules, introduce another submodule,
    that is uninitialized in the actual tests.
in the commit message, but that is too concise apparently.
So the resend will explain that a bit more.

Thanks, Stefan

Previous: Brandon WilliamsNext: Brandon Williams
Message 8 of 15 in “recursive submodules: git-reset!”
  1. 0/4 recursive submodules: git-reset!Stefan Beller, Apr 11, 2017
  2. 1/4 entry.c: submodule recursing: respect force flag correctlyStefan Beller, Apr 11, 2017
  3. Philip OakleyApr 12, 2017
  4. Jonathan TanApr 14, 2017
  5. Stefan BellerApr 14, 2017
  6. 2/4 submodule.c: uninitialized submodules are ignored in recursive commandsStefan Beller, Apr 11, 2017
  7. Brandon WilliamsApr 13, 2017
  8. Stefan BellerApr 13, 2017
  9. Brandon WilliamsApr 13, 2017
  10. 4/4 builtin/reset: add --recurse-submodules switchStefan Beller, Apr 11, 2017
  11. 3/4 submodule.c: harden submodule_move_head against broken submodulesStefan Beller, Apr 11, 2017
  12. Philip OakleyApr 12, 2017
  13. Brandon WilliamsApr 13, 2017
  14. Stefan BellerApr 13, 2017
  15. Jonathan TanApr 14, 2017

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.