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