# Feature Suggestion: Conflict resolution for submodules

1 messages from 2019-09-06 to 2019-09-06. Participants: Robert Dailey.
Thread: https://gitlist.dev/t/51811

## Robert Dailey, 2019-09-06 13:38

Subject: Feature Suggestion: Conflict resolution for submodules
Message-ID: <CAHd499D+yjZiASCC4Kxw--dCY9hboQCzkgMFiy3PaqaN2qZC3A@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499D%2ByjZiASCC4Kxw--dCY9hboQCzkgMFiy3PaqaN2qZC3A%40mail.gmail.com

```
I've observed that when merging a branch, and there's a submodule
conflict, sometimes Git will prompt a suggested resolution like so:

ˋˋˋ
Failed to merge submodule Core (not fast-forward)
Found a possible merge resolution for the submodule:

If this is correct simply add it to the index for example
by using:

  git update-index --cacheinfo 160000
18c7a8e26fa78075d0f840526d0b830103c6072f "Core"

which will accept this suggestion.
ˋˋˋ

When I run `git mergetool`, I get this prompt:

ˋˋˋ
Submodule merge conflict for 'Core':
  {local}: submodule commit 6075077b3f2f213d312edd8286ed203b5e1232e2
  {remote}: submodule commit 565999a437e64cc83554da83a1d124f54daf9257
Use (l)ocal or (r)emote, or (a)bort?
ˋˋˋ

I think it would be great if there was a 4th option added here, that
really just served as a vanity command for the aforementioned `git
update-index` command. For example:

ˋˋˋ
Submodule merge conflict for 'Core':
  {local}: submodule commit 6075077b3f2f213d312edd8286ed203b5e1232e2
  {remote}: submodule commit 565999a437e64cc83554da83a1d124f54daf9257
  {suggested}: submodule commit 18c7a8e26fa78075d0f840526d0b830103c6072f
Use (l)ocal or (r)emote, (s)uggested, or (a)bort?
ˋˋˋ

Typing `s` would execute this command, basically:

ˋˋˋ
git update-index --cacheinfo 160000
18c7a8e26fa78075d0f840526d0b830103c6072f "Core"
ˋˋˋ

My reason for recommending this is that there's no real convenient way
to accept the suggested resolution for the submodule. The only real
feasible way to use the suggestiong is to copy & paste the whole line
in the terminal, which is clunky.

I'd love to hear from the community to see what you all think about
this idea. Thanks for reading.

```
