git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Feature Suggestion: Conflict resolution for submodules
@ 2019-09-06 13:38 Robert Dailey
  0 siblings, 0 replies; only message in thread
From: Robert Dailey @ 2019-09-06 13:38 UTC (permalink / raw)
  To: Git

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-06 13:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 13:38 Feature Suggestion: Conflict resolution for submodules Robert Dailey

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).