threads / bug / 35549

Bug when moving submodules (I think?)

Subject: Bug when moving submodules (I think?)

## tl;dr

2 messages between Dec 18, 2013 and Dec 20, 2013.

replies: 1people: 2as markdown or json

fREW Schmidt· Dec 18, 2013, 23:32 UTC · lore

I tried to make a script to repro this from scratch but ran into other issues, which may or may not be a bug. I'll put that at the end.

To repro all you have to do is: 
 git checkout git://github.com/frioux/dotfiles
 git reset --hard 92c85161ceec9e52b0b2d2de893ba11f49c80198
 git mv zsh .zsh
(sha included so this email continues to be valid in the future)

You can now see that .git/index.lock has been left behind. On a non-fresh checkout (I'm not sure why my old checkout is special) I get the following error:

 git: builtin/mv.c:248: cmd_mv: Assertion `pos >= 0' failed.

I assumed this was just related to moving submodules that are in subdirectories, but when I do that from a fresh repo I get a different error.

 mkdir -p test/a test/b
 cd test/a
 git init
 touch a.txt
 git add a.txt
 git ci -m 'initial commit'
 cd ../b
 git init
 mkdir c
 touch c/c.txt
 git submodule add ../a c/a
 git ci -m 'initial commit'
 git mv c d
 git status
And the error:
 fatal: Could not chdir to '../../../../c/a': No such file or directory
 fatal: 'git status --porcelain' failed in submodule d/a

I am using git v1.8.5.1 built from source on the latest ubuntu. If there is anything else I can do to help repro this please do not hesitate to ask.

-- 
fREW Schmidt
http://blog.afoolishmanifesto.com
Jens Lehmann· Dec 20, 2013, 19:13 UTC · re: fREW Schmidt · lore

Re: Bug when moving submodules (I think?)

Am 19.12.2013 00:32, schrieb fREW Schmidt:
Show 12 quoted lines
> I tried to make a script to repro this from scratch but ran into other
> issues, which may or may not be a bug.  I'll put that at the end.
> 
> To repro all you have to do is: 
> 
>  git checkout git://github.com/frioux/dotfiles
>  git reset --hard 92c85161ceec9e52b0b2d2de893ba11f49c80198
>  git mv zsh .zsh
> 
> (sha included so this email continues to be valid in the future)
> 
> You can now see that .git/index.lock has been left behind.

Thanks for the recipe, I can reproduce this crash and am working on a fix (looks like mv chokes on an empty submodule). I'll look into the problems you describe below too while doing that.

Show 29 quoted lines
>  On a
> non-fresh checkout (I'm not sure why my old checkout is special) I get
> the following error:
> 
>  git: builtin/mv.c:248: cmd_mv: Assertion `pos >= 0' failed.
> 
> I assumed this was just related to moving submodules that are in
> subdirectories, but when I do that from a fresh repo I get a different
> error.
> 
>  mkdir -p test/a test/b
>  cd test/a
>  git init
>  touch a.txt
>  git add a.txt
>  git ci -m 'initial commit'
>  cd ../b
>  git init
>  mkdir c
>  touch c/c.txt
>  git submodule add ../a c/a
>  git ci -m 'initial commit'
>  git mv c d
>  git status
> 
> And the error:
> 
>  fatal: Could not chdir to '../../../../c/a': No such file or directory
>  fatal: 'git status --porcelain' failed in submodule d/a

← back to recent threads