@matheusbsbs / matheus-bagliano / commits / f5d3a6f575
Fork 0

merge script: forbid merge -s index

Some git-merge-* commands are not merge strategies. This is based on v1.6.1-rc1~294^2~7 (builtin-merge: allow using a custom strategy, 2008-07-30) but it is less smart: we just use a hard-coded list of forbidden strategy names. It is okay if this falls out of date, since the code is just an example. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Aug 17, 2010 at 02:06 UTC f5d3a6f575b12af88561ad5a3b1fc8f866f49056
1 file changed +5
contrib/examples/git-merge.sh
+5
@@ -36,6 +36,7 @@ LF='
36
37 all_strategies='recur recursive octopus resolve stupid ours subtree'
38 all_strategies="$all_strategies recursive-ours recursive-theirs"
39 +not_strategies='base file index tree'
40 default_twohead_strategies='recursive'
41 default_octopus_strategies='octopus'
42 no_fast_forward_strategies='subtree ours'
@@ -196,6 +197,10 @@ parse_config () {
197 use_strategies="$use_strategies$1 "
198 ;;
199 *)
200 + case " $not_strategies " in
201 + *" $1 "*)
202 + false
203 + esac &&
204 type "git-merge-$1" >/dev/null 2>&1 ||
205 die "available strategies are: $all_strategies"
206 use_strategies="$use_strategies$1 "