I've seen https://stackoverflow.com/a/49215221/962918 which gets close to half of what I'm wanting, with git rebase --show-current-patch
. Like that question, I'm interactively rebasing my current HEAD branch onto one of the commits in it's history to clean them up (aka, sort into logical steps) before publishing them publicly. Often times, merge conflicts happen as the interactive rebase runs.
In my current mental model, the goal of resolving these rebase conflicts is to generate the resulting end state of applying the changes (aka, patch/diff) of each of the two commits rebase is trying to combine. This is different than a standard merge conflict, where the end goal is to generate an end state that is a harmonization (combination) of the end state of two commits at the tips of the branches you are merging.
Because this is a rebase, the changes (diff/patch) from these commits are being applied to a different starting state then they originally were. I get that this could cause trouble that may need manual resolution. (For example, what if the function the patch is trying to change has been deleted?)
If the goal is to apply two sets of changes, then visualizing them seems useful to solving a rebase conflict. I am aware of the git difftool
and git mergetool
commands, and really appreciate Meld's display of differences. How can I get Git to show me these two sets of changes, with the full context of the before and after contents of the files with git difftool
? git rebase --show-current-patch
seems to get me one set of changes, but not in Meld. And how do I have the other set of changes displayed in Meld (or whatever the preferred diff (or merge) tool is? Bonus points if I can get a 3rd file passed to Meld so I can edit/create the "merged" version from Meld.