Re: [PATCH v9 0/3] teach submodules to know they're submodules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 13, 2022, 05:43 UTC
- Message-ID
- <xmqqpmmql860.fsf@gitster.g>
- In-Reply-To
- <220311.8635joj0lf.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> But now it's a boolean indicating "it's there, discover it", and the > implied (but not really explicitly stated) reason in 2/3 is that it's > purely for optimization purposes at this point.
You may know that I have a separate checkout of the 'todo' branch at path "Meta" in my working tree.
I could use the hasSuperproject=false setting there, to say "this is *NOT* a submodule, even the parent directory is a working tree of a different repository, it is not our superproject, so do *NOT* bother to go up to discover anything".
If that configuration weren't there in the "Meta/.git/config", the parent directory of "Meta" (which has its own ".git") cannot tell if that "Meta" thing is a submodule being prepared that hasn't been added yet, or it will never intended to be a submodule. I would imagine that "git add X" can later be taught to refuse to add X if there is X/.git and X/.git/config says it explicitly says that it does not have a superproject.
So, I am not sure if it is a good characterization that it is for optimization at all.