aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-07-09 00:42:26 -0700
committerJunio C Hamano <junkio@cox.net>2006-07-13 23:10:19 -0700
commit06d30f4f3eea71bce4cf48db3ea384976b3983b7 (patch)
treef3b1d0ba712cc976dba5bc1d7d9dc5f104d81bee
parent6d297f81373e19d86b8f02cb68120201d1b0ab1d (diff)
downloadgit-06d30f4f3eea71bce4cf48db3ea384976b3983b7.tar.gz
git-06d30f4f3eea71bce4cf48db3ea384976b3983b7.tar.xz
recur vs recursive: help testing without touching too many stuff.
During git-merge-recur development, you could set an environment variable GIT_USE_RECUR_FOR_RECURSIVE to use WIP recur in place of the recursive strategy. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xTEST18
-rwxr-xr-xgit-merge.sh13
-rwxr-xr-xgit-rebase.sh15
-rwxr-xr-xt/t3402-rebase-merge.sh2
4 files changed, 36 insertions, 12 deletions
diff --git a/TEST b/TEST
index d53098347..7286e2a54 100755
--- a/TEST
+++ b/TEST
@@ -1,10 +1,14 @@
#!/bin/sh -x
+
cd t || exit
-./t3400-rebase.sh "$@" && \
-./t6020-merge-df.sh "$@" && \
-./t3401-rebase-partial.sh "$@" && \
-./t6021-merge-criss-cross.sh "$@" && \
-./t3402-rebase-merge.sh "$@" && \
-./t6022-merge-rename.sh "$@" && \
-./t6010-merge-base.sh "$@" && \
+GIT_USE_RECUR_FOR_RECURSIVE=LetsTryIt
+export GIT_USE_RECUR_FOR_RECURSIVE
+
+./t3400-rebase.sh "$@" &&
+./t6020-merge-df.sh "$@" &&
+./t3401-rebase-partial.sh "$@" &&
+./t6021-merge-criss-cross.sh "$@" &&
+./t3402-rebase-merge.sh "$@" &&
+./t6022-merge-rename.sh "$@" &&
+./t6010-merge-base.sh "$@" &&
:
diff --git a/git-merge.sh b/git-merge.sh
index b26ca147c..9b681159d 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -9,8 +9,13 @@ USAGE='[-n] [--no-commit] [--squash] [-s <strategy>]... <merge-message> <head> <
LF='
'
-all_strategies='recur recur octopus resolve stupid ours'
-default_twohead_strategies='recur'
+all_strategies='recursive recur octopus resolve stupid ours'
+case "${GIT_USE_RECUR_FOR_RECURSIVE}" in
+'')
+ default_twohead_strategies=recursive ;;
+?*)
+ default_twohead_strategies=recur ;;
+esac
default_octopus_strategies='octopus'
no_trivial_merge_strategies='ours'
use_strategies=
@@ -110,6 +115,10 @@ do
strategy="$2"
shift ;;
esac
+ case "$strategy,${GIT_USE_RECUR_FOR_RECURSIVE}" in
+ recursive,?*)
+ strategy=recur ;;
+ esac
case " $all_strategies " in
*" $strategy "*)
use_strategies="$use_strategies$strategy " ;;
diff --git a/git-rebase.sh b/git-rebase.sh
index 2a4c8c8a8..8c5da7219 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -35,7 +35,13 @@ If you would prefer to skip this patch, instead run \"git rebase --skip\".
To restore the original branch and stop rebasing run \"git rebase --abort\".
"
unset newbase
-strategy=recur
+case "${GIT_USE_RECUR_FOR_RECURSIVE}" in
+'')
+ strategy=recursive ;;
+?*)
+ strategy=recur ;;
+esac
+
do_merge=
dotest=$GIT_DIR/.dotest-merge
prec=4
@@ -198,6 +204,11 @@ do
shift
done
+case "$strategy,${GIT_USE_RECUR_FOR_RECURSIVE}" in
+recursive,?*)
+ strategy=recur ;;
+esac
+
# Make sure we do not have .dotest
if test -z "$do_merge"
then
@@ -292,7 +303,7 @@ then
exit $?
fi
-if test "@@NO_PYTHON@@" && test "$strategy" = "recur"
+if test "@@NO_PYTHON@@" && test "$strategy" = "recursive"
then
die 'The recursive merge strategy currently relies on Python,
which this installation of git was not configured with. Please consider
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index b70e177dd..d34c6cf6f 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -51,7 +51,7 @@ test_expect_success setup '
'
test_expect_success 'reference merge' '
- git merge -s recur "reference merge" HEAD master
+ git merge -s recursive "reference merge" HEAD master
'
test_expect_success rebase '