Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip incompatible merges #171

Open
NZJenkins opened this issue Sep 30, 2020 · 1 comment
Open

Skip incompatible merges #171

NZJenkins opened this issue Sep 30, 2020 · 1 comment

Comments

@NZJenkins
Copy link

Suppose I have two commits that don't merge easily
Is it possible to skip the difficult merge and continue merging elsewhere?

The complete merge might look like the diagram below

   A  B  C
X  .  .  ?
Y  #  *  ?
Z  ?  .  .

* = merge done manually
. = merge done automatically
# = conflict that is currently blocking progress
? = no merge recorded

Merging branch with commits A, B, C and branch with commits X, Y, Z

  • User skips A, Y
  • B, Y is manually merged via B, X
  • And merging continues
@mhagger
Copy link
Owner

mhagger commented Oct 2, 2020

That wouldn't be in the spirit of the incremental merge, so it would complicate the idea quite a bit:

  • In your example, you wouldn't have merge A-Y, so what would be the parents of B-Y? I suppose you could merge B and Y directly, but then what? Would you come back to A-Y later, or hope to avoid it altogether?

  • Normally, if A-Y is difficult to resolve, then merging B and Y directly to produce B-Y will be, too (though this might not be the case if, say, commit B reverts part or all of commit A).

  • What if, later, A-Z turns out to conflict? If you've never done A-Y, then what first parent would you use for the A-Z merge? And again, if A-Y is difficult to resolve, then going directly to A-Z probably will be, too.

There are cases when it would be more plausible to skip around. Say there are two blocking merges, like in the following diagram:

       0    5   9
       |    |   |
   0 - ********** - c
       **?..*.--+
       *.?.*.|#??
       *.?...|???
       *.?..-+???
   5 - *...|#????
       **?.|?????
       *.?.|?????
   8 - *---+?????
       |
     d

In this case, imerge might ask you to resolve merge 5-5, but you might not know how. Meanwhile, you might know how to resolve merge 7-2. There is no theoretical reason that you shouldn't be able to do those two merges in either order.

In fact, you could do it, too. But you'd have to set up the merge yourself, by checking out branch refs/heads/imerge/NAME, resetting it to refs/imerge/NAME/auto/7-1, then running git merge refs/imerge/NAME/auto/6-2, stage your changes, and then run git imerge recordorgit imerge continue`. It wouldn't be too hard to automate this setup step (though I don't have plans to work on it anytime soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants