{"thread":{"id":"51811","subject":"Feature Suggestion: Conflict resolution for submodules","startedAt":"2019-09-06T13:38:52Z","lastAt":"2019-09-06T13:38:52Z","messageCount":1,"participants":["Robert Dailey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"381955","messageId":"CAHd499D+yjZiASCC4Kxw--dCY9hboQCzkgMFiy3PaqaN2qZC3A@mail.gmail.com","threadId":"51811","inReplyTo":null,"subject":"Feature Suggestion: Conflict resolution for submodules","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2019-09-06T13:38:36Z","receivedAt":"2019-09-06T13:38:52Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"I've observed that when merging a branch, and there's a submodule\nconflict, sometimes Git will prompt a suggested resolution like so:\n\n```\nFailed to merge submodule Core (not fast-forward)\nFound a possible merge resolution for the submodule:\n\nIf this is correct simply add it to the index for example\nby using:\n\n  git update-index --cacheinfo 160000\n18c7a8e26fa78075d0f840526d0b830103c6072f \"Core\"\n\nwhich will accept this suggestion.\n```\n\nWhen I run `git mergetool`, I get this prompt:\n\n```\nSubmodule merge conflict for 'Core':\n  {local}: submodule commit 6075077b3f2f213d312edd8286ed203b5e1232e2\n  {remote}: submodule commit 565999a437e64cc83554da83a1d124f54daf9257\nUse (l)ocal or (r)emote, or (a)bort?\n```\n\nI think it would be great if there was a 4th option added here, that\nreally just served as a vanity command for the aforementioned `git\nupdate-index` command. For example:\n\n```\nSubmodule merge conflict for 'Core':\n  {local}: submodule commit 6075077b3f2f213d312edd8286ed203b5e1232e2\n  {remote}: submodule commit 565999a437e64cc83554da83a1d124f54daf9257\n  {suggested}: submodule commit 18c7a8e26fa78075d0f840526d0b830103c6072f\nUse (l)ocal or (r)emote, (s)uggested, or (a)bort?\n```\n\nTyping `s` would execute this command, basically:\n\n```\ngit update-index --cacheinfo 160000\n18c7a8e26fa78075d0f840526d0b830103c6072f \"Core\"\n```\n\nMy reason for recommending this is that there's no real convenient way\nto accept the suggested resolution for the submodule. The only real\nfeasible way to use the suggestiong is to copy & paste the whole line\nin the terminal, which is clunky.\n\nI'd love to hear from the community to see what you all think about\nthis idea. Thanks for reading.\n"}]}