{"thread":{"id":"37796","subject":"jpalacios@atlassian.com","startedAt":"2014-10-24T02:50:02Z","lastAt":"2014-10-24T02:50:02Z","messageCount":1,"participants":["Juan Palacios"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251006","messageId":"CABY2JrJjZH+hgeGCBwFjBxsTdo_M2yXctr1dJKLxFL28hacQPw@mail.gmail.com","threadId":"37796","inReplyTo":null,"subject":"jpalacios@atlassian.com","fromName":"Juan Palacios","fromEmail":"jpalacios@atlassian.com","sentAt":"2014-10-24T02:50:02Z","receivedAt":"2014-10-24T02:50:02Z","isPatch":false,"sender":{"key":"jpalacios@atlassian.com","avatar":null},"body":"In a project with a submodule, if you merge two diverging branches in\nwhich one branch updated which commit the submodule points to, and the\nother branch moves the submodule to a new location, the resulting\nmerge error message does not provide information about what the\nconflict was, or the path to the conflicted directory.\n\nI've included at the bottom a short script which sets up a project\nwith a submodule and creates both branches. If after running it you cd\ninto 'top-level-project' and run 'git merge\nbranch_that_points_the_submodule_to_new_commit' the resulting error\nmessage is:\n\nAuto-merging submodule-moved\nAdding as submodule-moved~HEAD instead\nAutomatic merge failed; fix conflicts and then commit the result.\n\nI would have expected an output in line with other merge conflict\nmessages. Something with the format:\n\nCONFLICT (<REASON>): Merge conflict in <PATH_TO_CONFLICT>\n\nWhere <REASON> would be something like (delete/modify) I believe this\nmight be a bug in the implementation.\n\nThank you\n\n--------------------------\n\n# Create a submodule\nmkdir submodule\npushd submodule\necho \"This is a submodule\" > README.txt\ngit init\ngit add README.txt\ngit commit -m \"Initial commit\"\npopd\n\n# Create a top level project\nmkdir top-level-project\npushd top-level-project\necho \"This is a parent project\" > README.txt\ngit init\ngit add README.txt\ngit commit -m \"Initial commit\"\n\n# Add submodule to top level project\ngit submodule add ../submodule/\ngit commit -m \"Added a submodule\"\n\n# Create two diverging branches\ngit checkout -b branch_that_points_the_submodule_to_new_commit\ngit checkout -b branch_that_moves_the_submodule_to_new_path\n\n# Update the commit the submodule points to in one branch\ngit checkout branch_that_points_the_submodule_to_new_commit\npushd submodule\necho \"This modifies the README file\" > README.txt\ngit add .\ngit commit -m \"Added line to README file\"\npopd\ngit add submodule\ngit commit -m \"Updated submodule to point to new commit\"\n\n# Move the submodule directory in the other branch\ngit checkout branch_that_moves_the_submodule_to_new_path\ngit submodule update\ngit mv submodule submodule-moved\ngit commit -m \"Moved submodule to new path\"\n"}]}