-
Notifications
You must be signed in to change notification settings - Fork 126
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
Is it possible to redo parts of an iterative merge? #188
Comments
There's no automation around that. Part of what would be required is to remove some of To be clear, if this works, it would put you back in the state when the erroneous merge was done. Any merges done after that would have to be re-done. It might be possible to salvage some of the later merges, but that would be a significantly more complicated project. If you don't want to muddle around with Let us know if this works out! |
First of all, thank you very much for your reply! I am currently not having the problem – in my case, I was just trying git-imerge with a very small set of commits and ended up just doing a normal merge with editing undetectably conflicting lines (it was only one...) manually at the end. But I am curious on how to solve such a problem. =)
I have to admit that I do not understand what you are suggesting – so when I have found the "bad" merge commit by bisecting, I just rerun the (This is a minimal undetectable conflict example I wrote for testing right now – a few people at a party; after the merge of the log lines we see that Adam is drinking wine despite Caesar having drunk all of it earlier: https://gist.github.com/BowiFromStackOverflow/5575fd41cf8944b72557083f359914ae) |
For concreteness, let's suppose that you are merging
At some point during this imerge, or even after you've completed the imerge but before you run At this point you can run bisect between You could now start a new incremental merge with the same initial arguments:
It should present the exact same manual merges to you, in the same order. So for example if it asks you to do merge
(I think that's the right command). Then run your tests to see if the merge results in your problem. If so, fix it before running This will always work if you used This could work better if git-imerge were taught to check not only whether a sub-merge completes without conflicts, but also runs a user-specified test against it before considering it a success. This would allow |
That's right so far (even if I used
Here we're diverging: It happened in one of the automatic sub-merges (like in my example in the gist, there is no detectable conflict at all).
Oh, now I think I understand it! Unfortunately, it is a conflict that does not cause git-imerge to stop, so I cannot do that while running the incremental merge.
What is
That indeed would be great! Even if there was no way of detecting the error automatically, one could do it like this:
Or do you have another opinion on that? Of course, on the long hand, it would be even greater to have a feature that "rolls back" to a specific incremental merge commit like it was in conflict and discards all commits affected by that – but I think, it would be very much effort.
I hope it didn't get lost in a merge conflict. ;-) |
This is more a question than an "issue". I've posted the very same question on StackOverflow already, hoping for it to just be me being unable to find the information in git-imerge documentation and got a "I do not think there is an easy way to achieve it!" comment.
The internet tells me about
git-imerge
:But how can I do that?
To start the operation of eg. merging branch
newFeature
tomaster
, I would useAnd then resolve all the conflicts that imerge finds by itself. After finishing, I see that somewhere a bug has been inserted. I search for it using
But when I have found the merge commit that did introduce the problem – how can I redo that merge and continue the incremental merge from there?
The text was updated successfully, but these errors were encountered: