Skip to content

Commit

Permalink
merge script: forbid merge -s index
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Aug 18, 2010
1 parent e69dccf commit f5d3a6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/examples/git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LF='

all_strategies='recur recursive octopus resolve stupid ours subtree'
all_strategies="$all_strategies recursive-ours recursive-theirs"
not_strategies='base file index tree'
default_twohead_strategies='recursive'
default_octopus_strategies='octopus'
no_fast_forward_strategies='subtree ours'
Expand Down Expand Up @@ -196,6 +197,10 @@ parse_config () {
use_strategies="$use_strategies$1 "
;;
*)
case " $not_strategies " in
*" $1 "*)
false
esac &&
type "git-merge-$1" >/dev/null 2>&1 ||
die "available strategies are: $all_strategies"
use_strategies="$use_strategies$1 "
Expand Down

0 comments on commit f5d3a6f

Please sign in to comment.