summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-02-18 13:01:18 +0100
committerJunio C Hamano <junkio@cox.net>2006-02-18 23:16:09 -0800
commitabb7c7b31c0896bd838bbb6437b310db5a42227a (patch)
treeca184974f14d8cd61e1a7c25173edcae17c9e7cb
parent289c4b36e336af5266b86d924ef0aa828e8e4841 (diff)
downloadgit-abb7c7b31c0896bd838bbb6437b310db5a42227a.tar.gz
Optionally work without python
In some setups (notably server setups) you do not need that dependency. Gracefully handle the absence of python when NO_PYTHON is defined. Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--Makefile9
-rwxr-xr-xgit-merge.sh4
-rw-r--r--t/Makefile4
-rwxr-xr-xt/t0000-basic.sh2
-rwxr-xr-xt/t6021-merge-criss-cross.sh6
-rwxr-xr-xt/t6022-merge-rename.sh6
-rwxr-xr-xt/test-lib.sh2
7 files changed, 32 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1d3a0a47aa..c8ee4a4296 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,8 @@ all:
# Define NO_ACCURATE_DIFF if your diff program at least sometimes misses
# a missing newline at the end of the file.
#
+# Define NO_PYTHON if you want to loose all benefits of the recursive merge.
+#
# Define COLLISION_CHECK below if you believe that SHA1's
# 1461501637330902918203684832716283019655932542976 hashes do not give you
# sufficient guarantee that no collisions between objects will ever happen.
@@ -442,6 +444,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
+ -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \
$@.sh >$@
chmod +x $@
@@ -521,6 +524,12 @@ doc:
### Testing rules
+# GNU make supports exporting all variables by "export" without parameters.
+# However, the environment gets quite big, and some programs have problems
+# with that.
+
+export NO_PYTHON
+
test: all
$(MAKE) -C t/ all
diff --git a/git-merge.sh b/git-merge.sh
index 74f07610fa..a05eeb29f6 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -13,6 +13,10 @@ LF='
all_strategies='recursive octopus resolve stupid ours'
default_strategies='recursive'
use_strategies=
+if test "@@NO_PYTHON@@"; then
+ all_strategies='resolve octopus stupid ours'
+ default_strategies='resolve'
+fi
dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
diff --git a/t/Makefile b/t/Makefile
index 5c5a620126..ba6ddbec97 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -15,6 +15,10 @@ shellquote = '$(call shq,$(1))'
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
+ifdef NO_PYTHON
+ GIT_TEST_OPTS += --no-python
+endif
+
all: $(T) clean
$(T):
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index c339a366f4..6729a18266 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -42,7 +42,7 @@ fi
. ./test-lib.sh
-"$PYTHON" -c 'import subprocess' || {
+test "$no_python" || "$PYTHON" -c 'import subprocess' || {
echo >&2 'Your python seem to lack "subprocess" module.
Please check INSTALL document.'
exit 1
diff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh
index e8606c751d..262381379f 100755
--- a/t/t6021-merge-criss-cross.sh
+++ b/t/t6021-merge-criss-cross.sh
@@ -10,6 +10,12 @@
test_description='Test criss-cross merge'
. ./test-lib.sh
+if test "$no_python"; then
+ echo "Skipping: no python => no recursive merge"
+ test_done
+ exit 0
+fi
+
test_expect_success 'prepare repository' \
'echo "1
2
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh
index 1292cafd7f..a2d24b5ca9 100755
--- a/t/t6022-merge-rename.sh
+++ b/t/t6022-merge-rename.sh
@@ -3,6 +3,12 @@
test_description='Merge-recursive merging renames'
. ./test-lib.sh
+if test "$no_python"; then
+ echo "Skipping: no python => no recursive merge"
+ test_done
+ exit 0
+fi
+
test_expect_success setup \
'
cat >A <<\EOF &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7a58a86f96..43c8e55a8b 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -63,6 +63,8 @@ do
exit 0 ;;
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
verbose=t; shift ;;
+ --no-python)
+ no_python=t; shift ;;
*)
break ;;
esac