# [BUG] git-mv submodule failure

5 messages from 2007-10-20 to 2007-10-22. Participants: Yin Ping, Johannes Schindelin.
Thread: https://gitlist.dev/t/10386

## Yin Ping, 2007-10-20 06:01

Subject: [BUG] git-mv submodule failure
Message-ID: <46dff0320710192301p3e1d88d5l3b662b72b051d920@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710192301p3e1d88d5l3b662b72b051d920%40mail.gmail.com

```
project
  .git
  file1
  submoudle
     .git
      file2

$ cd project
$ git-mv submodule submodule1
fatal: source directory is empty, source=submodule, destination=submodule1

However, the following is ok and rename is automatically detected
$ cd project
$ mv submodule submodule1
$ git-add submodule1
$ git-commit -a

which gives in vim:
# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   renamed:    submodule -> submodule1
#

-- 
franky

```

## Johannes Schindelin, 2007-10-20 21:24

Subject: Re: [BUG] git-mv submodule failure
Message-ID: <Pine.LNX.4.64.0710202223590.25221@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710202223590.25221%40racer.site
In-Reply-To: <46dff0320710192301p3e1d88d5l3b662b72b051d920@mail.gmail.com>

```
Hi,

On Sat, 20 Oct 2007, Yin Ping wrote:

> project
>   .git
>   file1
>   submoudle
>      .git
>       file2
> 
> $ cd project
> $ git-mv submodule submodule1
> fatal: source directory is empty, source=submodule, destination=submodule1
> 
> However, the following is ok and rename is automatically detected
> $ cd project
> $ mv submodule submodule1
> $ git-add submodule1
> $ git-commit -a
> 
> which gives in vim:
> # Please enter the commit message for your changes.
> # (Comment lines starting with '#' will not be included)
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #   renamed:    submodule -> submodule1
> #

But of course .gitmodules is unaffected.  But it should be changed, too.

Ciao,
Dscho

```

## Yin Ping, 2007-10-21 05:48

Subject: Re: [BUG] git-mv submodule failure
Message-ID: <46dff0320710202248v56af5cb0gcf7dacb32848eca3@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710202248v56af5cb0gcf7dacb32848eca3%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0710202223590.25221@racer.site>

```
>
> But of course .gitmodules is unaffected.  But it should be changed, too.
>

IMHO, changing .gitmodules is what the 'git-submodule mv' should do,
and 'git-mv' should only rename the module directory

> Ciao,
> Dscho
>
>


-- 
franky

```

## Johannes Schindelin, 2007-10-21 10:02

Subject: Re: [BUG] git-mv submodule failure
Message-ID: <Pine.LNX.4.64.0710211102230.25221@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710211102230.25221%40racer.site
In-Reply-To: <46dff0320710202248v56af5cb0gcf7dacb32848eca3@mail.gmail.com>

```
Hi,

On Sun, 21 Oct 2007, Yin Ping wrote:

> > But of course .gitmodules is unaffected.  But it should be changed, too.
> 
> IMHO, changing .gitmodules is what the 'git-submodule mv' should do, and 
> 'git-mv' should only rename the module directory

No.  If you "git mv" a submodule, it makes absolutely no sense to leave 
.gitmodules as is.

Ciao,
Dscho

```

## Yin Ping, 2007-10-22 11:46

Subject: Re: [BUG] git-mv submodule failure
Message-ID: <46dff0320710220446r51a17b34oa0f5c0043cd1076d@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320710220446r51a17b34oa0f5c0043cd1076d%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0710211102230.25221@racer.site>

```
On 10/21/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> No.  If you "git mv" a submodule, it makes absolutely no sense to leave
> .gitmodules as is.
>
 I can modify the .gitmodule manually since git-submodule mv is not
available. Anyway, I just want a command to rename a submodule easily,
not "mv && git-rm && git-add".
>


-- 
franky

```
