{"thread":{"id":"21791","subject":"[PATCH v2 1/6] t2300: use documented technique to invoke git-sh-setup","startedAt":"2009-11-30T06:19:25Z","lastAt":"2009-12-02T06:25:13Z","messageCount":14,"participants":["Matthew Ogilvie","Junio C Hamano","Jakub Narebski"],"isPatch":true,"patchVersion":2,"patchTotal":6},"messages":[{"id":"128718","messageId":"1259561971-25730-1-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":null,"subject":"[PATCH v2 0/6] Run test suite without dashed commands in PATH","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:25Z","receivedAt":"2009-11-30T06:19:25Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"This patch series runs the test suite without the dashed commands\nin the PATH.\n\nChanges since version 1:\n\n  - Added patch 3 that documents the pre-existing GIT_TEST_INSTALLED\n    feature.\n\n  - Rename what used to be \"test-bin\" directory as \"bin-wrappers\", to\n    more clearly describe what it is.\n\n  - Split off patch 6 (INSTALL documention) from patch\n    4 (was patch 3), describing how the bin-wrappers directory\n    is a very convenient way to manually test an uninstalled build.\n    I also reworded it a bit to mention the downsides.  Junio\n    doesn't seem to agree this is useful; splitting it off makes\n    it easy to leave it out.\n\nNot changed:\n\nThere was some discussion about not building the bin-wrappers directory\nunless you are actually running tests.  But I don't really think it\nis worth the additional complexity to manage this.  The \"make all\"\ntarget is already building several full-up binaries to support the\ntest suite (not just the small sed-ed scripts that this adds).  And any\nsuch solution would need to deal with parallel execution locking\nissues, as well as additional uglyness (either duplicating a list\nof bindir executables within test-lib.sh itself, or calling into a\nparent directory makefile that might already be running in\na grandparent process).\n\nMatthew Ogilvie (6):\n  t2300: use documented technique to invoke git-sh-setup\n  t3409 t4107 t7406: use dashless commands\n  t/README: Document GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH\n  build dashless \"bin-wrappers\" directory similar to installed bindir\n  run test suite without dashed git-commands in PATH\n  INSTALL: document a simpler way to run uninstalled builds\n\n .gitignore                         |    1 +\n INSTALL                            |   11 +++++++-\n Makefile                           |   49 ++++++++++++++++++++++++++---------\n t/README                           |   21 +++++++++++++++\n t/t2300-cd-to-toplevel.sh          |    2 +-\n t/t3409-rebase-preserve-merges.sh  |    6 ++--\n t/t4107-apply-ignore-whitespace.sh |   20 +++++++-------\n t/t7406-submodule-update.sh        |    4 +-\n t/test-lib.sh                      |   33 +++++++++++++++---------\n wrap-for-bin.sh                    |   15 +++++++++++\n 10 files changed, 120 insertions(+), 42 deletions(-)\n create mode 100644 wrap-for-bin.sh\n"},{"id":"128716","messageId":"1259561971-25730-2-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":"1259561971-25730-1-git-send-email-mmogilvi_git@miniinfo.net","subject":"[PATCH v2 1/6] t2300: use documented technique to invoke git-sh-setup","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:26Z","receivedAt":"2009-11-30T06:19:26Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"This is needed to allow the test suite to run against a standard\ninstall bin directory instead of GIT_EXEC_PATH.\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n t/t2300-cd-to-toplevel.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t2300-cd-to-toplevel.sh b/t/t2300-cd-to-toplevel.sh\nindex 3b01ad2..9965bc5 100755\n--- a/t/t2300-cd-to-toplevel.sh\n+++ b/t/t2300-cd-to-toplevel.sh\n@@ -8,7 +8,7 @@ test_cd_to_toplevel () {\n \ttest_expect_success $3 \"$2\" '\n \t\t(\n \t\t\tcd '\"'$1'\"' &&\n-\t\t\t. git-sh-setup &&\n+\t\t\t. \"$(git --exec-path)\"/git-sh-setup &&\n \t\t\tcd_to_toplevel &&\n \t\t\t[ \"$(pwd -P)\" = \"$TOPLEVEL\" ]\n \t\t)\n-- \n1.6.4.GIT\n"},{"id":"128721","messageId":"1259561971-25730-3-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":"1259561971-25730-2-git-send-email-mmogilvi_git@miniinfo.net","subject":"[PATCH v2 2/6] t3409 t4107 t7406: use dashless commands","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:27Z","receivedAt":"2009-11-30T06:19:27Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"This is needed to allow test suite to run against a standard\ninstall bin directory instead of GIT_EXEC_PATH.\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n t/t3409-rebase-preserve-merges.sh  |    6 +++---\n t/t4107-apply-ignore-whitespace.sh |   20 ++++++++++----------\n t/t7406-submodule-update.sh        |    4 ++--\n 3 files changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh\nindex 297d165..8f785e7 100755\n--- a/t/t3409-rebase-preserve-merges.sh\n+++ b/t/t3409-rebase-preserve-merges.sh\n@@ -32,14 +32,14 @@ export GIT_AUTHOR_EMAIL\n test_expect_success 'setup for merge-preserving rebase' \\\n \t'echo First > A &&\n \tgit add A &&\n-\tgit-commit -m \"Add A1\" &&\n+\tgit commit -m \"Add A1\" &&\n \tgit checkout -b topic &&\n \techo Second > B &&\n \tgit add B &&\n-\tgit-commit -m \"Add B1\" &&\n+\tgit commit -m \"Add B1\" &&\n \tgit checkout -f master &&\n \techo Third >> A &&\n-\tgit-commit -a -m \"Modify A2\" &&\n+\tgit commit -a -m \"Modify A2\" &&\n \n \tgit clone ./. clone1 &&\n \tcd clone1 &&\ndiff --git a/t/t4107-apply-ignore-whitespace.sh b/t/t4107-apply-ignore-whitespace.sh\nindex 484654d..b04fc8f 100755\n--- a/t/t4107-apply-ignore-whitespace.sh\n+++ b/t/t4107-apply-ignore-whitespace.sh\n@@ -136,37 +136,37 @@ void print_int(int num) {\n EOF\n \n test_expect_success 'file creation' '\n-\tgit-apply patch1.patch\n+\tgit apply patch1.patch\n '\n \n test_expect_success 'patch2 fails (retab)' '\n-\ttest_must_fail git-apply patch2.patch\n+\ttest_must_fail git apply patch2.patch\n '\n \n test_expect_success 'patch2 applies with --ignore-whitespace' '\n-\tgit-apply --ignore-whitespace patch2.patch\n+\tgit apply --ignore-whitespace patch2.patch\n '\n \n test_expect_success 'patch2 reverse applies with --ignore-space-change' '\n-\tgit-apply -R --ignore-space-change patch2.patch\n+\tgit apply -R --ignore-space-change patch2.patch\n '\n \n git config apply.ignorewhitespace change\n \n test_expect_success 'patch2 applies (apply.ignorewhitespace = change)' '\n-\tgit-apply patch2.patch\n+\tgit apply patch2.patch\n '\n \n test_expect_success 'patch3 fails (missing string at EOL)' '\n-\ttest_must_fail git-apply patch3.patch\n+\ttest_must_fail git apply patch3.patch\n '\n \n test_expect_success 'patch4 fails (missing EOL at EOF)' '\n-\ttest_must_fail git-apply patch4.patch\n+\ttest_must_fail git apply patch4.patch\n '\n \n test_expect_success 'patch5 applies (leading whitespace)' '\n-\tgit-apply patch5.patch\n+\tgit apply patch5.patch\n '\n \n test_expect_success 'patches do not mangle whitespace' '\n@@ -175,11 +175,11 @@ test_expect_success 'patches do not mangle whitespace' '\n \n test_expect_success 're-create file (with --ignore-whitespace)' '\n \trm -f main.c &&\n-\tgit-apply patch1.patch\n+\tgit apply patch1.patch\n '\n \n test_expect_success 'patch5 fails (--no-ignore-whitespace)' '\n-\ttest_must_fail git-apply --no-ignore-whitespace patch5.patch\n+\ttest_must_fail git apply --no-ignore-whitespace patch5.patch\n '\n \n test_done\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 2d33d9e..8e2449d 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -14,8 +14,8 @@ submodule and \"git submodule update --rebase/--merge\" does not detach the HEAD.\n \n compare_head()\n {\n-    sha_master=`git-rev-list --max-count=1 master`\n-    sha_head=`git-rev-list --max-count=1 HEAD`\n+    sha_master=`git rev-list --max-count=1 master`\n+    sha_head=`git rev-list --max-count=1 HEAD`\n \n     test \"$sha_master\" = \"$sha_head\"\n }\n-- \n1.6.4.GIT\n"},{"id":"128720","messageId":"1259561971-25730-4-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":"1259561971-25730-3-git-send-email-mmogilvi_git@miniinfo.net","subject":"[PATCH v2 3/6] t/README: Document GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:28Z","receivedAt":"2009-11-30T06:19:28Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"These were added without documentation in 2009-03-16 (6720721).\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n t/README |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex d8f6c7d..4e1d7dd 100644\n--- a/t/README\n+++ b/t/README\n@@ -75,6 +75,19 @@ appropriately before running \"make\".\n \tAs the names depend on the tests' file names, it is safe to\n \trun the tests with this option in parallel.\n \n+You can also set the GIT_TEST_INSTALLED environment variable to\n+the bindir of an existing git installation to test that installation.\n+You still need to have built this git sandbox, from which various\n+test-* support programs, templates, and perl libraries are used.\n+If your installed git is incomplete, it will silently test parts of\n+your built version instead.\n+\n+When using GIT_TEST_INSTALLED, you can also set GIT_TEST_EXEC_PATH to\n+override the location of the dashed-form subcommands (what\n+GIT_EXEC_PATH would be used for during normal operation).\n+GIT_TEST_EXEC_PATH defaults to `$GIT_TEST_INSTALLED/git --exec-path`.\n+\n+\n Skipping Tests\n --------------\n \n-- \n1.6.4.GIT\n"},{"id":"128717","messageId":"1259561971-25730-5-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":"1259561971-25730-4-git-send-email-mmogilvi_git@miniinfo.net","subject":"[PATCH v2 4/6] build dashless \"bin-wrappers\" directory similar to installed bindir","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:29Z","receivedAt":"2009-11-30T06:19:29Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"The new bin-wrappers directory contains wrapper scripts\nfor executables that will be installed into the standard\nbindir.  It explicitly does not contain most dashed-commands.\nThe scripts automatically set environment variables to run out\nof the source tree, not the installed directory.\n\nThis will allow running the test suite without dashed commands in\nthe PATH.  It also provides a simplified way to test run custom\nbuilt git executables without installing them first.\n\nbin-wrappers also contains wrappers for some test suite support\nexecutables, where the test suite will soon make use of them.\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n\nThere was some discussion of only building bin-wrappers when\nactually running tests, but I don't think it is worth the\nextra complexity.  See the cover letter (0/6).\n\n .gitignore      |    1 +\n Makefile        |   49 ++++++++++++++++++++++++++++++++++++-------------\n wrap-for-bin.sh |   15 +++++++++++++++\n 3 files changed, 52 insertions(+), 13 deletions(-)\n create mode 100644 wrap-for-bin.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex ac02a58..5d32289 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -2,6 +2,7 @@\n /GIT-CFLAGS\n /GIT-GUI-VARS\n /GIT-VERSION-FILE\n+/bin-wrappers/\n /git\n /git-add\n /git-add--interactive\ndiff --git a/Makefile b/Makefile\nindex 5a0b3d4..77892ec 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -416,6 +416,15 @@ ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)\n # what 'all' will build but not install in gitexecdir\n OTHER_PROGRAMS = git$X\n \n+# what test wrappers are needed and 'install' will install, in bindir\n+BINDIR_PROGRAMS_NEED_X += git\n+BINDIR_PROGRAMS_NEED_X += git-upload-pack\n+BINDIR_PROGRAMS_NEED_X += git-receive-pack\n+BINDIR_PROGRAMS_NEED_X += git-upload-archive\n+BINDIR_PROGRAMS_NEED_X += git-shell\n+\n+BINDIR_PROGRAMS_NO_X += git-cvsserver\n+\n # Set paths to tools early so that they can be used for version tests.\n ifndef SHELL_PATH\n \tSHELL_PATH = /bin/sh\n@@ -1690,19 +1699,30 @@ endif\n \n ### Testing rules\n \n-TEST_PROGRAMS += test-chmtime$X\n-TEST_PROGRAMS += test-ctype$X\n-TEST_PROGRAMS += test-date$X\n-TEST_PROGRAMS += test-delta$X\n-TEST_PROGRAMS += test-dump-cache-tree$X\n-TEST_PROGRAMS += test-genrandom$X\n-TEST_PROGRAMS += test-match-trees$X\n-TEST_PROGRAMS += test-parse-options$X\n-TEST_PROGRAMS += test-path-utils$X\n-TEST_PROGRAMS += test-sha1$X\n-TEST_PROGRAMS += test-sigchain$X\n+TEST_PROGRAMS_NEED_X += test-chmtime\n+TEST_PROGRAMS_NEED_X += test-ctype\n+TEST_PROGRAMS_NEED_X += test-date\n+TEST_PROGRAMS_NEED_X += test-delta\n+TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n+TEST_PROGRAMS_NEED_X += test-genrandom\n+TEST_PROGRAMS_NEED_X += test-match-trees\n+TEST_PROGRAMS_NEED_X += test-parse-options\n+TEST_PROGRAMS_NEED_X += test-path-utils\n+TEST_PROGRAMS_NEED_X += test-sha1\n+TEST_PROGRAMS_NEED_X += test-sigchain\n+\n+TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))\n \n-all:: $(TEST_PROGRAMS)\n+test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))\n+\n+all:: $(TEST_PROGRAMS) $(test_bindir_programs)\n+\n+bin-wrappers/%: wrap-for-bin.sh\n+\t@mkdir -p bin-wrappers\n+\t$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n+\t     -e 's|__GIT_EXEC_PATH__|$(shell pwd)|' \\\n+\t     -e 's|__PROG__|$(@F)|' < $< > $@ && \\\n+\tchmod +x $@\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@@ -1763,11 +1783,13 @@ endif\n gitexec_instdir_SQ = $(subst ','\\'',$(gitexec_instdir))\n export gitexec_instdir\n \n+install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)\n+\n install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n \t$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n-\t$(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver '$(DESTDIR_SQ)$(bindir_SQ)'\n+\t$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'\n \t$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install\n ifndef NO_PERL\n \t$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\n@@ -1878,6 +1900,7 @@ clean:\n \t\t$(LIB_FILE) $(XDIFF_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X\n \t$(RM) $(TEST_PROGRAMS)\n+\t$(RM) -r bin-wrappers\n \t$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*\n \t$(RM) -r autom4te.cache\n \t$(RM) config.log config.mak.autogen config.mak.append config.status config.cache\ndiff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\nnew file mode 100644\nindex 0000000..ee2bc98\n--- /dev/null\n+++ b/wrap-for-bin.sh\n@@ -0,0 +1,15 @@\n+#!/bin/sh\n+\n+# wrap-for-bin.sh: Template for git executable wrapper scripts\n+# to run test suite against sandbox, but with only bindir-installed\n+# executables in PATH.  The Makefile copies this into various\n+# files in bin-wrappers, substituting\n+# __GIT_EXEC_PATH__ and __PROG__.\n+\n+GIT_EXEC_PATH=\"__GIT_EXEC_PATH__\"\n+GIT_TEMPLATE_DIR=\"__GIT_EXEC_PATH__/templates/blt\"\n+GITPERLLIB=\"__GIT_EXEC_PATH__/perl/blib/lib\"\n+PATH=\"__GIT_EXEC_PATH__/bin-wrappers:$PATH\"\n+export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH\n+\n+exec \"${GIT_EXEC_PATH}/__PROG__\" \"$@\"\n-- \n1.6.4.GIT\n"},{"id":"128719","messageId":"1259561971-25730-6-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":"1259561971-25730-5-git-send-email-mmogilvi_git@miniinfo.net","subject":"[PATCH v2 5/6] run test suite without dashed git-commands in PATH","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:30Z","receivedAt":"2009-11-30T06:19:30Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"Only put bin-wrappers in the PATH (not GIT_EXEC_PATH), to emulate the\ndefault installed user environment, and ensure all the programs run\ncorrectly in such an environment.  This is now the default, although\nit can be overridden with a --with-dashes test option when running\ntests.\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n t/README      |    8 ++++++++\n t/test-lib.sh |   33 +++++++++++++++++++++------------\n 2 files changed, 29 insertions(+), 12 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 4e1d7dd..8c5d892 100644\n--- a/t/README\n+++ b/t/README\n@@ -75,6 +75,14 @@ appropriately before running \"make\".\n \tAs the names depend on the tests' file names, it is safe to\n \trun the tests with this option in parallel.\n \n+--with-dashes::\n+\tBy default tests are run without dashed forms of\n+\tcommands (like git-commit) in the PATH (it only uses\n+\twrappers from TOP/git-bin).  Use this option to include TOP\n+\tin the PATH, which conains all the dashed forms of commands.\n+\tThis option is currently implied by other options like --valgrind\n+\tand GIT_TEST_INSTALLED.\n+\n You can also set the GIT_TEST_INSTALLED environment variable to\n the bindir of an existing git installation to test that installation.\n You still need to have built this git sandbox, from which various\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex ec3336a..85377c8 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -105,6 +105,8 @@ do\n \t\tverbose=t; shift ;;\n \t-q|--q|--qu|--qui|--quie|--quiet)\n \t\tquiet=t; shift ;;\n+\t--with-dashes)\n+\t\twith_dashes=t; shift ;;\n \t--no-color)\n \t\tcolor=; shift ;;\n \t--no-python)\n@@ -551,19 +553,8 @@ test_done () {\n # Test the binaries we have just built.  The tests are kept in\n # t/ subdirectory and are run in 'trash directory' subdirectory.\n TEST_DIRECTORY=$(pwd)\n-if test -z \"$valgrind\"\n+if test -n \"$valgrind\"\n then\n-\tif test -z \"$GIT_TEST_INSTALLED\"\n-\tthen\n-\t\tPATH=$TEST_DIRECTORY/..:$PATH\n-\t\tGIT_EXEC_PATH=$TEST_DIRECTORY/..\n-\telse\n-\t\tGIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||\n-\t\terror \"Cannot run git from $GIT_TEST_INSTALLED.\"\n-\t\tPATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH\n-\t\tGIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}\n-\tfi\n-else\n \tmake_symlink () {\n \t\ttest -h \"$2\" &&\n \t\ttest \"$1\" = \"$(readlink \"$2\")\" || {\n@@ -625,6 +616,24 @@ else\n \tPATH=$GIT_VALGRIND/bin:$PATH\n \tGIT_EXEC_PATH=$GIT_VALGRIND/bin\n \texport GIT_VALGRIND\n+elif test -n \"$GIT_TEST_INSTALLED\" ; then\n+\tGIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||\n+\terror \"Cannot run git from $GIT_TEST_INSTALLED.\"\n+\tPATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH\n+\tGIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}\n+else # normal case, use ../bin-wrappers only unless $with_dashes:\n+\tgit_bin_dir=\"$TEST_DIRECTORY/../bin-wrappers\"\n+\tif ! test -x \"$git_bin_dir/git\" ; then\n+\t\tif test -z \"$with_dashes\" ; then\n+\t\t\tsay \"$git_bin_dir/git is not executable; using GIT_EXEC_PATH\"\n+\t\tfi\n+\t\twith_dashes=t\n+\tfi\n+\tPATH=\"$git_bin_dir:$PATH\"\n+\tGIT_EXEC_PATH=$TEST_DIRECTORY/..\n+\tif test -n \"$with_dashes\" ; then\n+\t\tPATH=\"$TEST_DIRECTORY/..:$PATH\"\n+\tfi\n fi\n GIT_TEMPLATE_DIR=$(pwd)/../templates/blt\n unset GIT_CONFIG\n-- \n1.6.4.GIT\n"},{"id":"128723","messageId":"1259561971-25730-7-git-send-email-mmogilvi_git@miniinfo.net","threadId":"21791","inReplyTo":"1259561971-25730-6-git-send-email-mmogilvi_git@miniinfo.net","subject":"[PATCH v2 6/6] INSTALL: document a simpler way to run uninstalled builds","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-11-30T06:19:31Z","receivedAt":"2009-11-30T06:19:31Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"The new scripts automatically saved in the bin-wrappers\ndirectory allow you test run a build when you have neither installed\ngit nor tweaked environment variables.  Mention this in INSTALL,\nalong with the slight performance issue of doing so.\n\nThis can be especially handy for manually testing\nnetwork-invoked git (from ssh, web servers, or similar), but\nit is also handy with a plain command prompt.\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n INSTALL |   14 +++++++++++++-\n 1 files changed, 13 insertions(+), 1 deletions(-)\n\ndiff --git a/INSTALL b/INSTALL\nindex be504c9..ee718c6 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -39,7 +39,19 @@ Issues of note:\n    with --disable-transition option to avoid this.\n \n  - You can use git after building but without installing if you\n-   wanted to.  Various git commands need to find other git\n+   want to.\n+\n+   The simplest option for running some manual tests of a build\n+   before installing it is to use the wrapper scripts that are built\n+   and saved into `pwd`/bin-wrappers.  Either invoke the scripts in\n+   bin-wrappers using their full paths, put bin-wrappers in your\n+   PATH, or copy/symlink just the bin-wrappers scripts into somewhere\n+   already in your PATH.  But this option is slightly inefficient,\n+   so for a more permanent solution we recommend either installing\n+   git (you can set a prefix to install right next to your\n+   build directory), or use the alternative below.\n+\n+   Alternatively, various git commands need to find other git\n    commands and scripts to do their work, so you would need to\n    arrange a few environment variables to tell them that their\n    friends will be found in your built source area instead of at\n-- \n1.6.4.GIT\n"},{"id":"128724","messageId":"7vmy241q75.fsf@alter.siamese.dyndns.org","threadId":"21791","inReplyTo":"1259561971-25730-5-git-send-email-mmogilvi_git@miniinfo.net","subject":"Re: [PATCH v2 4/6] build dashless \"bin-wrappers\" directory similar to installed bindir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-30T06:28:46Z","receivedAt":"2009-11-30T06:28:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew Ogilvie <mmogilvi_git@miniinfo.net> writes:\n\n> diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\n> new file mode 100644\n> index 0000000..ee2bc98\n> --- /dev/null\n> +++ b/wrap-for-bin.sh\n> @@ -0,0 +1,15 @@\n> +#!/bin/sh\n> +\n> +# wrap-for-bin.sh: Template for git executable wrapper scripts\n> +# to run test suite against sandbox, but with only bindir-installed\n> +# executables in PATH.  The Makefile copies this into various\n> +# files in bin-wrappers, substituting\n> +# __GIT_EXEC_PATH__ and __PROG__.\n> +\n> +GIT_EXEC_PATH=\"__GIT_EXEC_PATH__\"\n> +GIT_TEMPLATE_DIR=\"__GIT_EXEC_PATH__/templates/blt\"\n> +GITPERLLIB=\"__GIT_EXEC_PATH__/perl/blib/lib\"\n> +PATH=\"__GIT_EXEC_PATH__/bin-wrappers:$PATH\"\n> +export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH\n> +\n> +exec \"${GIT_EXEC_PATH}/__PROG__\" \"$@\"\n\nTwo issues, one minor and one not so minor but not grave:\n\n - Everywhere else we seem to use \"@@UPPERCASE_NAME@@\" not\n   double-underscore as placeholders like the above.\n\n - @@PROG@@ is under our control and it is easy for us to guarantee that\n   it won't have any funny letters, but GIT_EXEC_PATH is not.  Is it safe\n   to do a simple-minded \"sed\" replacement, or does it need the usual sq\n   trick employed in the other replacement in our Makefile?\n"},{"id":"128727","messageId":"7vaay41p9n.fsf@alter.siamese.dyndns.org","threadId":"21791","inReplyTo":"1259561971-25730-7-git-send-email-mmogilvi_git@miniinfo.net","subject":"Re: [PATCH v2 6/6] INSTALL: document a simpler way to run uninstalled builds","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-30T06:48:52Z","receivedAt":"2009-11-30T06:48:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew Ogilvie <mmogilvi_git@miniinfo.net> writes:\n\n> diff --git a/INSTALL b/INSTALL\n> index be504c9..ee718c6 100644\n> --- a/INSTALL\n> +++ b/INSTALL\n> @@ -39,7 +39,19 @@ Issues of note:\n>     with --disable-transition option to avoid this.\n>  \n>   - You can use git after building but without installing if you\n> -   wanted to.  Various git commands need to find other git\n> +   want to.\n> +\n> +   The simplest option for running some manual tests of a build\n> +   before installing it is to use the wrapper scripts that are built\n> +   and saved into `pwd`/bin-wrappers.  Either invoke the scripts in\n> +   bin-wrappers using their full paths, put bin-wrappers in your\n> +   PATH, or copy/symlink just the bin-wrappers scripts into somewhere\n> +   already in your PATH.  But this option is slightly inefficient,\n> +   so for a more permanent solution we recommend either installing\n> +   git (you can set a prefix to install right next to your\n> +   build directory), or use the alternative below.\n\nDrop \"simplest\" and \"slightly\".\n\nI think you forgot to mention an important improvement you made since the\nearlier iteration on the wrap-for-bin script in the cover letter.  With\nthe new wrap-for-bin, we do not have to worry about the case a random\nbinary in the directory is run without first adding anything to user's\n$PATH anymore, no?\n\nWith that change, this round's implementation deserves to be recommended\nas the new preferred way to run \"use after building without installing\", I\nthink.  So how about making the text like this?\n\n    You can use git after building but without installing if you want to\n    test drive it.  Simply run git found in bin-wrappers directory in the\n    build directory, or prepend that directory to your $PATH.  This\n    however is less efficient than running an installed git, as you always\n    need an extra fork+exec to run any git subcommand.\n\n    It is still possible to use git without installing by setting a few\n    environment variables, which was the way this was done traditionally.\n    But using git found in bin-wrappers directory in the build directory\n    is far simpler.  Just for a historical reference, the old way went\n    like this:\n\n\tGIT_EXEC_PATH=`pwd`\n\tPATH=`pwd`:$PATH\n\tGITPERLLIB=`pwd`/perl/blib/lib\n\texport GIT_EXEC_PATH PATH GITPERLLIB\n"},{"id":"128731","messageId":"7vzl64xz16.fsf@alter.siamese.dyndns.org","threadId":"21791","inReplyTo":"1259561971-25730-1-git-send-email-mmogilvi_git@miniinfo.net","subject":"Re: [PATCH v2 0/6] Run test suite without dashed commands in PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-30T07:16:53Z","receivedAt":"2009-11-30T07:16:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I added t9150 to your second patch and pushed the result out on 'pu'.\n"},{"id":"128839","messageId":"20091201073350.GA528@comcast.net","threadId":"21791","inReplyTo":"7vmy241q75.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 4/6] build dashless \"bin-wrappers\" directory similar to installed bindir","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-12-01T07:33:50Z","receivedAt":"2009-12-01T07:33:50Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"On Sun, Nov 29, 2009 at 10:28:46PM -0800, Junio C Hamano wrote:\n> Matthew Ogilvie <mmogilvi_git@miniinfo.net> writes:\n> > +GIT_EXEC_PATH=\"__GIT_EXEC_PATH__\"\n> > +exec \"${GIT_EXEC_PATH}/__PROG__\" \"$@\"\n> \n> Two issues, one minor and one not so minor but not grave:\n> \n>  - Everywhere else we seem to use \"@@UPPERCASE_NAME@@\" not\n>    double-underscore as placeholders like the above.\n> \n>  - @@PROG@@ is under our control and it is easy for us to guarantee that\n>    it won't have any funny letters, but GIT_EXEC_PATH is not.  Is it safe\n>    to do a simple-minded \"sed\" replacement, or does it need the usual sq\n>    trick employed in the other replacement in our Makefile?\n\nYou've already applied the v2 patch to pu, but if it is still\na concern, you might either add or squash in the patch at\nthe bottom of this message for the @@ vs __ issue.  But first,\nsome thoughts about escaping $(shell pwd):\n\n-------------\n\nThe patch below also switches to using single quotes in the wrapper\nscript, but that by itself doesn't fix everything.  Basically it\nfixes '\"', '$', (and maybe/partially '\\\\') at the expense of\nbreaking '\\''.  Several characters are still\nbroken: '\\'', '|', '&', '\\\\', and maybe others.  Either option\nshould handle ' ' (space) OK.\n\nThe \"standard\" *_SQ replacement used elsewhere in the makefile\nis inadequate in this context, since we really needs to escape\nmakefile, shell, sed, and then shell again.  It might be possible\nto define something like the following, and then use it instead\nof $(shell pwd).  You could also try several nested\n$(subst ...)'s instead of sed.  I have not tried either of these.\n\nbuild_dir_MQ=$(shell pwd | sed -e \"s/'/'\\\"'\\\"'/g\" \\\n                               -e 's/[|&\\\\]/\\\\&/g' \\\n                               -e \"s/'/'\\\"'\\\"'/g\" )\n\nRationale:\n\nWorking backwards, the last -e makes sure the sed argument doesn't\nget split or combined by the shell before it gets to sed.  The\nmiddle -e is intended to escape characters that sed would\nmisinterpret.  The first -e is so that single quotes get\nproperly interpreted by the shell that interprets\nbin-wrappers/* generated scripts.\n\nBut I don't really think this is worth it:\n\n1. I think there are parts of test-lib.sh (and maybe other places)\nthat don't even handle spaces in top-level $(pwd), let alone more\ncomplicated characters.  (git itself should be robust, though)\n\n2. Technically, stuff like SHELL_PATH_SQ (anything that is used\nby the makefile as the replacement text for a sed 's' command) may\nbenefit from something similar.  (But other uses like -DVAR='$(xx_SQ)'\nare probably perfect already.)\n\n3. It doesn't seem like a severe restriction to require that users\nbuild git in a directory with a reasonably normal full path name.\n\n-------------\n\nFrom: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\nDate: Mon, 30 Nov 2009 22:57:40 -0700\nSubject: [PATCH] wrap-for-bin.sh: Use @@var@@ for Makefile variable expansion\n\nWe use @@var@@-style variable expansion in most other places, so be\nconsistent with them.\n\nAlso, rename it to @@BUILD_DIR@@ to clarify what it is expanded with,\nand use single quotes in wrap-for-bin.sh to reduce the number of shell\nmeta characters that might mess it up.\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n Makefile        |    4 ++--\n wrap-for-bin.sh |   12 ++++++------\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c8f0c5f..811db45 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1791,8 +1791,8 @@ all:: $(TEST_PROGRAMS) $(test_bindir_programs)\n bin-wrappers/%: wrap-for-bin.sh\n \t@mkdir -p bin-wrappers\n \t$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n-\t     -e 's|__GIT_EXEC_PATH__|$(shell pwd)|' \\\n-\t     -e 's|__PROG__|$(@F)|' < $< > $@ && \\\n+\t     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \\\n+\t     -e 's|@@PROG@@|$(@F)|' < $< > $@ && \\\n \tchmod +x $@\n \n # GNU make supports exporting all variables by \"export\" without parameters.\ndiff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\nindex ee2bc98..c5075c9 100644\n--- a/wrap-for-bin.sh\n+++ b/wrap-for-bin.sh\n@@ -4,12 +4,12 @@\n # to run test suite against sandbox, but with only bindir-installed\n # executables in PATH.  The Makefile copies this into various\n # files in bin-wrappers, substituting\n-# __GIT_EXEC_PATH__ and __PROG__.\n+# @@BUILD_DIR@@ and @@PROG@@.\n \n-GIT_EXEC_PATH=\"__GIT_EXEC_PATH__\"\n-GIT_TEMPLATE_DIR=\"__GIT_EXEC_PATH__/templates/blt\"\n-GITPERLLIB=\"__GIT_EXEC_PATH__/perl/blib/lib\"\n-PATH=\"__GIT_EXEC_PATH__/bin-wrappers:$PATH\"\n+GIT_EXEC_PATH='@@BUILD_DIR@@'\n+GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'\n+GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'\n+PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH\n \n-exec \"${GIT_EXEC_PATH}/__PROG__\" \"$@\"\n+exec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n-- \n1.6.4.GIT\n"},{"id":"128902","messageId":"m3fx7un7vb.fsf@localhost.localdomain","threadId":"21791","inReplyTo":"1259561971-25730-6-git-send-email-mmogilvi_git@miniinfo.net","subject":"Re: [PATCH v2 5/6] run test suite without dashed git-commands in PATH","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-12-01T17:24:46Z","receivedAt":"2009-12-01T17:24:46Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Matthew Ogilvie <mmogilvi_git@miniinfo.net> writes:\n\n> diff --git a/t/README b/t/README\n> index 4e1d7dd..8c5d892 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -75,6 +75,14 @@ appropriately before running \"make\".\n>  \tAs the names depend on the tests' file names, it is safe to\n>  \trun the tests with this option in parallel.\n>  \n> +--with-dashes::\n> +\tBy default tests are run without dashed forms of\n> +\tcommands (like git-commit) in the PATH (it only uses\n> +\twrappers from TOP/git-bin).  Use this option to include TOP\n> +\tin the PATH, which conains all the dashed forms of commands.\n> +\tThis option is currently implied by other options like --valgrind\n> +\tand GIT_TEST_INSTALLED.\n> +\n\nShouldn't it be 'TOP/bin-wrappers' and not 'TOP/git-bin'?  \nShouldn't TOP be explained somewhere, or is it obvious in the context?\n\ns/conains/contains/.\n\n> +else # normal case, use ../bin-wrappers only unless $with_dashes:\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"128971","messageId":"20091202054956.GA2089@comcast.net","threadId":"21791","inReplyTo":"m3fx7un7vb.fsf@localhost.localdomain","subject":"Re: [PATCH v2 5/6] run test suite without dashed git-commands in PATH","fromName":"Matthew Ogilvie","fromEmail":"mmogilvi_git@miniinfo.net","sentAt":"2009-12-02T05:49:57Z","receivedAt":"2009-12-02T05:49:57Z","isPatch":true,"sender":{"key":"mmogilvi_git@miniinfo.net","avatar":null},"body":"On Tue, Dec 01, 2009 at 09:24:46AM -0800, Jakub Narebski wrote:\n> Matthew Ogilvie <mmogilvi_git@miniinfo.net> writes:\n> > +--with-dashes::\n> > +\tBy default tests are run without dashed forms of\n> > +\tcommands (like git-commit) in the PATH (it only uses\n> > +\twrappers from TOP/git-bin).  Use this option to include TOP\n> > +\tin the PATH, which conains all the dashed forms of commands.\n> > +\tThis option is currently implied by other options like --valgrind\n> > +\tand GIT_TEST_INSTALLED.\n> > +\n> \n> Shouldn't it be 'TOP/bin-wrappers' and not 'TOP/git-bin'?  \n> Shouldn't TOP be explained somewhere, or is it obvious in the context?\n> \n> s/conains/contains/.\n\nI've appended a incremental patch for these.\n\nJunio, do you want me to re-roll the 3 bin-wrappers patches to\ninclude both this and the \"@@ vs __\" patch, or do you want\nto just add or squash them in from the emails?\n\n--\nMatthew Ogilvie   [mmogilvi_git@miniinfo.net]\n\nFrom: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\nDate: Tue, 1 Dec 2009 22:16:19 -0700\nSubject: [PATCH] t/README: fix spelling in --with-dashes documentation\n\nSigned-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>\n---\n t/README |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 8c5d892..dcd3ebb 100644\n--- a/t/README\n+++ b/t/README\n@@ -78,10 +78,11 @@ appropriately before running \"make\".\n --with-dashes::\n \tBy default tests are run without dashed forms of\n \tcommands (like git-commit) in the PATH (it only uses\n-\twrappers from TOP/git-bin).  Use this option to include TOP\n-\tin the PATH, which conains all the dashed forms of commands.\n-\tThis option is currently implied by other options like --valgrind\n-\tand GIT_TEST_INSTALLED.\n+\twrappers from ../bin-wrappers).  Use this option to include\n+\tthe build directory (..) in the PATH, which contains all\n+\tthe dashed forms of commands.  This option is currently\n+\timplied by other options like --valgrind and\n+\tGIT_TEST_INSTALLED.\n \n You can also set the GIT_TEST_INSTALLED environment variable to\n the bindir of an existing git installation to test that installation.\n-- \n1.6.4.GIT\n"},{"id":"128972","messageId":"7v4oo9opti.fsf@alter.siamese.dyndns.org","threadId":"21791","inReplyTo":"20091202054956.GA2089@comcast.net","subject":"Re: [PATCH v2 5/6] run test suite without dashed git-commands in PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-02T06:25:13Z","receivedAt":"2009-12-02T06:25:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew Ogilvie <mmogilvi_git@miniinfo.net> writes:\n\n> Junio, do you want me to re-roll the 3 bin-wrappers patches to\n> include both this and the \"@@ vs __\" patch, or do you want\n> to just add or squash them in from the emails?\n\nI expect that very soon I will be paying much less attention to topics\nthat will not be in 1.6.6 (in fact, I maybe am already as of tonight), to\nsave my mental bandwidth to concentrate more on bugfixes and regressions.\n\nPlease re-roll and feed me complete patches for anything that are not in\n'next', telling me which ones to drop from 'pu' if I have older versions.\n\nJust FYI, earlier you said to me something like \"I see you already queued\nthis to 'pu', ...\", but please be aware that being in 'pu' does not mean\nthat much---not much more than being in the mailing list archive.  They\nare fair game for rewriting, replacing and dropping.  I merely keep them\non 'pu' so that it would be easier for me and others to look at them than\nhaving to hunt for them in the mailing list archive.\n\nThanks.\n"}]}