--- /dev/null
+#!/bin/sh
+set -e
+
+fail () { echo >&2 "$0: $*"; exit 127; }
+
+case "$1" in
+--v1) on=tip ;;
+--base-v1) on=base ;;
+*) fail "bad usage" ;;
+esac
+
+whichfile=$1
+ancestor=$2
+current=$3
+other=$4
+markersize=$5
+
+case $on.$whichfile in
+tip.msg)
+ exec git-merge-file --marker-size=$markersize \
+ "$current" "$ancestor" "$other"
+ ;;
+base.msg|base.deps)
+ echo '# not applicable' >"$current"
+ exit 0
+ ;;
+*.included|tip.deps|tip.flags)
+ exec topbloke-merge-lists "$current" "$ancestor" "$other"
+ ;;
+base.flags)
+ exec topbloke-merge-lists -UDeleted \
+ "$current" "$ancestor" "$other"
+ ;;
+*)
+ fail "huh $on $whichfile ?"
+ ;;
+esac