Our repository contains multiple files that are source code and one file that is a build artefact (compiled apiary blueprint for example).
There is a build script I can configure as merge driver for this file, but it fails if the source is not yet merged (or at least it builds from the merge state, which is not correct). Is there a way to tell git in what order it should try to merge files? There is a
Update October 2016, for Git 2.11+ (Q4 2016)
There is a
git-diff, but that does not seem to be applied to
There is now, but for
See commit 654311b (08 Oct 2016), and commit 57937f7, commit 08221e3, commit 8827b3a (07 Oct 2016) by David Aguilar (
Helped-by: Johannes Sixt (
(Merged by Junio C Hamano --
gitster -- in commit 5b4c45a, 17 Oct 2016)
mergetoolto pass "
-O<orderfile>" down to
git diffwhen specified on the command-line.
git mergetool man page now includes:
Process files in the order specified in the
<orderfile>, which has one shell glob pattern per line.
This overrides the
Original answer August 2015
It seems the issue comes from the modifications done to the merge driver script, in addition of modifications to other files.
When you are merging your branch, the merge driver script isn't yet merged itself.
Why not update your merge driver script in a separate, dedicated branch, and merge that branch first.
Then merge your dev branch second.
Turns out it's really as simple a creating a custom merge wrapper, leaving the build artefact as
The wrapper runs
git merge, and if there are no other unresolved files other than the artefact, run the build script.