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

Re: [PATCH 2/2] submodule.c: warn about missing submodule git directories

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 7, 2018, 19:53 UTC
Message-ID
<20180907195349.GA103699@aiede.svl.corp.google.com>
In-Reply-To
<CAGZ79kb0VEDxe0TAMf66nWk3pYMPxrpb_zFmoU4gezzswM5XSQ@mail.gmail.com>
Hi,
Stefan Beller wrote:
> On Wed, Sep 5, 2018 at 12:18 PM Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Stefan Beller wrote:
>>> This is the continuation of f2d48994dc1 (submodule.c: submodule_move_head
>>> works with broken submodules, 2017-04-18), which tones down the case of
>>> "broken submodule" in case of a missing git directory of the submodule to
>>> be only a warning.
[...]
Show 11 quoted lines
>> I don't understand what workflow this is a part of.
>>
>> If the submodule is missing, shouldn't we make it non-missing instead
>> of producing a partial checkout that doesn't build?
>
> No. checkout and friends do not want to touch the network
> (unless we are in a partial clone world; that is the user is fully
> aware that commands can use the network at totally unexpected
> times)
>
> So for that, all we can do is better error messages.

Thanks. This patch doesn't just improve error messages, though, but it makes the operation report success instead of failing.

Isn't that likely to produce more confusion when I run additional commands afterward? In other words, instead of

	$ git checkout --recurse-submodules -B master origin/new-fancy-branch
	Branch 'master' set up to track remote branch 'new-fancy-branch' from 'origin'.
	Switched to a new branch 'master'
	warning: Submodule 'new-fancy-submodule' is missing
	$ git status
[some unclean state]
I would prefer to experience
	$ git checkout --recurse-submodules -B master origin/new-fancy-branch
	fatal: missing submodule 'new-fancy-submodule'
	hint: run "git fetch --recurse-submodules" to fetch it
	$ git status
[clean state]
	$ git fetch --recurse-submodules
[...]
	$ git checkout --recurse-submodules -B master origin/new-fancy-branch
	Branch 'master' set up to track remote branch 'new-fancy-branch' from 'origin'.
	Switched to a new branch 'master'
	$ git status
[clean state]

Thanks, Jonathan

Previous: Stefan BellerNext: SZEDER Gábor
Message 9 of 10 in “t2013: add test for missing but active submodule”
  1. 1/2 t2013: add test for missing but active submoduleStefan Beller, Aug 27, 2018
  2. 2/2 submodule.c: warn about missing submodule git directoriesStefan Beller, Aug 27, 2018
  3. Junio C HamanoAug 28, 2018
  4. Stefan BellerAug 28, 2018
  5. Junio C HamanoAug 29, 2018
  6. Stefan BellerAug 29, 2018
  7. Jonathan NiederSep 5, 2018
  8. Stefan BellerSep 7, 2018
  9. Jonathan NiederSep 7, 2018
  10. SZEDER GáborAug 29, 2018

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.