I have a project with two branches:
D---E branch1
/
---A---C branch2
I want to apply commit E (but not D) on top of branch2.
I used git cherry-pick and git mergetool (with meld) for resolving conflicts. So far, so good.
However, suppose that the state of the file after commit C is
lineC1
<context C>
lineC2
and the change introduced by commit E is
-lineC1
+lineE1
<context E>
-lineC2
+lineE2
I would expect the result shown by default by the mergetool to be
lineE1
<context C>
lineE2
(i.e., lines E1 and E2 changed according to commit E but internal context kept from the current branch).
Instead, the mergetool (i.e., meld) by default shows:
lineC1
<context E>
lineC2
which really makes no sense.
How can I instruct git cherry-pick to keep the context from branch2 and only consider changes to the lines modified by commit E ?