{"thread":{"id":"44411","subject":"should git-subtree ignore submodules?","startedAt":"2016-11-02T00:15:17Z","lastAt":"2017-03-29T07:05:41Z","messageCount":2,"participants":["Kirill Katsnelson","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"305277","messageId":"183ca87e-1bc0-080c-3d42-87c689b9f62e@smartaction.com","threadId":"44411","inReplyTo":null,"subject":"should git-subtree ignore submodules?","fromName":"Kirill Katsnelson","fromEmail":"kkm@smartaction.com","sentAt":"2016-11-01T19:41:50Z","receivedAt":"2016-11-02T00:15:17Z","isPatch":false,"sender":{"key":"kkm@smartaction.com","avatar":null},"body":"\"git-subtree add\" fails to add the subtree into a repository with \nsubmodules, reporting that the worktree is not clean, while `git status` \nsays that everything is clean (including submodules). I tracked the \nproblem down to the command \"git index HEAD\" returning all submodules as \nhaving the M status:\n\n$ git diff-index HEAD\n:160000 160000 d3812c9318c4d0336897fd2d666be908fa1a7953 \nd3812c9318c4d0336897fd2d666be908fa1a7953 M      ext/grpc\n<snip more submodules>\n$ git --version\ngit version 2.9.2.windows.1\n\nI worked around the problem in my local copy of git-subtree shell script \nby adding \"--ignore-submodules=all\" to the two invocations of `git \ndiff-index` in the ensure_clean() function (direct link \n<https://github.com/git/git/blob/next/contrib/subtree/git-subtree.sh#L586>).\n\nI am wondering, is this a defect in git-subtree? To my understanding, \nthe command should not care about submodules more than ensuring their \nworktree is not in the way of new prefix, and that's a separate check. \nSo *even if* the submodule is modified, this should not be a show \nstopper for \"git-subtree add\". Or am I missing some subtleties?\n\n  -kkm\n"},{"id":"315651","messageId":"20170329070515.znaox4q52q5elkxy@gmail.com","threadId":"44411","inReplyTo":"183ca87e-1bc0-080c-3d42-87c689b9f62e@smartaction.com","subject":"Re: should git-subtree ignore submodules?","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2017-03-29T07:05:15Z","receivedAt":"2017-03-29T07:05:41Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Nov 01, 2016 at 12:41:50PM -0700, Kirill Katsnelson wrote:\n> \"git-subtree add\" fails to add the subtree into a repository with\n> submodules, reporting that the worktree is not clean, while `git status`\n> says that everything is clean (including submodules). I tracked the problem\n> down to the command \"git index HEAD\" returning all submodules as having the\n> M status:\n> \n> $ git diff-index HEAD\n> :160000 160000 d3812c9318c4d0336897fd2d666be908fa1a7953\n> d3812c9318c4d0336897fd2d666be908fa1a7953 M      ext/grpc\n> <snip more submodules>\n> $ git --version\n> git version 2.9.2.windows.1\n> \n> I worked around the problem in my local copy of git-subtree shell script by\n> adding \"--ignore-submodules=all\" to the two invocations of `git diff-index`\n> in the ensure_clean() function (direct link\n> <https://github.com/git/git/blob/next/contrib/subtree/git-subtree.sh#L586>).\n> \n> I am wondering, is this a defect in git-subtree? To my understanding, the\n> command should not care about submodules more than ensuring their worktree\n> is not in the way of new prefix, and that's a separate check. So *even if*\n> the submodule is modified, this should not be a show stopper for\n> \"git-subtree add\". Or am I missing some subtleties?\n\nThat sounds correct to me; subtree should ignore submodules.\n-- \nDavid\n"}]}