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

Re: [PATCH 3/4] submodule.c: harden submodule_move_head against broken submodules

From
BWBrandon Williams <bmwill@google.com>
Date
Apr 13, 2017, 19:08 UTC
Message-ID
<20170413190839.GE96917@google.com>
In-Reply-To
<20170411234923.1860-4-sbeller@google.com>
On 04/11, Stefan Beller wrote:
Show 12 quoted lines
> Early on in submodule_move_head just after the check if the submodule is
> initialized, we need to check if the submodule is populated correctly.
> 
> If the submodule is initialized but doesn't look like populated, this
> is a red flag and can indicate multiple sorts of failures:
> (1) The submodule may be recorded at an object name, that is missing.
> (2) The submodule '.git' file link may be broken and it is not pointing
>     at a repository.
> 
> In both cases we want to complain to the user in the non-forced mode,
> and in the forced mode ignoring the old state and just moving the
> submodule into its new state with a fixed '.git' file link.

What about the case where you have marked a submodule as active but don't have its respective .gitdir yet? For now i think it would be acceptable to complain and do nothing/ignore it, in the future we may want to actually clone and then check it out.

-- 
Brandon Williams
Previous: Philip OakleyNext: Stefan Beller
Message 13 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.