chiark / gitweb /
remove spurious debug; fixes
[topbloke.git] / topbloke-merge-driver
1 #!/bin/sh
2 set -e
3
4 xxx new theory, new metadata, not yet done here
5
6 fail () { echo >&2 "$0: $*"; exit 127; }
7
8 case "$1" in
9 --v1) how=same ;;               # merge into tip from another tip of this patch
10                                 #  or into base from another base of this patch
11 --v1-base) how=base ;;          # merge into tip from a base of this patch
12 --v1-dep) how=dep ;;            # merge into base from a dep's tip
13 *) fail "bad usage" ;;
14 esac
15
16 whichfile=$1
17 ancestor=$2
18 ours=$3
19 theirs=$4
20 markersize=$5
21
22 set -- "$ours" "$ancestor" "$theirs"
23
24 case $on.$whichfile in
25 dep.msg|dep.deps|dep.props)
26         touch "$ours"
27         ;;
28 base.msg)
29         echo '# not applicable' >"$ours"
30 base.deps)
31         echo >"$ours"
32         touch >"$ours"
33         ;;
34 base.props)
35         exec topbloke-merge-lists -M$markersize -P -UDeleted "$@"
36         ;;
37 same.msg)
38         exec git-merge-file --marker-size=$markersize "$@"
39         ;;
40 same.deps|*.included)
41         exec topbloke-merge-lists -M$markersize "$@"
42         ;;
43 same.props|*.pprops)
44         exec topbloke-merge-lists -M$markersize -P "$@"
45         ;;
46 *)
47         fail "huh $on $whichfile ?"
48         ;;
49 esac