{"thread":{"id":"26747","subject":"git submodule status during merge","startedAt":"2011-03-16T09:32:57Z","lastAt":"2011-03-16T09:32:57Z","messageCount":1,"participants":["Nicolas Morey-Chaisemartin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"163456","messageId":"4D8083C9.4070300@morey-chaisemartin.com","threadId":"26747","inReplyTo":null,"subject":"git submodule status during merge","fromName":"Nicolas Morey-Chaisemartin","fromEmail":"devel-git@morey-chaisemartin.com","sentAt":"2011-03-16T09:32:57Z","receivedAt":"2011-03-16T09:32:57Z","isPatch":false,"sender":{"key":"devel-git@morey-chaisemartin.com","avatar":"https://avatars.githubusercontent.com/u/108326?v=4"},"body":"Hi,\n\nWhile I was trying to merge a superproject with tons of submodule (conflicting) I noticed that several submodules show 3 times when running \"git submodule status\"\n\nEx:\n+c31377d713fa3ef03960de6672ce69d2a1e7317e gdb (reverse-20080717-branchpoint-7820-gc31377d)\n+c31377d713fa3ef03960de6672ce69d2a1e7317e gdb (reverse-20080717-branchpoint-7820-gc31377d)\n+c31377d713fa3ef03960de6672ce69d2a1e7317e gdb (reverse-20080717-branchpoint-7820-gc31377d)\n\nAfter a quick investigation, it appears this is due to module_list in git-submodule which uses\n        git ls-files --error-unmatch --stage -- \"$@\" | sane_grep '^160000 '\nto retrieve a list of all available submodules.\n\nAs there is a conflict, the submodules show in 3 different stages.\nThe status command later uses\n    cd \"$path\" && git rev-parse --verify HEAD\nso the same SHA1 is displayed for the 3 times the submodule appears.\n\nAlthough it is not a big issue, it is quite puzzling for most people.\nSo here are the few questions:\n    * Is this an expected behaviour and if yes, why?\n    * If not, is module_list the place to fix it?\nIt does not seem that any of the git commands are using the stage information yet. So I suppose keeping only one of the entries should not be too problematic.\nSimply filtering with something like awk '{ if ($3 == 0 || $3 == 1) print $0}'  seems to solve the problem\n\nThanks in advance\n\nNicolas Morey-Chaisemartin\n"}]}