Imagine I have a master repository and some forked repositories. In a forked repo, some changes have been made quite a while ago. There is one commit in particular that I want to cherry-pick onto master. Imagine the original file (that the repo based off on) had this structure:
<div class="foo">
Text1
</div>
<div class="foo">
Text2
</div>
Meanwhile, master has evolved to this:
<div class="foo bar">
Text1
</div>
<div class="foo bar">
Text2
</div>
The relevant commit I want to cherry-pick however contains:
<div class="foo">
Text1
</div>
<div class="foo">
Changed Text2
</div>
When I run cherry-pick I get (expectedly) the message that there's a merge conflict. The merge conflict is tiny, only the two relevant lines:
<<<<<<< HEAD
<div class="foo bar">
Text2
=======
<div class="foo">
Changed Text2
>>>>>>> abababab Text
I want to make my life easier and use git mergetool
to fix this issue. To my surprise, instead of showing only the relevant, tiny change, git mergetool
however highlights every single instance where
<div class="foo">
was change to:
<div class="foo bar">
I.e., while the actual diff contained in the conflicted file is tiny, git mergetool
is cluttered with hundreds of bogus diffs (well, it's not wrong, but it's also irrelevant) which make its use impossible. I'm using meld for diffing if that makes a difference. How do I get mergetool only to display the conflict that is contained in the actual conflicted file instead of trying to three-way merge with the common ancestor?