Code

merge script: allow custom strategies
authorJonathan Nieder <jrnieder@gmail.com>
Tue, 17 Aug 2010 07:05:32 +0000 (02:05 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Aug 2010 21:02:04 +0000 (14:02 -0700)
The idea comes from v1.6.1-rc1~294^2~7 (builtin-merge: allow using a
custom strategy, 2008-07-30).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/examples/git-merge.sh

index 0d53735d6719dfcc37b8651c26acdef2172e3ee9..49d8265083d1740692bc650814ca9283ff190243 100755 (executable)
@@ -193,9 +193,13 @@ parse_config () {
                        shift
                        case " $all_strategies " in
                        *" $1 "*)
-                               use_strategies="$use_strategies$1 " ;;
+                               use_strategies="$use_strategies$1 "
+                               ;;
                        *)
-                               die "available strategies are: $all_strategies" ;;
+                               type "git-merge-$1" >/dev/null 2>&1 ||
+                                       die "available strategies are: $all_strategies"
+                               use_strategies="$use_strategies$1 "
+                               ;;
                        esac
                        ;;
                -X)