{"thread":{"id":"35549","subject":"Bug when moving submodules (I think?)","startedAt":"2013-12-18T23:32:05Z","lastAt":"2013-12-20T19:13:50Z","messageCount":2,"participants":["fREW Schmidt","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"232213","messageId":"20131218233146.GR17291@wanderlust","threadId":"35549","inReplyTo":null,"subject":"Bug when moving submodules (I think?)","fromName":"fREW Schmidt","fromEmail":"frioux@gmail.com","sentAt":"2013-12-18T23:32:05Z","receivedAt":"2013-12-18T23:32:05Z","isPatch":false,"sender":{"key":"frioux@gmail.com","avatar":"https://gravatar.com/avatar/639ef3cc221c7f2c225568697bc9d42be4d4e3bada6b4a3b9c32685548f3c105?d=mp&s=160"},"body":"I tried to make a script to repro this from scratch but ran into other\nissues, which may or may not be a bug.  I'll put that at the end.\n\nTo repro all you have to do is: \n\n git checkout git://github.com/frioux/dotfiles\n git reset --hard 92c85161ceec9e52b0b2d2de893ba11f49c80198\n git mv zsh .zsh\n\n(sha included so this email continues to be valid in the future)\n\nYou can now see that .git/index.lock has been left behind.  On a\nnon-fresh checkout (I'm not sure why my old checkout is special) I get\nthe following error:\n\n git: builtin/mv.c:248: cmd_mv: Assertion `pos >= 0' failed.\n\nI assumed this was just related to moving submodules that are in\nsubdirectories, but when I do that from a fresh repo I get a different\nerror.\n\n mkdir -p test/a test/b\n cd test/a\n git init\n touch a.txt\n git add a.txt\n git ci -m 'initial commit'\n cd ../b\n git init\n mkdir c\n touch c/c.txt\n git submodule add ../a c/a\n git ci -m 'initial commit'\n git mv c d\n git status\n\nAnd the error:\n\n fatal: Could not chdir to '../../../../c/a': No such file or directory\n fatal: 'git status --porcelain' failed in submodule d/a\n\nI am using git v1.8.5.1 built from source on the latest ubuntu.  If\nthere is anything else I can do to help repro this please do not\nhesitate to ask.\n-- \nfREW Schmidt\nhttp://blog.afoolishmanifesto.com\n"},{"id":"232290","messageId":"52B496EE.70204@web.de","threadId":"35549","inReplyTo":"20131218233146.GR17291@wanderlust","subject":"Re: Bug when moving submodules (I think?)","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-12-20T19:13:50Z","receivedAt":"2013-12-20T19:13:50Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 19.12.2013 00:32, schrieb fREW Schmidt:\n> I tried to make a script to repro this from scratch but ran into other\n> issues, which may or may not be a bug.  I'll put that at the end.\n> \n> To repro all you have to do is: \n> \n>  git checkout git://github.com/frioux/dotfiles\n>  git reset --hard 92c85161ceec9e52b0b2d2de893ba11f49c80198\n>  git mv zsh .zsh\n> \n> (sha included so this email continues to be valid in the future)\n> \n> You can now see that .git/index.lock has been left behind.\n\nThanks for the recipe, I can reproduce this crash and am working\non a fix (looks like mv chokes on an empty submodule). I'll look\ninto the problems you describe below too while doing that.\n\n>  On a\n> non-fresh checkout (I'm not sure why my old checkout is special) I get\n> the following error:\n> \n>  git: builtin/mv.c:248: cmd_mv: Assertion `pos >= 0' failed.\n> \n> I assumed this was just related to moving submodules that are in\n> subdirectories, but when I do that from a fresh repo I get a different\n> error.\n> \n>  mkdir -p test/a test/b\n>  cd test/a\n>  git init\n>  touch a.txt\n>  git add a.txt\n>  git ci -m 'initial commit'\n>  cd ../b\n>  git init\n>  mkdir c\n>  touch c/c.txt\n>  git submodule add ../a c/a\n>  git ci -m 'initial commit'\n>  git mv c d\n>  git status\n> \n> And the error:\n> \n>  fatal: Could not chdir to '../../../../c/a': No such file or directory\n>  fatal: 'git status --porcelain' failed in submodule d/a\n"}]}