git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Dailey <rcdailey.lists@gmail.com>
To: Git <git@vger.kernel.org>
Subject: Feature Suggestion: Conflict resolution for submodules
Date: Fri, 6 Sep 2019 08:38:36 -0500	[thread overview]
Message-ID: <CAHd499D+yjZiASCC4Kxw--dCY9hboQCzkgMFiy3PaqaN2qZC3A@mail.gmail.com> (raw)

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.

                 reply	other threads:[~2019-09-06 13:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHd499D+yjZiASCC4Kxw--dCY9hboQCzkgMFiy3PaqaN2qZC3A@mail.gmail.com \
    --to=rcdailey.lists@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).