Re: [PATCH v2 5/6] tests: remove duplicate .gitmodules path
- From
Calvin Wan <calvinwan@google.com>
- Date
- Mar 2, 2023, 23:09 UTC
- Message-ID
- <CAFySSZBqN+a-mP=+epz4rELYH_aLnrTC+VRFFTvib0W0nUBQ2Q@mail.gmail.com>
- In-Reply-To
- <xmqqpm9tpdmw.fsf@gitster.g>
On Tue, Feb 28, 2023 at 3:35 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> > Calvin Wan <calvinwan@google.com> writes: > > > Swapping `git add <submodule>` to `git submodule add <submodule>` > > in a previous patch created a .gitmodules file with multiple > > submodules pointing to the same path in certain tests. Fix tests > > so that they are run on the original added submodule rather than > > a separate manually configured submodule. > > Doesn't "git submodule add" have a way to give a specific name other > than the default taken from the path? If "git add sub" is converted > to "git submodule add --name subname ./sub", wouldn't these changes > become unnecessary? >
If we converted to "git submodule add --name subname ./sub", we would instead have a different set of problems. For example, instances of git config --add -f .gitmodules submodule.subname.path sub git config -f .gitmodules submodule.subname.path sub and other similar lines would still need to be removed to prevent duplicate paths. That, however, seems like a better alternative than my current patch which replaces those removals with different ones.