threads / bug / 10386

[BUG] git-mv submodule failure

Subject: [BUG] git-mv submodule failure

## tl;dr

5 messages between Oct 20, 2007 and Oct 22, 2007.

replies: 4people: 2as markdown or json

Yin Ping· Oct 20, 2007, 06:01 UTC · lore
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· Oct 20, 2007, 21:24 UTC · re: Yin Ping · lore

Re: [BUG] git-mv submodule failure

Hi,
On Sat, 20 Oct 2007, Yin Ping wrote:
Show 26 quoted lines
> 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· Oct 21, 2007, 05:48 UTC · re: Johannes Schindelin · lore

Re: [BUG] git-mv submodule failure

>
> 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· Oct 21, 2007, 10:02 UTC · re: Yin Ping · lore

Re: [BUG] git-mv submodule failure

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· Oct 22, 2007, 11:46 UTC · re: Johannes Schindelin · lore

Re: [BUG] git-mv submodule failure

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

← back to recent threads