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

Re: [PATCH] add test for bug in git-mv with nested submodules

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Aug 18, 2017, 16:06 UTC
Message-ID
<20170818160603.GA69414@book.hvoigt.net>
In-Reply-To
<CAGZ79kZhUO95oSEzARqXi3+dm5Ow5Jwm-O1adowh0nkbqHdhMw@mail.gmail.com>
On Thu, Aug 17, 2017 at 12:05:56PM -0700, Stefan Beller wrote:
Show 32 quoted lines
> On Thu, Aug 17, 2017 at 3:34 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> > When using git-mv with a submodule it will detect that and update the
> > paths for its configurations (.gitmodules, worktree and gitfile). This
> > does not work for nested submodules where a user renames the root
> > submodule.
> >
> > We discovered this fact when working on on-demand fetch for renamed
> > submodules. Lets add a test to document.
> >
> > Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
> > ---
> >  t/t7001-mv.sh | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
> > index e365d1f..39f8aed 100755
> > --- a/t/t7001-mv.sh
> > +++ b/t/t7001-mv.sh
> > @@ -491,4 +491,13 @@ test_expect_success 'moving a submodule in nested directories' '
> >         test_cmp actual expect
> >  '
> >
> > +test_expect_failure 'moving nested submodules' '
> > +       git commit -am "cleanup commit" &&
> > +       git submodule add ./. sub_nested &&
> 
> If possible, I would avoid adding the repo itself
> as a submodule as it is unrealistic in the wild.
> 
> While it may be ok for the test here, later down the road
> other tests making use of it it may become an issue with
> the URL of the submodule.

I just copied the shortcut that they were adding themselfes as submodule in 'setup submodule'. The whole setup of submodules in this test is like this. This way we already had a nested submodule structure which I could just add.

I agree that this is unrealistic so I can change that in the test I am adding. But from what I have seen, this shortcut is taken in quite some places when dealing with submodules.

Cheers Heiko
Previous: Stefan BellerNext: Stefan Beller
Message 3 of 8 in “add test for bug in git-mv with nested submodules”
  1. add test for bug in git-mv with nested submodulesHeiko Voigt, Aug 17, 2017
  2. Stefan BellerAug 17, 2017
  3. Heiko VoigtAug 18, 2017
  4. Stefan BellerAug 18, 2017
  5. add test for bug in git-mv for recursive submodulesHeiko Voigt, Sep 15, 2017
  6. Junio C HamanoSep 17, 2017
  7. Stefan BellerSep 18, 2017
  8. Heiko VoigtSep 20, 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.