Well, a merge (sans the recursive part of the strategy for dealing with criss-cross merge) is just patching the local tree with diff from most recent common ancestor to the remote one.
There is a command to get the merge base, git merge-base
, but git diff
is even able to call it on it's own if you use the ...
(3 instead of 2 dots) operator.
So the merge is:
git diff HEAD...MOODLE_23_STABLE_workshop -- mod/workshop/ | git apply -3
and than you commit it.
You probably shouldn't try recording MOODLE_23_STABLE_workshop
as base, because it really isn't. If you did, next merge would assume you merged all changes and explicitly reverted the ones outside mod/workshop/
. On the other hand if you don't record the parent, next merge will try to re-apply the changes, causing unnecessary conflicts if the same areas are modified again as git is smart enough to recognize already applied diff, but can't tell when the diff obsoletes other changes.