#!/bin/sh
set -e
+xxx new theory, new metadata, not yet done here
+
fail () { echo >&2 "$0: $*"; exit 127; }
case "$1" in
---v1) on=tip ;;
---base-v1) on=base ;;
+--v1) how=same ;; # merge into tip from another tip of this patch
+ # or into base from another base of this patch
+--v1-base) how=base ;; # merge into tip from a base of this patch
+--v1-dep) how=dep ;; # merge into base from a dep's tip
*) fail "bad usage" ;;
esac
whichfile=$1
ancestor=$2
-current=$3
-other=$4
+ours=$3
+theirs=$4
markersize=$5
+set -- "$ours" "$ancestor" "$theirs"
+
case $on.$whichfile in
-tip.msg)
- exec git-merge-file --marker-size=$markersize \
- "$current" "$ancestor" "$other"
+dep.msg|dep.deps|dep.props)
+ touch "$ours"
+ ;;
+base.msg)
+ echo '# not applicable' >"$ours"
+base.deps)
+ echo >"$ours"
+ touch >"$ours"
+ ;;
+base.props)
+ exec topbloke-merge-lists -M$markersize -P -UDeleted "$@"
;;
-base.msg|base.deps)
- echo '# not applicable' >"$current"
- exit 0
+same.msg)
+ exec git-merge-file --marker-size=$markersize "$@"
;;
-*.included|tip.deps|tip.flags)
- exec topbloke-merge-lists "$current" "$ancestor" "$other"
+same.deps|*.included)
+ exec topbloke-merge-lists -M$markersize "$@"
;;
-base.flags)
- exec topbloke-merge-lists -UDeleted \
- "$current" "$ancestor" "$other"
+same.props|*.pprops)
+ exec topbloke-merge-lists -M$markersize -P "$@"
;;
*)
fail "huh $on $whichfile ?"