{"thread":{"id":"3371","subject":"[PATCH 5/5] Optionally work without python","startedAt":"2006-02-17T14:24:16Z","lastAt":"2006-02-18T12:01:18Z","messageCount":4,"participants":["Johannes Schindelin","Radoslaw Szkodzinski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"16321","messageId":"Pine.LNX.4.63.0602171523510.24274@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3371","inReplyTo":null,"subject":"[PATCH 5/5] Optionally work without python","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-02-17T14:24:16Z","receivedAt":"2006-02-17T14:24:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nIn some setups (notably server setups) you do not need that dependency.\nGracefully handle the absence of python when NO_PYTHON is defined.\n\nSigned-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n Makefile                     |    8 +++++++-\n git-merge.sh                 |    6 +++++-\n t/Makefile                   |    5 +++++\n t/t0000-basic.sh             |    2 ++\n t/t6021-merge-criss-cross.sh |    6 ++++++\n t/t6022-merge-rename.sh      |    6 ++++++\n t/test-lib.sh                |    2 ++\n 7 files changed, 33 insertions(+), 2 deletions(-)\n\naa0aef85a93da00f3afbbed9105b45ad41b8427c\ndiff --git a/Makefile b/Makefile\nindex 7e1990b..1ee61e6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -58,6 +58,8 @@ all:\n # Define NO_ACCURATE_DIFF if your diff program at least sometimes misses\n # a missing newline at the end of the file.\n #\n+# Define NO_PYTHON if you want to loose all benefits of the recursive merge.\n+#\n # Define COLLISION_CHECK below if you believe that SHA1's\n # 1461501637330902918203684832716283019655932542976 hashes do not give you\n # sufficient guarantee that no collisions between objects will ever happen.\n@@ -422,6 +424,9 @@ endif\n ifdef NO_ACCURATE_DIFF\n \tALL_CFLAGS += -DNO_ACCURATE_DIFF\n endif\n+ifdef NO_PYTHON\n+\tTEST_DEFS += NO_PYTHON=YesPlease\n+endif\n \n # Shell quote (do not use $(call) to accomodate ancient setups);\n \n@@ -462,6 +467,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_QUOTED)|' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n+\t    -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \\\n \t    $@.sh >$@\n \tchmod +x $@\n \n@@ -552,7 +558,7 @@ doc:\n ### Testing rules\n \n test: all\n-\t$(MAKE) -C t/ all\n+\t$(MAKE) -C t/ all $(TEST_DEFS)\n \n test-date$X: test-date.c date.o ctype.o\n \t$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) test-date.c date.o ctype.o\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 74f0761..c0f53df 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -11,7 +11,11 @@ LF='\n '\n \n all_strategies='recursive octopus resolve stupid ours'\n-default_strategies='recursive'\n+if test -z \"@@NO_PYTHON@@\"; then\n+\tdefault_strategies='recursive'\n+else\n+\tdefault_strategies='resolve'\n+fi\n use_strategies=\n \n dropsave() {\ndiff --git a/t/Makefile b/t/Makefile\nindex d78404f..12e2c16 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -12,9 +12,14 @@ SHELL_PATH_QUOTED = '$(subst ','\\'',$(SH\n \n T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)\n \n+ifdef NO_PYTHON\n+\tGIT_TEST_OPTS += --no-python\n+endif\n+\n all: $(T) clean\n \n $(T):\n+\techo $(SHELL_PATH_QUOTED) $@ $(GIT_TEST_OPTS)\n \t@echo \"*** $@ ***\"; $(SHELL_PATH_QUOTED) $@ $(GIT_TEST_OPTS)\n \n clean:\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex c339a36..fe7f448 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -42,11 +42,13 @@ fi\n \n . ./test-lib.sh\n \n+if test -z \"$no_python\"; then\n \"$PYTHON\" -c 'import subprocess' || {\n \techo >&2 'Your python seem to lack \"subprocess\" module.\n Please check INSTALL document.'\n \texit 1\n }\n+fi\n \n ################################################################\n # init-db has been done in an empty repository.\ndiff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh\nindex e8606c7..2623813 100755\n--- a/t/t6021-merge-criss-cross.sh\n+++ b/t/t6021-merge-criss-cross.sh\n@@ -10,6 +10,12 @@\n test_description='Test criss-cross merge'\n . ./test-lib.sh\n \n+if test \"$no_python\"; then\n+\techo \"Skipping: no python => no recursive merge\"\n+\ttest_done\n+\texit 0\n+fi\n+\n test_expect_success 'prepare repository' \\\n 'echo \"1\n 2\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex 1292caf..a2d24b5 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -3,6 +3,12 @@\n test_description='Merge-recursive merging renames'\n . ./test-lib.sh\n \n+if test \"$no_python\"; then\n+\techo \"Skipping: no python => no recursive merge\"\n+\ttest_done\n+\texit 0\n+fi\n+\n test_expect_success setup \\\n '\n cat >A <<\\EOF &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7a58a86..43c8e55 100755\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -63,6 +63,8 @@ do\n \t\texit 0 ;;\n \t-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)\n \t\tverbose=t; shift ;;\n+\t--no-python)\n+\t\tno_python=t; shift ;;\n \t*)\n \t\tbreak ;;\n \tesac\n-- \n1.2.1.g09fe-dirty\n"},{"id":"16337","messageId":"43F63B05.4030405@gorzow.mm.pl","threadId":"3371","inReplyTo":"Pine.LNX.4.63.0602171523510.24274@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 5/5] Optionally work without python","fromName":"Radoslaw Szkodzinski","fromEmail":"astralstorm@gorzow.mm.pl","sentAt":"2006-02-17T21:07:17Z","receivedAt":"2006-02-17T21:07:17Z","isPatch":true,"sender":{"key":"astralstorm@gorzow.mm.pl","avatar":null},"body":"Johannes Schindelin wrote:\n> In some setups (notably server setups) you do not need that dependency.\n> Gracefully handle the absence of python when NO_PYTHON is defined.\n>\n\n> +# Define NO_PYTHON if you want to loose all benefits of the recursive merge.\n\nlose\n\n> --- a/git-merge.sh\n> +++ b/git-merge.sh\n> @@ -11,7 +11,11 @@ LF='\n>  '\n>\n>  all_strategies='recursive octopus resolve stupid ours'\n\nMaybe use this:\n\ndefault_strategies='recursive'\nif test -n \"@@NO_PYTHON@@\"; then\n\tdefault_strategies='resolve'\nfi\n\n-- \nGPG Key id:  0xD1F10BA2\nFingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2\n\nAstralStorm\n\n"},{"id":"16366","messageId":"7vvevdtb2j.fsf@assigned-by-dhcp.cox.net","threadId":"3371","inReplyTo":"Pine.LNX.4.63.0602171523510.24274@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 5/5] Optionally work without python","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-18T06:50:28Z","receivedAt":"2006-02-18T06:50:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> In some setups (notably server setups) you do not need that dependency.\n> Gracefully handle the absence of python when NO_PYTHON is defined.\n\n> +ifdef NO_PYTHON\n> +\tTEST_DEFS += NO_PYTHON=YesPlease\n> +endif\n\nI wonder if there is a better way to do this.  All future\nNO_BLAH that may affect tests need to have something like this\notherwise.\n\n> -default_strategies='recursive'\n> +if test -z \"@@NO_PYTHON@@\"; then\n> +\tdefault_strategies='recursive'\n> +else\n> +\tdefault_strategies='resolve'\n> +fi\n\nSomebody commented on this part to make it shorter...\n\nI'll take 2, 3, and 4 from this series for now.  They will\nappear in \"next\".  Thanks.\n"},{"id":"16381","messageId":"Pine.LNX.4.63.0602181257330.2993@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3371","inReplyTo":"7vvevdtb2j.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH 5/5] Optionally work without python","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-02-18T12:01:18Z","receivedAt":"2006-02-18T12:01:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nIn some setups (notably server setups) you do not need that dependency.\nGracefully handle the absence of python when NO_PYTHON is defined.\n\nSigned-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tOn Fri, 17 Feb 2006, Junio C Hamano wrote:\n\n\t> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\t> \n\t> > +ifdef NO_PYTHON\n\t> > +\tTEST_DEFS += NO_PYTHON=YesPlease\n\t> > +endif\n\t> \n\t> I wonder if there is a better way to do this.  All future\n\t> NO_BLAH that may affect tests need to have something like this\n\t> otherwise.\n\n\tThere is: Just an \"export\". This defines all variables in a \n\tsub-make. However, if you do that, the environment gets quite \n\tlarge, and some programs crash, notably xargs on the box I tested.\n\tSo, for now, use \"export NO_PYTHON\".\n\n\t> > -default_strategies='recursive'\n\t> > +if test -z \"@@NO_PYTHON@@\"; then\n\t> > +\tdefault_strategies='recursive'\n\t> > +else\n\t> > +\tdefault_strategies='resolve'\n\t> > +fi\n\t> \n\t> Somebody commented on this part to make it shorter...\n\n\tFixed.\n\n\t> I'll take 2, 3, and 4 from this series for now.  They will\n\t> appear in \"next\".  Thanks.\n\n\tThank you!\n\n Makefile                     |    9 +++++++++\n git-merge.sh                 |    4 ++++\n t/Makefile                   |    6 ++++\n t/t0000-basic.sh             |    2 +-\n t/t6021-merge-criss-cross.sh |    6 ++++++\n t/t6022-merge-rename.sh      |    6 ++++++\n t/test-lib.sh                |    2 ++\n 7 files changed, 32 insertions(+), 1 deletions(-)\n\nb7c435d3d594c9826e4297ee8b0353d27ef8c5b0\ndiff --git a/Makefile b/Makefile\nindex d59eede..685b714 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -58,6 +58,8 @@ all:\n # Define NO_ACCURATE_DIFF if your diff program at least sometimes misses\n # a missing newline at the end of the file.\n #\n+# Define NO_PYTHON if you want to loose all benefits of the recursive merge.\n+#\n # Define COLLISION_CHECK below if you believe that SHA1's\n # 1461501637330902918203684832716283019655932542976 hashes do not give you\n # sufficient guarantee that no collisions between objects will ever happen.\n@@ -460,6 +462,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_QUOTED)|' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n+\t    -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \\\n \t    $@.sh >$@\n \tchmod +x $@\n \n@@ -548,6 +551,12 @@ doc:\n \n \n ### Testing rules\n+\n+# GNU make supports exporting all variables by \"export\" without parameters.\n+# However, the environment gets quite big, and some programs have problems\n+# with that.\n+\n+export NO_PYTHON\n \n test: all\n \t$(MAKE) -C t/ all\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 74f0761..a05eeb2 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -13,6 +13,10 @@ LF='\n all_strategies='recursive octopus resolve stupid ours'\n default_strategies='recursive'\n use_strategies=\n+if test \"@@NO_PYTHON@@\"; then\n+\tall_strategies='resolve octopus stupid ours'\n+\tdefault_strategies='resolve'\n+fi\n \n dropsave() {\n \trm -f -- \"$GIT_DIR/MERGE_HEAD\" \"$GIT_DIR/MERGE_MSG\" \\\ndiff --git a/t/Makefile b/t/Makefile\nindex e7e4229..4e89d23 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -12,10 +12,14 @@ SHELL_PATH_QUOTED = $(subst ','\\'',$(SHE\n \n T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)\n \n+ifdef NO_PYTHON\n+\tGIT_TEST_OPTS += --no-python\n+endif\n+\n all: $(T) clean\n \n $(T):\n\t@echo \"*** $@ ***\"; '$(SHELL_PATH_QUOTED)' $@ $(GIT_TEST_OPTS)\n \n clean:\n \trm -fr trash\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex c339a36..6729a18 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -42,7 +42,7 @@ fi\n \n . ./test-lib.sh\n \n-\"$PYTHON\" -c 'import subprocess' || {\n+test \"$no_python\" || \"$PYTHON\" -c 'import subprocess' || {\n \techo >&2 'Your python seem to lack \"subprocess\" module.\n Please check INSTALL document.'\n \texit 1\ndiff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh\nindex e8606c7..2623813 100755\n--- a/t/t6021-merge-criss-cross.sh\n+++ b/t/t6021-merge-criss-cross.sh\n@@ -10,6 +10,12 @@\n test_description='Test criss-cross merge'\n . ./test-lib.sh\n \n+if test \"$no_python\"; then\n+\techo \"Skipping: no python => no recursive merge\"\n+\ttest_done\n+\texit 0\n+fi\n+\n test_expect_success 'prepare repository' \\\n 'echo \"1\n 2\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex 1292caf..a2d24b5 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -3,6 +3,12 @@\n test_description='Merge-recursive merging renames'\n . ./test-lib.sh\n \n+if test \"$no_python\"; then\n+\techo \"Skipping: no python => no recursive merge\"\n+\ttest_done\n+\texit 0\n+fi\n+\n test_expect_success setup \\\n '\n cat >A <<\\EOF &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7a58a86..43c8e55 100755\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -63,6 +63,8 @@ do\n \t\texit 0 ;;\n \t-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)\n \t\tverbose=t; shift ;;\n+\t--no-python)\n+\t\tno_python=t; shift ;;\n \t*)\n \t\tbreak ;;\n \tesac\n-- \n1.2.1.g05ee-dirty\n"}]}