chiark / gitweb /
wip topbloke-merge-lists
[topbloke.git] / topbloke-merge-driver
1 #!/bin/sh
2 set -e
3
4 fail () { echo >&2 "$0: $*"; exit 127; }
5
6 case "$1" in
7 --v1) on=tip ;;
8 --base-v1) on=base ;;
9 *) fail "bad usage" ;;
10 esac
11
12 whichfile=$1
13 ancestor=$2
14 current=$3
15 other=$4
16 markersize=$5
17
18 case $on.$whichfile in
19 tip.msg)
20         exec git-merge-file --marker-size=$markersize \
21                 "$current" "$ancestor" "$other"
22         ;;
23 base.msg|base.deps)
24         echo '# not applicable' >"$current"
25         exit 0
26         ;;
27 *.included|tip.deps|tip.flags)
28         exec topbloke-merge-lists "$current" "$ancestor" "$other"
29         ;;
30 base.flags)
31         exec topbloke-merge-lists -UDeleted \
32                 "$current" "$ancestor" "$other"
33         ;;
34 *)
35         fail "huh $on $whichfile ?"
36         ;;
37 esac