{"thread":{"id":"42018","subject":"[PATCH] Move test-* to t/helper/ subdirectory","startedAt":"2016-04-13T13:22:42Z","lastAt":"2016-05-10T20:23:29Z","messageCount":16,"participants":["Nguyễn Thái Ngọc Duy","Junio C Hamano","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"283370","messageId":"1460553762-12419-1-git-send-email-pclouds@gmail.com","threadId":"42018","inReplyTo":null,"subject":"[PATCH] Move test-* to t/helper/ subdirectory","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2016-04-13T13:22:42Z","receivedAt":"2016-04-13T13:22:42Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This keeps top dir a bit less crowded. And because these programs are\nfor testing purposes, it makes sense that they stay somewhere in t/\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n This patch will break any patches that add new test programs.\n Luckily, none in 'next' or 'pu' does that. I know lmdb backend adds\n test-lmdb-backend, so a manual move and some .gitignore fixup is\n required there.\n\n .gitignore                                         | 33 ----------------------\n Makefile                                           | 24 ++++++++--------\n t/helper/.gitignore (new)                          | 33 ++++++++++++++++++++++\n test-chmtime.c => t/helper/test-chmtime.c          |  0\n test-config.c => t/helper/test-config.c            |  0\n test-ctype.c => t/helper/test-ctype.c              |  0\n test-date.c => t/helper/test-date.c                |  0\n test-delta.c => t/helper/test-delta.c              |  0\n .../helper/test-dump-cache-tree.c                  |  0\n .../helper/test-dump-split-index.c                 |  0\n .../helper/test-dump-untracked-cache.c             |  0\n test-fake-ssh.c => t/helper/test-fake-ssh.c        |  0\n test-genrandom.c => t/helper/test-genrandom.c      |  0\n test-hashmap.c => t/helper/test-hashmap.c          |  0\n .../helper/test-index-version.c                    |  0\n test-line-buffer.c => t/helper/test-line-buffer.c  |  0\n test-match-trees.c => t/helper/test-match-trees.c  |  0\n test-mergesort.c => t/helper/test-mergesort.c      |  0\n test-mktemp.c => t/helper/test-mktemp.c            |  0\n .../helper/test-parse-options.c                    |  0\n test-path-utils.c => t/helper/test-path-utils.c    |  0\n test-prio-queue.c => t/helper/test-prio-queue.c    |  0\n test-read-cache.c => t/helper/test-read-cache.c    |  0\n test-regex.c => t/helper/test-regex.c              |  0\n .../helper/test-revision-walking.c                 |  0\n test-run-command.c => t/helper/test-run-command.c  |  0\n .../helper/test-scrap-cache-tree.c                 |  0\n test-sha1-array.c => t/helper/test-sha1-array.c    |  0\n test-sha1.c => t/helper/test-sha1.c                |  0\n test-sha1.sh => t/helper/test-sha1.sh              |  4 +--\n test-sigchain.c => t/helper/test-sigchain.c        |  0\n test-string-list.c => t/helper/test-string-list.c  |  0\n .../helper/test-submodule-config.c                 |  0\n test-subprocess.c => t/helper/test-subprocess.c    |  0\n test-svn-fe.c => t/helper/test-svn-fe.c            |  0\n .../helper/test-urlmatch-normalization.c           |  0\n test-wildmatch.c => t/helper/test-wildmatch.c      |  0\n t/t5601-clone.sh                                   |  2 +-\n t/test-lib.sh                                      |  4 +--\n 39 files changed, 50 insertions(+), 50 deletions(-)\n create mode 100644 t/helper/.gitignore\n rename test-chmtime.c => t/helper/test-chmtime.c (100%)\n rename test-config.c => t/helper/test-config.c (100%)\n rename test-ctype.c => t/helper/test-ctype.c (100%)\n rename test-date.c => t/helper/test-date.c (100%)\n rename test-delta.c => t/helper/test-delta.c (100%)\n rename test-dump-cache-tree.c => t/helper/test-dump-cache-tree.c (100%)\n rename test-dump-split-index.c => t/helper/test-dump-split-index.c (100%)\n rename test-dump-untracked-cache.c => t/helper/test-dump-untracked-cache.c (100%)\n rename test-fake-ssh.c => t/helper/test-fake-ssh.c (100%)\n rename test-genrandom.c => t/helper/test-genrandom.c (100%)\n rename test-hashmap.c => t/helper/test-hashmap.c (100%)\n rename test-index-version.c => t/helper/test-index-version.c (100%)\n rename test-line-buffer.c => t/helper/test-line-buffer.c (100%)\n rename test-match-trees.c => t/helper/test-match-trees.c (100%)\n rename test-mergesort.c => t/helper/test-mergesort.c (100%)\n rename test-mktemp.c => t/helper/test-mktemp.c (100%)\n rename test-parse-options.c => t/helper/test-parse-options.c (100%)\n rename test-path-utils.c => t/helper/test-path-utils.c (100%)\n rename test-prio-queue.c => t/helper/test-prio-queue.c (100%)\n rename test-read-cache.c => t/helper/test-read-cache.c (100%)\n rename test-regex.c => t/helper/test-regex.c (100%)\n rename test-revision-walking.c => t/helper/test-revision-walking.c (100%)\n rename test-run-command.c => t/helper/test-run-command.c (100%)\n rename test-scrap-cache-tree.c => t/helper/test-scrap-cache-tree.c (100%)\n rename test-sha1-array.c => t/helper/test-sha1-array.c (100%)\n rename test-sha1.c => t/helper/test-sha1.c (100%)\n rename test-sha1.sh => t/helper/test-sha1.sh (96%)\n rename test-sigchain.c => t/helper/test-sigchain.c (100%)\n rename test-string-list.c => t/helper/test-string-list.c (100%)\n rename test-submodule-config.c => t/helper/test-submodule-config.c (100%)\n rename test-subprocess.c => t/helper/test-subprocess.c (100%)\n rename test-svn-fe.c => t/helper/test-svn-fe.c (100%)\n rename test-urlmatch-normalization.c => t/helper/test-urlmatch-normalization.c (100%)\n rename test-wildmatch.c => t/helper/test-wildmatch.c (100%)\n\ndiff --git a/.gitignore b/.gitignore\nindex 5087ce1..05cb58a 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -179,39 +179,6 @@\n /gitweb/gitweb.cgi\n /gitweb/static/gitweb.js\n /gitweb/static/gitweb.min.*\n-/test-chmtime\n-/test-ctype\n-/test-config\n-/test-date\n-/test-delta\n-/test-dump-cache-tree\n-/test-dump-split-index\n-/test-dump-untracked-cache\n-/test-fake-ssh\n-/test-scrap-cache-tree\n-/test-genrandom\n-/test-hashmap\n-/test-index-version\n-/test-line-buffer\n-/test-match-trees\n-/test-mergesort\n-/test-mktemp\n-/test-parse-options\n-/test-path-utils\n-/test-prio-queue\n-/test-read-cache\n-/test-regex\n-/test-revision-walking\n-/test-run-command\n-/test-sha1\n-/test-sha1-array\n-/test-sigchain\n-/test-string-list\n-/test-submodule-config\n-/test-subprocess\n-/test-svn-fe\n-/test-urlmatch-normalization\n-/test-wildmatch\n /common-cmds.h\n *.tar.gz\n *.dsc\ndiff --git a/Makefile b/Makefile\nindex 2742a69..0a5fb9d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -624,7 +624,7 @@ TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n TEST_PROGRAMS_NEED_X += test-wildmatch\n \n-TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))\n+TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))\n \n # List built-in command $C whose implementation cmd_$C() is not in\n # builtin/$C.o but is linked in as part of some other command.\n@@ -1904,7 +1904,7 @@ VCSSVN_OBJS += vcs-svn/fast_export.o\n VCSSVN_OBJS += vcs-svn/svndiff.o\n VCSSVN_OBJS += vcs-svn/svndump.o\n \n-TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))\n+TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))\n OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n \t$(XDIFF_OBJS) \\\n \t$(VCSSVN_OBJS) \\\n@@ -2211,7 +2211,7 @@ 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|@@BUILD_DIR@@|$(shell pwd)|' \\\n-\t     -e 's|@@PROG@@|$(@F)|' < $< > $@ && \\\n+\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\n \tchmod +x $@\n \n # GNU make supports exporting all variables by \"export\" without parameters.\n@@ -2231,25 +2231,25 @@ perf: all\n \n .PHONY: test perf\n \n-test-ctype$X: ctype.o\n+t/helper/test-ctype$X: ctype.o\n \n-test-date$X: date.o ctype.o\n+t/helper/test-date$X: date.o ctype.o\n \n-test-delta$X: diff-delta.o patch-delta.o\n+t/helper/test-delta$X: diff-delta.o patch-delta.o\n \n-test-line-buffer$X: vcs-svn/lib.a\n+t/helper/test-line-buffer$X: vcs-svn/lib.a\n \n-test-parse-options$X: parse-options.o parse-options-cb.o\n+t/helper/test-parse-options$X: parse-options.o parse-options-cb.o\n \n-test-svn-fe$X: vcs-svn/lib.a\n+t/helper/test-svn-fe$X: vcs-svn/lib.a\n \n .PRECIOUS: $(TEST_OBJS)\n \n-test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)\n+t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n \n-check-sha1:: test-sha1$X\n-\t./test-sha1.sh\n+check-sha1:: t/helper/test-sha1$X\n+\tt/helper/test-sha1.sh\n \n SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\n \ndiff --git a/t/helper/.gitignore b/t/helper/.gitignore\nnew file mode 100644\nindex 0000000..d6e8b36\n--- /dev/null\n+++ b/t/helper/.gitignore\n@@ -0,0 +1,33 @@\n+/test-chmtime\n+/test-ctype\n+/test-config\n+/test-date\n+/test-delta\n+/test-dump-cache-tree\n+/test-dump-split-index\n+/test-dump-untracked-cache\n+/test-fake-ssh\n+/test-scrap-cache-tree\n+/test-genrandom\n+/test-hashmap\n+/test-index-version\n+/test-line-buffer\n+/test-match-trees\n+/test-mergesort\n+/test-mktemp\n+/test-parse-options\n+/test-path-utils\n+/test-prio-queue\n+/test-read-cache\n+/test-regex\n+/test-revision-walking\n+/test-run-command\n+/test-sha1\n+/test-sha1-array\n+/test-sigchain\n+/test-string-list\n+/test-submodule-config\n+/test-subprocess\n+/test-svn-fe\n+/test-urlmatch-normalization\n+/test-wildmatch\ndiff --git a/test-chmtime.c b/t/helper/test-chmtime.c\nsimilarity index 100%\nrename from test-chmtime.c\nrename to t/helper/test-chmtime.c\ndiff --git a/test-config.c b/t/helper/test-config.c\nsimilarity index 100%\nrename from test-config.c\nrename to t/helper/test-config.c\ndiff --git a/test-ctype.c b/t/helper/test-ctype.c\nsimilarity index 100%\nrename from test-ctype.c\nrename to t/helper/test-ctype.c\ndiff --git a/test-date.c b/t/helper/test-date.c\nsimilarity index 100%\nrename from test-date.c\nrename to t/helper/test-date.c\ndiff --git a/test-delta.c b/t/helper/test-delta.c\nsimilarity index 100%\nrename from test-delta.c\nrename to t/helper/test-delta.c\ndiff --git a/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\nsimilarity index 100%\nrename from test-dump-cache-tree.c\nrename to t/helper/test-dump-cache-tree.c\ndiff --git a/test-dump-split-index.c b/t/helper/test-dump-split-index.c\nsimilarity index 100%\nrename from test-dump-split-index.c\nrename to t/helper/test-dump-split-index.c\ndiff --git a/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c\nsimilarity index 100%\nrename from test-dump-untracked-cache.c\nrename to t/helper/test-dump-untracked-cache.c\ndiff --git a/test-fake-ssh.c b/t/helper/test-fake-ssh.c\nsimilarity index 100%\nrename from test-fake-ssh.c\nrename to t/helper/test-fake-ssh.c\ndiff --git a/test-genrandom.c b/t/helper/test-genrandom.c\nsimilarity index 100%\nrename from test-genrandom.c\nrename to t/helper/test-genrandom.c\ndiff --git a/test-hashmap.c b/t/helper/test-hashmap.c\nsimilarity index 100%\nrename from test-hashmap.c\nrename to t/helper/test-hashmap.c\ndiff --git a/test-index-version.c b/t/helper/test-index-version.c\nsimilarity index 100%\nrename from test-index-version.c\nrename to t/helper/test-index-version.c\ndiff --git a/test-line-buffer.c b/t/helper/test-line-buffer.c\nsimilarity index 100%\nrename from test-line-buffer.c\nrename to t/helper/test-line-buffer.c\ndiff --git a/test-match-trees.c b/t/helper/test-match-trees.c\nsimilarity index 100%\nrename from test-match-trees.c\nrename to t/helper/test-match-trees.c\ndiff --git a/test-mergesort.c b/t/helper/test-mergesort.c\nsimilarity index 100%\nrename from test-mergesort.c\nrename to t/helper/test-mergesort.c\ndiff --git a/test-mktemp.c b/t/helper/test-mktemp.c\nsimilarity index 100%\nrename from test-mktemp.c\nrename to t/helper/test-mktemp.c\ndiff --git a/test-parse-options.c b/t/helper/test-parse-options.c\nsimilarity index 100%\nrename from test-parse-options.c\nrename to t/helper/test-parse-options.c\ndiff --git a/test-path-utils.c b/t/helper/test-path-utils.c\nsimilarity index 100%\nrename from test-path-utils.c\nrename to t/helper/test-path-utils.c\ndiff --git a/test-prio-queue.c b/t/helper/test-prio-queue.c\nsimilarity index 100%\nrename from test-prio-queue.c\nrename to t/helper/test-prio-queue.c\ndiff --git a/test-read-cache.c b/t/helper/test-read-cache.c\nsimilarity index 100%\nrename from test-read-cache.c\nrename to t/helper/test-read-cache.c\ndiff --git a/test-regex.c b/t/helper/test-regex.c\nsimilarity index 100%\nrename from test-regex.c\nrename to t/helper/test-regex.c\ndiff --git a/test-revision-walking.c b/t/helper/test-revision-walking.c\nsimilarity index 100%\nrename from test-revision-walking.c\nrename to t/helper/test-revision-walking.c\ndiff --git a/test-run-command.c b/t/helper/test-run-command.c\nsimilarity index 100%\nrename from test-run-command.c\nrename to t/helper/test-run-command.c\ndiff --git a/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\nsimilarity index 100%\nrename from test-scrap-cache-tree.c\nrename to t/helper/test-scrap-cache-tree.c\ndiff --git a/test-sha1-array.c b/t/helper/test-sha1-array.c\nsimilarity index 100%\nrename from test-sha1-array.c\nrename to t/helper/test-sha1-array.c\ndiff --git a/test-sha1.c b/t/helper/test-sha1.c\nsimilarity index 100%\nrename from test-sha1.c\nrename to t/helper/test-sha1.c\ndiff --git a/test-sha1.sh b/t/helper/test-sha1.sh\nsimilarity index 96%\nrename from test-sha1.sh\nrename to t/helper/test-sha1.sh\nindex cef4bcc..750b95a 100755\n--- a/test-sha1.sh\n+++ b/t/helper/test-sha1.sh\n@@ -1,7 +1,7 @@\n #!/bin/sh\n \n dd if=/dev/zero bs=1048576 count=100 2>/dev/null |\n-/usr/bin/time ./test-sha1 >/dev/null\n+/usr/bin/time t/helper/test-sha1 >/dev/null\n \n while read expect cnt pfx\n do\n@@ -11,7 +11,7 @@ do\n \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n \t\t\tperl -pe 'y/\\000/g/'\n-\t\t} | ./test-sha1 $cnt\n+\t\t} | ./t/helper/test-sha1 $cnt\n \t)\n \tif test \"$expect\" = \"$actual\"\n \tthen\ndiff --git a/test-sigchain.c b/t/helper/test-sigchain.c\nsimilarity index 100%\nrename from test-sigchain.c\nrename to t/helper/test-sigchain.c\ndiff --git a/test-string-list.c b/t/helper/test-string-list.c\nsimilarity index 100%\nrename from test-string-list.c\nrename to t/helper/test-string-list.c\ndiff --git a/test-submodule-config.c b/t/helper/test-submodule-config.c\nsimilarity index 100%\nrename from test-submodule-config.c\nrename to t/helper/test-submodule-config.c\ndiff --git a/test-subprocess.c b/t/helper/test-subprocess.c\nsimilarity index 100%\nrename from test-subprocess.c\nrename to t/helper/test-subprocess.c\ndiff --git a/test-svn-fe.c b/t/helper/test-svn-fe.c\nsimilarity index 100%\nrename from test-svn-fe.c\nrename to t/helper/test-svn-fe.c\ndiff --git a/test-urlmatch-normalization.c b/t/helper/test-urlmatch-normalization.c\nsimilarity index 100%\nrename from test-urlmatch-normalization.c\nrename to t/helper/test-urlmatch-normalization.c\ndiff --git a/test-wildmatch.c b/t/helper/test-wildmatch.c\nsimilarity index 100%\nrename from test-wildmatch.c\nrename to t/helper/test-wildmatch.c\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex c1efb8e..150aeaf 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -308,7 +308,7 @@ test_expect_success 'clone checking out a tag' '\n \n setup_ssh_wrapper () {\n \ttest_expect_success 'setup ssh wrapper' '\n-\t\tcp \"$GIT_BUILD_DIR/test-fake-ssh$X\" \\\n+\t\tcp \"$GIT_BUILD_DIR/t/helper/test-fake-ssh$X\" \\\n \t\t\t\"$TRASH_DIRECTORY/ssh-wrapper$X\" &&\n \t\tGIT_SSH=\"$TRASH_DIRECTORY/ssh-wrapper$X\" &&\n \t\texport GIT_SSH &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0b47eb6..cd0ecd4 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -854,10 +854,10 @@ test -d \"$GIT_BUILD_DIR\"/templates/blt || {\n \terror \"You haven't built things yet, have you?\"\n }\n \n-if ! test -x \"$GIT_BUILD_DIR\"/test-chmtime\n+if ! test -x \"$GIT_BUILD_DIR\"/t/helper/test-chmtime\n then\n \techo >&2 'You need to build test-chmtime:'\n-\techo >&2 'Run \"make test-chmtime\" in the source (toplevel) directory'\n+\techo >&2 'Run \"make t/helper/test-chmtime\" in the source (toplevel) directory'\n \texit 1\n fi\n \n-- \n2.8.0.rc0.210.gd302cd2\n"},{"id":"283533","messageId":"xmqqtwj2di3r.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"1460553762-12419-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-15T15:09:12Z","receivedAt":"2016-04-15T15:09:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> This keeps top dir a bit less crowded. And because these programs are\n> for testing purposes, it makes sense that they stay somewhere in t/\n\nBut leaves many *.o files after \"make clean\".  Even \"distclean\" does\nnot clean them.\n\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  This patch will break any patches that add new test programs.\n>  Luckily, none in 'next' or 'pu' does that. I know lmdb backend adds\n>  test-lmdb-backend, so a manual move and some .gitignore fixup is\n>  required there.\n>\n>  .gitignore                                         | 33 ----------------------\n>  Makefile                                           | 24 ++++++++--------\n>  t/helper/.gitignore (new)                          | 33 ++++++++++++++++++++++\n>  test-chmtime.c => t/helper/test-chmtime.c          |  0\n>  test-config.c => t/helper/test-config.c            |  0\n>  test-ctype.c => t/helper/test-ctype.c              |  0\n>  test-date.c => t/helper/test-date.c                |  0\n>  test-delta.c => t/helper/test-delta.c              |  0\n>  .../helper/test-dump-cache-tree.c                  |  0\n>  .../helper/test-dump-split-index.c                 |  0\n>  .../helper/test-dump-untracked-cache.c             |  0\n>  test-fake-ssh.c => t/helper/test-fake-ssh.c        |  0\n>  test-genrandom.c => t/helper/test-genrandom.c      |  0\n>  test-hashmap.c => t/helper/test-hashmap.c          |  0\n>  .../helper/test-index-version.c                    |  0\n>  test-line-buffer.c => t/helper/test-line-buffer.c  |  0\n>  test-match-trees.c => t/helper/test-match-trees.c  |  0\n>  test-mergesort.c => t/helper/test-mergesort.c      |  0\n>  test-mktemp.c => t/helper/test-mktemp.c            |  0\n>  .../helper/test-parse-options.c                    |  0\n>  test-path-utils.c => t/helper/test-path-utils.c    |  0\n>  test-prio-queue.c => t/helper/test-prio-queue.c    |  0\n>  test-read-cache.c => t/helper/test-read-cache.c    |  0\n>  test-regex.c => t/helper/test-regex.c              |  0\n>  .../helper/test-revision-walking.c                 |  0\n>  test-run-command.c => t/helper/test-run-command.c  |  0\n>  .../helper/test-scrap-cache-tree.c                 |  0\n>  test-sha1-array.c => t/helper/test-sha1-array.c    |  0\n>  test-sha1.c => t/helper/test-sha1.c                |  0\n>  test-sha1.sh => t/helper/test-sha1.sh              |  4 +--\n>  test-sigchain.c => t/helper/test-sigchain.c        |  0\n>  test-string-list.c => t/helper/test-string-list.c  |  0\n>  .../helper/test-submodule-config.c                 |  0\n>  test-subprocess.c => t/helper/test-subprocess.c    |  0\n>  test-svn-fe.c => t/helper/test-svn-fe.c            |  0\n>  .../helper/test-urlmatch-normalization.c           |  0\n>  test-wildmatch.c => t/helper/test-wildmatch.c      |  0\n>  t/t5601-clone.sh                                   |  2 +-\n>  t/test-lib.sh                                      |  4 +--\n>  39 files changed, 50 insertions(+), 50 deletions(-)\n>  create mode 100644 t/helper/.gitignore\n>  rename test-chmtime.c => t/helper/test-chmtime.c (100%)\n>  rename test-config.c => t/helper/test-config.c (100%)\n>  rename test-ctype.c => t/helper/test-ctype.c (100%)\n>  rename test-date.c => t/helper/test-date.c (100%)\n>  rename test-delta.c => t/helper/test-delta.c (100%)\n>  rename test-dump-cache-tree.c => t/helper/test-dump-cache-tree.c (100%)\n>  rename test-dump-split-index.c => t/helper/test-dump-split-index.c (100%)\n>  rename test-dump-untracked-cache.c => t/helper/test-dump-untracked-cache.c (100%)\n>  rename test-fake-ssh.c => t/helper/test-fake-ssh.c (100%)\n>  rename test-genrandom.c => t/helper/test-genrandom.c (100%)\n>  rename test-hashmap.c => t/helper/test-hashmap.c (100%)\n>  rename test-index-version.c => t/helper/test-index-version.c (100%)\n>  rename test-line-buffer.c => t/helper/test-line-buffer.c (100%)\n>  rename test-match-trees.c => t/helper/test-match-trees.c (100%)\n>  rename test-mergesort.c => t/helper/test-mergesort.c (100%)\n>  rename test-mktemp.c => t/helper/test-mktemp.c (100%)\n>  rename test-parse-options.c => t/helper/test-parse-options.c (100%)\n>  rename test-path-utils.c => t/helper/test-path-utils.c (100%)\n>  rename test-prio-queue.c => t/helper/test-prio-queue.c (100%)\n>  rename test-read-cache.c => t/helper/test-read-cache.c (100%)\n>  rename test-regex.c => t/helper/test-regex.c (100%)\n>  rename test-revision-walking.c => t/helper/test-revision-walking.c (100%)\n>  rename test-run-command.c => t/helper/test-run-command.c (100%)\n>  rename test-scrap-cache-tree.c => t/helper/test-scrap-cache-tree.c (100%)\n>  rename test-sha1-array.c => t/helper/test-sha1-array.c (100%)\n>  rename test-sha1.c => t/helper/test-sha1.c (100%)\n>  rename test-sha1.sh => t/helper/test-sha1.sh (96%)\n>  rename test-sigchain.c => t/helper/test-sigchain.c (100%)\n>  rename test-string-list.c => t/helper/test-string-list.c (100%)\n>  rename test-submodule-config.c => t/helper/test-submodule-config.c (100%)\n>  rename test-subprocess.c => t/helper/test-subprocess.c (100%)\n>  rename test-svn-fe.c => t/helper/test-svn-fe.c (100%)\n>  rename test-urlmatch-normalization.c => t/helper/test-urlmatch-normalization.c (100%)\n>  rename test-wildmatch.c => t/helper/test-wildmatch.c (100%)\n>\n> diff --git a/.gitignore b/.gitignore\n> index 5087ce1..05cb58a 100644\n> --- a/.gitignore\n> +++ b/.gitignore\n> @@ -179,39 +179,6 @@\n>  /gitweb/gitweb.cgi\n>  /gitweb/static/gitweb.js\n>  /gitweb/static/gitweb.min.*\n> -/test-chmtime\n> -/test-ctype\n> -/test-config\n> -/test-date\n> -/test-delta\n> -/test-dump-cache-tree\n> -/test-dump-split-index\n> -/test-dump-untracked-cache\n> -/test-fake-ssh\n> -/test-scrap-cache-tree\n> -/test-genrandom\n> -/test-hashmap\n> -/test-index-version\n> -/test-line-buffer\n> -/test-match-trees\n> -/test-mergesort\n> -/test-mktemp\n> -/test-parse-options\n> -/test-path-utils\n> -/test-prio-queue\n> -/test-read-cache\n> -/test-regex\n> -/test-revision-walking\n> -/test-run-command\n> -/test-sha1\n> -/test-sha1-array\n> -/test-sigchain\n> -/test-string-list\n> -/test-submodule-config\n> -/test-subprocess\n> -/test-svn-fe\n> -/test-urlmatch-normalization\n> -/test-wildmatch\n>  /common-cmds.h\n>  *.tar.gz\n>  *.dsc\n> diff --git a/Makefile b/Makefile\n> index 2742a69..0a5fb9d 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -624,7 +624,7 @@ TEST_PROGRAMS_NEED_X += test-svn-fe\n>  TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n>  TEST_PROGRAMS_NEED_X += test-wildmatch\n>  \n> -TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))\n> +TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))\n>  \n>  # List built-in command $C whose implementation cmd_$C() is not in\n>  # builtin/$C.o but is linked in as part of some other command.\n> @@ -1904,7 +1904,7 @@ VCSSVN_OBJS += vcs-svn/fast_export.o\n>  VCSSVN_OBJS += vcs-svn/svndiff.o\n>  VCSSVN_OBJS += vcs-svn/svndump.o\n>  \n> -TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))\n> +TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))\n>  OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n>  \t$(XDIFF_OBJS) \\\n>  \t$(VCSSVN_OBJS) \\\n> @@ -2211,7 +2211,7 @@ 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|@@BUILD_DIR@@|$(shell pwd)|' \\\n> -\t     -e 's|@@PROG@@|$(@F)|' < $< > $@ && \\\n> +\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\n>  \tchmod +x $@\n>  \n>  # GNU make supports exporting all variables by \"export\" without parameters.\n> @@ -2231,25 +2231,25 @@ perf: all\n>  \n>  .PHONY: test perf\n>  \n> -test-ctype$X: ctype.o\n> +t/helper/test-ctype$X: ctype.o\n>  \n> -test-date$X: date.o ctype.o\n> +t/helper/test-date$X: date.o ctype.o\n>  \n> -test-delta$X: diff-delta.o patch-delta.o\n> +t/helper/test-delta$X: diff-delta.o patch-delta.o\n>  \n> -test-line-buffer$X: vcs-svn/lib.a\n> +t/helper/test-line-buffer$X: vcs-svn/lib.a\n>  \n> -test-parse-options$X: parse-options.o parse-options-cb.o\n> +t/helper/test-parse-options$X: parse-options.o parse-options-cb.o\n>  \n> -test-svn-fe$X: vcs-svn/lib.a\n> +t/helper/test-svn-fe$X: vcs-svn/lib.a\n>  \n>  .PRECIOUS: $(TEST_OBJS)\n>  \n> -test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)\n> +t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n>  \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n>  \n> -check-sha1:: test-sha1$X\n> -\t./test-sha1.sh\n> +check-sha1:: t/helper/test-sha1$X\n> +\tt/helper/test-sha1.sh\n>  \n>  SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\n>  \n> diff --git a/t/helper/.gitignore b/t/helper/.gitignore\n> new file mode 100644\n> index 0000000..d6e8b36\n> --- /dev/null\n> +++ b/t/helper/.gitignore\n> @@ -0,0 +1,33 @@\n> +/test-chmtime\n> +/test-ctype\n> +/test-config\n> +/test-date\n> +/test-delta\n> +/test-dump-cache-tree\n> +/test-dump-split-index\n> +/test-dump-untracked-cache\n> +/test-fake-ssh\n> +/test-scrap-cache-tree\n> +/test-genrandom\n> +/test-hashmap\n> +/test-index-version\n> +/test-line-buffer\n> +/test-match-trees\n> +/test-mergesort\n> +/test-mktemp\n> +/test-parse-options\n> +/test-path-utils\n> +/test-prio-queue\n> +/test-read-cache\n> +/test-regex\n> +/test-revision-walking\n> +/test-run-command\n> +/test-sha1\n> +/test-sha1-array\n> +/test-sigchain\n> +/test-string-list\n> +/test-submodule-config\n> +/test-subprocess\n> +/test-svn-fe\n> +/test-urlmatch-normalization\n> +/test-wildmatch\n> diff --git a/test-chmtime.c b/t/helper/test-chmtime.c\n> similarity index 100%\n> rename from test-chmtime.c\n> rename to t/helper/test-chmtime.c\n> diff --git a/test-config.c b/t/helper/test-config.c\n> similarity index 100%\n> rename from test-config.c\n> rename to t/helper/test-config.c\n> diff --git a/test-ctype.c b/t/helper/test-ctype.c\n> similarity index 100%\n> rename from test-ctype.c\n> rename to t/helper/test-ctype.c\n> diff --git a/test-date.c b/t/helper/test-date.c\n> similarity index 100%\n> rename from test-date.c\n> rename to t/helper/test-date.c\n> diff --git a/test-delta.c b/t/helper/test-delta.c\n> similarity index 100%\n> rename from test-delta.c\n> rename to t/helper/test-delta.c\n> diff --git a/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\n> similarity index 100%\n> rename from test-dump-cache-tree.c\n> rename to t/helper/test-dump-cache-tree.c\n> diff --git a/test-dump-split-index.c b/t/helper/test-dump-split-index.c\n> similarity index 100%\n> rename from test-dump-split-index.c\n> rename to t/helper/test-dump-split-index.c\n> diff --git a/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c\n> similarity index 100%\n> rename from test-dump-untracked-cache.c\n> rename to t/helper/test-dump-untracked-cache.c\n> diff --git a/test-fake-ssh.c b/t/helper/test-fake-ssh.c\n> similarity index 100%\n> rename from test-fake-ssh.c\n> rename to t/helper/test-fake-ssh.c\n> diff --git a/test-genrandom.c b/t/helper/test-genrandom.c\n> similarity index 100%\n> rename from test-genrandom.c\n> rename to t/helper/test-genrandom.c\n> diff --git a/test-hashmap.c b/t/helper/test-hashmap.c\n> similarity index 100%\n> rename from test-hashmap.c\n> rename to t/helper/test-hashmap.c\n> diff --git a/test-index-version.c b/t/helper/test-index-version.c\n> similarity index 100%\n> rename from test-index-version.c\n> rename to t/helper/test-index-version.c\n> diff --git a/test-line-buffer.c b/t/helper/test-line-buffer.c\n> similarity index 100%\n> rename from test-line-buffer.c\n> rename to t/helper/test-line-buffer.c\n> diff --git a/test-match-trees.c b/t/helper/test-match-trees.c\n> similarity index 100%\n> rename from test-match-trees.c\n> rename to t/helper/test-match-trees.c\n> diff --git a/test-mergesort.c b/t/helper/test-mergesort.c\n> similarity index 100%\n> rename from test-mergesort.c\n> rename to t/helper/test-mergesort.c\n> diff --git a/test-mktemp.c b/t/helper/test-mktemp.c\n> similarity index 100%\n> rename from test-mktemp.c\n> rename to t/helper/test-mktemp.c\n> diff --git a/test-parse-options.c b/t/helper/test-parse-options.c\n> similarity index 100%\n> rename from test-parse-options.c\n> rename to t/helper/test-parse-options.c\n> diff --git a/test-path-utils.c b/t/helper/test-path-utils.c\n> similarity index 100%\n> rename from test-path-utils.c\n> rename to t/helper/test-path-utils.c\n> diff --git a/test-prio-queue.c b/t/helper/test-prio-queue.c\n> similarity index 100%\n> rename from test-prio-queue.c\n> rename to t/helper/test-prio-queue.c\n> diff --git a/test-read-cache.c b/t/helper/test-read-cache.c\n> similarity index 100%\n> rename from test-read-cache.c\n> rename to t/helper/test-read-cache.c\n> diff --git a/test-regex.c b/t/helper/test-regex.c\n> similarity index 100%\n> rename from test-regex.c\n> rename to t/helper/test-regex.c\n> diff --git a/test-revision-walking.c b/t/helper/test-revision-walking.c\n> similarity index 100%\n> rename from test-revision-walking.c\n> rename to t/helper/test-revision-walking.c\n> diff --git a/test-run-command.c b/t/helper/test-run-command.c\n> similarity index 100%\n> rename from test-run-command.c\n> rename to t/helper/test-run-command.c\n> diff --git a/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\n> similarity index 100%\n> rename from test-scrap-cache-tree.c\n> rename to t/helper/test-scrap-cache-tree.c\n> diff --git a/test-sha1-array.c b/t/helper/test-sha1-array.c\n> similarity index 100%\n> rename from test-sha1-array.c\n> rename to t/helper/test-sha1-array.c\n> diff --git a/test-sha1.c b/t/helper/test-sha1.c\n> similarity index 100%\n> rename from test-sha1.c\n> rename to t/helper/test-sha1.c\n> diff --git a/test-sha1.sh b/t/helper/test-sha1.sh\n> similarity index 96%\n> rename from test-sha1.sh\n> rename to t/helper/test-sha1.sh\n> index cef4bcc..750b95a 100755\n> --- a/test-sha1.sh\n> +++ b/t/helper/test-sha1.sh\n> @@ -1,7 +1,7 @@\n>  #!/bin/sh\n>  \n>  dd if=/dev/zero bs=1048576 count=100 2>/dev/null |\n> -/usr/bin/time ./test-sha1 >/dev/null\n> +/usr/bin/time t/helper/test-sha1 >/dev/null\n>  \n>  while read expect cnt pfx\n>  do\n> @@ -11,7 +11,7 @@ do\n>  \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n>  \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n>  \t\t\tperl -pe 'y/\\000/g/'\n> -\t\t} | ./test-sha1 $cnt\n> +\t\t} | ./t/helper/test-sha1 $cnt\n>  \t)\n>  \tif test \"$expect\" = \"$actual\"\n>  \tthen\n> diff --git a/test-sigchain.c b/t/helper/test-sigchain.c\n> similarity index 100%\n> rename from test-sigchain.c\n> rename to t/helper/test-sigchain.c\n> diff --git a/test-string-list.c b/t/helper/test-string-list.c\n> similarity index 100%\n> rename from test-string-list.c\n> rename to t/helper/test-string-list.c\n> diff --git a/test-submodule-config.c b/t/helper/test-submodule-config.c\n> similarity index 100%\n> rename from test-submodule-config.c\n> rename to t/helper/test-submodule-config.c\n> diff --git a/test-subprocess.c b/t/helper/test-subprocess.c\n> similarity index 100%\n> rename from test-subprocess.c\n> rename to t/helper/test-subprocess.c\n> diff --git a/test-svn-fe.c b/t/helper/test-svn-fe.c\n> similarity index 100%\n> rename from test-svn-fe.c\n> rename to t/helper/test-svn-fe.c\n> diff --git a/test-urlmatch-normalization.c b/t/helper/test-urlmatch-normalization.c\n> similarity index 100%\n> rename from test-urlmatch-normalization.c\n> rename to t/helper/test-urlmatch-normalization.c\n> diff --git a/test-wildmatch.c b/t/helper/test-wildmatch.c\n> similarity index 100%\n> rename from test-wildmatch.c\n> rename to t/helper/test-wildmatch.c\n> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\n> index c1efb8e..150aeaf 100755\n> --- a/t/t5601-clone.sh\n> +++ b/t/t5601-clone.sh\n> @@ -308,7 +308,7 @@ test_expect_success 'clone checking out a tag' '\n>  \n>  setup_ssh_wrapper () {\n>  \ttest_expect_success 'setup ssh wrapper' '\n> -\t\tcp \"$GIT_BUILD_DIR/test-fake-ssh$X\" \\\n> +\t\tcp \"$GIT_BUILD_DIR/t/helper/test-fake-ssh$X\" \\\n>  \t\t\t\"$TRASH_DIRECTORY/ssh-wrapper$X\" &&\n>  \t\tGIT_SSH=\"$TRASH_DIRECTORY/ssh-wrapper$X\" &&\n>  \t\texport GIT_SSH &&\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 0b47eb6..cd0ecd4 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -854,10 +854,10 @@ test -d \"$GIT_BUILD_DIR\"/templates/blt || {\n>  \terror \"You haven't built things yet, have you?\"\n>  }\n>  \n> -if ! test -x \"$GIT_BUILD_DIR\"/test-chmtime\n> +if ! test -x \"$GIT_BUILD_DIR\"/t/helper/test-chmtime\n>  then\n>  \techo >&2 'You need to build test-chmtime:'\n> -\techo >&2 'Run \"make test-chmtime\" in the source (toplevel) directory'\n> +\techo >&2 'Run \"make t/helper/test-chmtime\" in the source (toplevel) directory'\n>  \texit 1\n>  fi\n"},{"id":"283544","messageId":"xmqqa8kudcnn.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"xmqqtwj2di3r.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-15T17:06:52Z","receivedAt":"2016-04-15T17:06:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>\n>> This keeps top dir a bit less crowded. And because these programs are\n>> for testing purposes, it makes sense that they stay somewhere in t/\n>\n> But leaves many *.o files after \"make clean\".  Even \"distclean\" does\n> not clean them.\n\nPerhaps something like this as a preparatory patch, to protect us\nfrom future breakages similar to this change.\n\n-- >8 --\nSubject: Makefile: clean *.o files we create\n\nThe part that removes object files in the 'clean' target predates\nvarious Makefile macros that list object files we create, and\ninstead removes the objects with shell glob, perpetually requiring\nupdates whenever a new location that builds object files is added.\n\nSimplify the target by removing $(OBJECTS), which is supposed to\nhave all the objects we create during the build.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex fe0bf7d..69d32bf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2456,8 +2456,8 @@ profile-clean:\n \t$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))\n \n clean: profile-clean coverage-clean\n-\t$(RM) *.o *.res refs/*.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o\n-\t$(RM) xdiff/*.o vcs-svn/*.o ewah/*.o builtin/*.o\n+\t$(RM) *.res\n+\t$(RM) $(OBJECTS)\n \t$(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X\n \t$(RM) $(TEST_PROGRAMS) $(NO_INSTALL)\n"},{"id":"283625","messageId":"CACsJy8AqoRq3SRATvP6Ww3s9cnzkSKCvhEA8UbAVdhQF_=aYew@mail.gmail.com","threadId":"42018","inReplyTo":"xmqqa8kudcnn.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-04-16T00:08:32Z","receivedAt":"2016-04-16T00:08:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Apr 16, 2016 at 12:06 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>>\n>>> This keeps top dir a bit less crowded. And because these programs are\n>>> for testing purposes, it makes sense that they stay somewhere in t/\n>>\n>> But leaves many *.o files after \"make clean\".  Even \"distclean\" does\n>> not clean them.\n>\n> Perhaps something like this as a preparatory patch, to protect us\n> from future breakages similar to this change.\n\nYes. Much better than adding t/helper/*.o there. Thanks.\n\n>\n> -- >8 --\n> Subject: Makefile: clean *.o files we create\n>\n> The part that removes object files in the 'clean' target predates\n> various Makefile macros that list object files we create, and\n> instead removes the objects with shell glob, perpetually requiring\n> updates whenever a new location that builds object files is added.\n>\n> Simplify the target by removing $(OBJECTS), which is supposed to\n> have all the objects we create during the build.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  Makefile | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index fe0bf7d..69d32bf 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2456,8 +2456,8 @@ profile-clean:\n>         $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))\n>\n>  clean: profile-clean coverage-clean\n> -       $(RM) *.o *.res refs/*.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o\n> -       $(RM) xdiff/*.o vcs-svn/*.o ewah/*.o builtin/*.o\n> +       $(RM) *.res\n> +       $(RM) $(OBJECTS)\n>         $(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)\n>         $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X\n>         $(RM) $(TEST_PROGRAMS) $(NO_INSTALL)\n\n\n\n-- \nDuy\n"},{"id":"284611","messageId":"xmqqwpnkc9ca.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"1460553762-12419-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-26T22:07:49Z","receivedAt":"2016-04-26T22:07:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> This keeps top dir a bit less crowded. And because these programs are\n> for testing purposes, it makes sense that they stay somewhere in t/\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  This patch will break any patches that add new test programs.\n>  Luckily, none in 'next' or 'pu' does that. I know lmdb backend adds\n>  test-lmdb-backend, so a manual move and some .gitignore fixup is\n>  required there.\n\nCan you (or somebody else) double check that the resulting Makefile\ngets the build dependencies and exec path right?\n\nI am seeing occasional failure from t0040 when checking out between\nmaster and pu, and between the branches test-parse-options do change\nbehaviour which explains the breakage.\n"},{"id":"284622","messageId":"CACsJy8A8vbp4-LrxoNX510Nme97EKfu0hBBs-LDRap1Z5=v3rA@mail.gmail.com","threadId":"42018","inReplyTo":"xmqqwpnkc9ca.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-04-27T00:52:41Z","receivedAt":"2016-04-27T00:52:41Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 27, 2016 at 5:07 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>\n>> This keeps top dir a bit less crowded. And because these programs are\n>> for testing purposes, it makes sense that they stay somewhere in t/\n>>\n>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n>> ---\n>>  This patch will break any patches that add new test programs.\n>>  Luckily, none in 'next' or 'pu' does that. I know lmdb backend adds\n>>  test-lmdb-backend, so a manual move and some .gitignore fixup is\n>>  required there.\n>\n> Can you (or somebody else) double check that the resulting Makefile\n> gets the build dependencies and exec path right?\n>\n> I am seeing occasional failure from t0040 when checking out between\n> master and pu, and between the branches test-parse-options do change\n> behaviour which explains the breakage.\n\nI looked at \"make -p\" and saw nothing wrong with build rules. A bit\nconcerned about fa8fe28 (Makefile: do not allow gnu make to remove\ntest-*.o files - 2007-08-30) because make info pages say it could\nleave probably broken .o files when make is interrupted. But that's\nprobably not it.\n\nThere is a problem moving between master and next/pu though.\nbin-wrappers is not regenerated after the move so it could point to\nthe old binaries (in the other place). Not sure how to fix that\ncleanly, will think of something, maybe, in about 8 hours.\n-- \nDuy\n"},{"id":"284639","messageId":"20160427101833.GA5536@lanh","threadId":"42018","inReplyTo":"CACsJy8A8vbp4-LrxoNX510Nme97EKfu0hBBs-LDRap1Z5=v3rA@mail.gmail.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-04-27T10:18:34Z","receivedAt":"2016-04-27T10:18:34Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 27, 2016 at 07:52:41AM +0700, Duy Nguyen wrote:\n> > Can you (or somebody else) double check that the resulting Makefile\n> > gets the build dependencies and exec path right?\n> >\n> > I am seeing occasional failure from t0040 when checking out between\n> > master and pu, and between the branches test-parse-options do change\n> > behaviour which explains the breakage.\n> \n> There is a problem moving between master and next/pu though.\n> bin-wrappers is not regenerated after the move so it could point to\n> the old binaries (in the other place). Not sure how to fix that\n> cleanly, will think of something, maybe, in about 8 hours.\n\nThis patch forces bin-wrappers regeneration every time a test program\nis updated. A bit wasteful, but I don't see a better option (which is\nalso why I limit this to test programs only).\n\nA similar patch (without \"t/helper/\") could be applied on\nmaint/master, otherwise bin-wrappers is still not updated when moving\nback from next/pu. And of course the problem will pop up again if you\nbuild old history...\n\n-- 8< --\ndiff --git a/Makefile b/Makefile\nindex dd178ee..6b6a844 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2196,10 +2196,13 @@ GIT-PYTHON-VARS: FORCE\n endif\n \n test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))\n+bindir_test_programs := $(patsubst %,bin-wrappers/%,$(TEST_PROGRAMS_NEED_X))\n \n all:: $(TEST_PROGRAMS) $(test_bindir_programs)\n all:: $(NO_INSTALL)\n \n+$(bindir_test_programs): bin-wrappers/%: t/helper/%$X\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-- 8< --\n\n-- \nDuy\n"},{"id":"284662","messageId":"xmqqy47z9geq.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"20160427101833.GA5536@lanh","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-27T16:15:41Z","receivedAt":"2016-04-27T16:15:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> This patch forces bin-wrappers regeneration every time a test program\n> is updated. A bit wasteful, but I don't see a better option (which is\n> also why I limit this to test programs only).\n\nIn other words, when we update the location where the programs that\nwould be eventually installed are created, we'd see the same\nproblem.\n\nI actually wonder if it is a better overall structure to move\nt/helper/test-foo back to test-foo, while keeping the source file\nthat contains main() for test-foo at t/helper/test-foo.c.  Then we\ndo not have to have many copies that are slightly different in\nbin-wrappers, but they can all be\n\n\texec \"${GIT_EXEC_PATH}/$0\" \"$@\"\n\ninstead of \"bin-wrappers/git-bar\" being\n\n\texec \"${GIT_EXEC_PATH}/git-bar\" \"$@\"\n\nand \"bin-wrappers/test-foo\" being\n\n\texec \"${GIT_EXEC_PATH}/t/helper/test-foo\" \"$@\"\n"},{"id":"285057","messageId":"20160501002852.GA3963@lanh","threadId":"42018","inReplyTo":"xmqqy47z9geq.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-05-01T00:28:52Z","receivedAt":"2016-05-01T00:28:52Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 27, 2016 at 09:15:41AM -0700, Junio C Hamano wrote:\n> Duy Nguyen <pclouds@gmail.com> writes:\n> \n> > This patch forces bin-wrappers regeneration every time a test program\n> > is updated. A bit wasteful, but I don't see a better option (which is\n> > also why I limit this to test programs only).\n> \n> In other words, when we update the location where the programs that\n> would be eventually installed are created, we'd see the same\n> problem.\n> \n> I actually wonder if it is a better overall structure to move\n> t/helper/test-foo back to test-foo, while keeping the source file\n> that contains main() for test-foo at t/helper/test-foo.c.  Then we\n> do not have to have many copies that are slightly different in\n> bin-wrappers, but they can all be\n> \n> \texec \"${GIT_EXEC_PATH}/$0\" \"$@\"\n> \n> instead of \"bin-wrappers/git-bar\" being\n> \n> \texec \"${GIT_EXEC_PATH}/git-bar\" \"$@\"\n> \n> and \"bin-wrappers/test-foo\" being\n> \n> \texec \"${GIT_EXEC_PATH}/t/helper/test-foo\" \"$@\"\n> \n\nIt's not a perfect solution (rebuild bin-wrappers when the real binary\nmoves) but I think it's the best option so far. We can move test-*\nbinaries back with this patch.\n\n-- 8< --\ndiff --git a/.gitignore b/.gitignore\nindex 05cb58a..5087ce1 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -179,6 +179,39 @@\n /gitweb/gitweb.cgi\n /gitweb/static/gitweb.js\n /gitweb/static/gitweb.min.*\n+/test-chmtime\n+/test-ctype\n+/test-config\n+/test-date\n+/test-delta\n+/test-dump-cache-tree\n+/test-dump-split-index\n+/test-dump-untracked-cache\n+/test-fake-ssh\n+/test-scrap-cache-tree\n+/test-genrandom\n+/test-hashmap\n+/test-index-version\n+/test-line-buffer\n+/test-match-trees\n+/test-mergesort\n+/test-mktemp\n+/test-parse-options\n+/test-path-utils\n+/test-prio-queue\n+/test-read-cache\n+/test-regex\n+/test-revision-walking\n+/test-run-command\n+/test-sha1\n+/test-sha1-array\n+/test-sigchain\n+/test-string-list\n+/test-submodule-config\n+/test-subprocess\n+/test-svn-fe\n+/test-urlmatch-normalization\n+/test-wildmatch\n /common-cmds.h\n *.tar.gz\n *.dsc\ndiff --git a/Makefile b/Makefile\nindex dd178ee..7a1c973 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -620,7 +620,7 @@ TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n TEST_PROGRAMS_NEED_X += test-wildmatch\n \n-TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))\n+TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))\n \n # List built-in command $C whose implementation cmd_$C() is not in\n # builtin/$C.o but is linked in as part of some other command.\n@@ -1897,7 +1897,7 @@ VCSSVN_OBJS += vcs-svn/fast_export.o\n VCSSVN_OBJS += vcs-svn/svndiff.o\n VCSSVN_OBJS += vcs-svn/svndump.o\n \n-TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))\n+TEST_OBJS := $(patsubst %,t/helper/%.o,$(TEST_PROGRAMS_NEED_X))\n OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n \t$(XDIFF_OBJS) \\\n \t$(VCSSVN_OBJS) \\\n@@ -2204,7 +2204,7 @@ 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|@@BUILD_DIR@@|$(shell pwd)|' \\\n-\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\n+\t     -e 's|@@PROG@@|$(@F)|'< $< > $@ && \\\n \tchmod +x $@\n \n # GNU make supports exporting all variables by \"export\" without parameters.\n@@ -2224,24 +2224,24 @@ perf: all\n \n .PHONY: test perf\n \n-t/helper/test-ctype$X: ctype.o\n+test-ctype$X: ctype.o\n \n-t/helper/test-date$X: date.o ctype.o\n+test-date$X: date.o ctype.o\n \n-t/helper/test-delta$X: diff-delta.o patch-delta.o\n+test-delta$X: diff-delta.o patch-delta.o\n \n-t/helper/test-line-buffer$X: vcs-svn/lib.a\n+test-line-buffer$X: vcs-svn/lib.a\n \n-t/helper/test-parse-options$X: parse-options.o parse-options-cb.o\n+test-parse-options$X: parse-options.o parse-options-cb.o\n \n-t/helper/test-svn-fe$X: vcs-svn/lib.a\n+test-svn-fe$X: vcs-svn/lib.a\n \n .PRECIOUS: $(TEST_OBJS)\n \n-t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n+test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n \n-check-sha1:: t/helper/test-sha1$X\n+check-sha1:: test-sha1$X\n \tt/helper/test-sha1.sh\n \n SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\ndiff --git a/t/helper/test-sha1.sh b/t/helper/test-sha1.sh\nindex 750b95a..cef4bcc 100755\n--- a/t/helper/test-sha1.sh\n+++ b/t/helper/test-sha1.sh\n@@ -1,7 +1,7 @@\n #!/bin/sh\n \n dd if=/dev/zero bs=1048576 count=100 2>/dev/null |\n-/usr/bin/time t/helper/test-sha1 >/dev/null\n+/usr/bin/time ./test-sha1 >/dev/null\n \n while read expect cnt pfx\n do\n@@ -11,7 +11,7 @@ do\n \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n \t\t\tperl -pe 'y/\\000/g/'\n-\t\t} | ./t/helper/test-sha1 $cnt\n+\t\t} | ./test-sha1 $cnt\n \t)\n \tif test \"$expect\" = \"$actual\"\n \tthen\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 150aeaf..c1efb8e 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -308,7 +308,7 @@ test_expect_success 'clone checking out a tag' '\n \n setup_ssh_wrapper () {\n \ttest_expect_success 'setup ssh wrapper' '\n-\t\tcp \"$GIT_BUILD_DIR/t/helper/test-fake-ssh$X\" \\\n+\t\tcp \"$GIT_BUILD_DIR/test-fake-ssh$X\" \\\n \t\t\t\"$TRASH_DIRECTORY/ssh-wrapper$X\" &&\n \t\tGIT_SSH=\"$TRASH_DIRECTORY/ssh-wrapper$X\" &&\n \t\texport GIT_SSH &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex cd0ecd4..0b47eb6 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -854,10 +854,10 @@ test -d \"$GIT_BUILD_DIR\"/templates/blt || {\n \terror \"You haven't built things yet, have you?\"\n }\n \n-if ! test -x \"$GIT_BUILD_DIR\"/t/helper/test-chmtime\n+if ! test -x \"$GIT_BUILD_DIR\"/test-chmtime\n then\n \techo >&2 'You need to build test-chmtime:'\n-\techo >&2 'Run \"make t/helper/test-chmtime\" in the source (toplevel) directory'\n+\techo >&2 'Run \"make test-chmtime\" in the source (toplevel) directory'\n \texit 1\n fi\n-- 8< --\n \n"},{"id":"285058","messageId":"20160501060009.GA30748@lanh","threadId":"42018","inReplyTo":"20160501002852.GA3963@lanh","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-05-01T06:00:09Z","receivedAt":"2016-05-01T06:00:09Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, May 01, 2016 at 07:28:52AM +0700, Duy Nguyen wrote:\n> On Wed, Apr 27, 2016 at 09:15:41AM -0700, Junio C Hamano wrote:\n> > Duy Nguyen <pclouds@gmail.com> writes:\n> > \n> > > This patch forces bin-wrappers regeneration every time a test program\n> > > is updated. A bit wasteful, but I don't see a better option (which is\n> > > also why I limit this to test programs only).\n> > \n> > In other words, when we update the location where the programs that\n> > would be eventually installed are created, we'd see the same\n> > problem.\n> > \n> > I actually wonder if it is a better overall structure to move\n> > t/helper/test-foo back to test-foo, while keeping the source file\n> > that contains main() for test-foo at t/helper/test-foo.c.  Then we\n> > do not have to have many copies that are slightly different in\n> > bin-wrappers, but they can all be\n> > \n> > \texec \"${GIT_EXEC_PATH}/$0\" \"$@\"\n> > \n> > instead of \"bin-wrappers/git-bar\" being\n> > \n> > \texec \"${GIT_EXEC_PATH}/git-bar\" \"$@\"\n> > \n> > and \"bin-wrappers/test-foo\" being\n> > \n> > \texec \"${GIT_EXEC_PATH}/t/helper/test-foo\" \"$@\"\n> > \n> \n> It's not a perfect solution (rebuild bin-wrappers when the real binary\n> moves) but I think it's the best option so far.\n\nI may have rushed to judgement. wrap-for-bin.sh has always been the\ndependency for bin-wrappers/*. If we force that file to change, then\nbin-wrappers/* will be recreated when switching branches. So how about\nthis?\n\n-- 8< --\nSubject: [PATCH] wrap-for-bin.sh: handle t/helper/ paths internally\n\nCommit e6e7530 (test helpers: move test-* to t/helper/ subdirectory -\n2016-04-13) moves test-* to t/helper. However because bin-wrappers/*\nonly depend on wrap-for-bin.sh, when switching between a branch that has\nthis commit and one that does not, bin-wrappers/* may not be regenerated\nand point to the old/outdated test programs. Fix it by force updating\nwrap-for-bin.sh so that it will be regenerated anyway.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile        |  2 +-\n wrap-for-bin.sh | 12 ++++++++++--\n 2 files changed, 11 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex dd178ee..38dcdf7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2204,7 +2204,7 @@ 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|@@BUILD_DIR@@|$(shell pwd)|' \\\n-\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\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 db0ec6a..bb334ed 100644\n--- a/wrap-for-bin.sh\n+++ b/wrap-for-bin.sh\n@@ -18,11 +18,19 @@ GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'\"${GITPERLLIB:+:$GITPERLLIB}\"\n GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n+case \"@@PATH@@\" in\n+    test-*)\n+\tPROG=\"${GIT_EXEC_PATH}/t/helper/@@PROG@@\"\n+\t;;\n+    *)\n+\tPROG=\"${GIT_EXEC_PATH}/@@PROG@@\"\n+\t;;\n+esac\n \n if test -n \"$GIT_TEST_GDB\"\n then\n \tunset GIT_TEST_GDB\n-\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+\texec gdb --args \"$PROG\" \"$@\"\n else\n-\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+\texec \"$PROG\" \"$@\"\n fi\n-- \n2.8.0.rc0.210.gd302cd2\n-- 8< --\n"},{"id":"285167","messageId":"xmqqk2jcuzx7.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"20160501060009.GA30748@lanh","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-02T17:34:28Z","receivedAt":"2016-05-02T17:34:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> I may have rushed to judgement. wrap-for-bin.sh has always been the\n> dependency for bin-wrappers/*. If we force that file to change, then\n> bin-wrappers/* will be recreated when switching branches. So how about\n> this?\n\nI do not think you are \"force updating wrap-for-bin\" in any way in\nthe patch, though.  You are building it in such a way that it does\nnot have to get updated within the revision that contains e6e7530\n(assuming that this will be queued directly on top it and merged to\neverywhere e6e7530 is contained).\n\nThe new case/esac looks somewhat bad (its knowing that where test-*\nlives, test-* is the only thing that is special, etc. troubles me at\nthe same time that case/esac is funnily formated).\n\nWhere does \"@@PATH@@\" come from and who rewrites it?  Is that a\nmisspelt \"@@PROG@@\"?\n\n> -- 8< --\n> Subject: [PATCH] wrap-for-bin.sh: handle t/helper/ paths internally\n>\n> Commit e6e7530 (test helpers: move test-* to t/helper/ subdirectory -\n> 2016-04-13) moves test-* to t/helper. However because bin-wrappers/*\n> only depend on wrap-for-bin.sh, when switching between a branch that has\n> this commit and one that does not, bin-wrappers/* may not be regenerated\n> and point to the old/outdated test programs. Fix it by force updating\n> wrap-for-bin.sh so that it will be regenerated anyway.\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  Makefile        |  2 +-\n>  wrap-for-bin.sh | 12 ++++++++++--\n>  2 files changed, 11 insertions(+), 3 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index dd178ee..38dcdf7 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2204,7 +2204,7 @@ 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|@@BUILD_DIR@@|$(shell pwd)|' \\\n> -\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\n> +\t     -e 's|@@PROG@@|$(@F)|' < $< > $@ && \\\n>  \tchmod +x $@\n>  \n>  # GNU make supports exporting all variables by \"export\" without parameters.\n> diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\n> index db0ec6a..bb334ed 100644\n> --- a/wrap-for-bin.sh\n> +++ b/wrap-for-bin.sh\n> @@ -18,11 +18,19 @@ GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'\"${GITPERLLIB:+:$GITPERLLIB}\"\n>  GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n>  PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n>  export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n> +case \"@@PATH@@\" in\n> +    test-*)\n> +\tPROG=\"${GIT_EXEC_PATH}/t/helper/@@PROG@@\"\n> +\t;;\n> +    *)\n> +\tPROG=\"${GIT_EXEC_PATH}/@@PROG@@\"\n> +\t;;\n> +esac\n>  \n>  if test -n \"$GIT_TEST_GDB\"\n>  then\n>  \tunset GIT_TEST_GDB\n> -\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> +\texec gdb --args \"$PROG\" \"$@\"\n>  else\n> -\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> +\texec \"$PROG\" \"$@\"\n>  fi\n"},{"id":"285233","messageId":"CACsJy8B16SWsu5xTHdPcR4dz4_z+Br5EGGbJ+B5SChA=sWo-bg@mail.gmail.com","threadId":"42018","inReplyTo":"xmqqk2jcuzx7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-05-03T00:15:38Z","receivedAt":"2016-05-03T00:15:38Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 3, 2016 at 12:34 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Duy Nguyen <pclouds@gmail.com> writes:\n>\n>> I may have rushed to judgement. wrap-for-bin.sh has always been the\n>> dependency for bin-wrappers/*. If we force that file to change, then\n>> bin-wrappers/* will be recreated when switching branches. So how about\n>> this?\n>\n> I do not think you are \"force updating wrap-for-bin\" in any way in\n> the patch, though.  You are building it in such a way that it does\n> not have to get updated within the revision that contains e6e7530\n> (assuming that this will be queued directly on top it and merged to\n> everywhere e6e7530 is contained).\n\nYep.\n\n> The new case/esac looks somewhat bad (its knowing that where test-*\n> lives, test-* is the only thing that is special, etc. troubles me at\n> the same time that case/esac is funnily formated).\n\nWe could just make some random changes in this file. That would have\nthe same effect.\n\n> Where does \"@@PATH@@\" come from and who rewrites it?  Is that a\n> misspelt \"@@PROG@@\"?\n\nYep. Should have run make distclean before testing :(\n-- \nDuy\n"},{"id":"285868","messageId":"CACsJy8DtFLkfqSHRjFU4N9H9C3MfVOn-XEy4yOwneQaatvvDkQ@mail.gmail.com","threadId":"42018","inReplyTo":"CACsJy8B16SWsu5xTHdPcR4dz4_z+Br5EGGbJ+B5SChA=sWo-bg@mail.gmail.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-05-08T09:51:46Z","receivedAt":"2016-05-08T09:51:46Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"So among the options we have so far, which way should we go, or leave it as is?\n\nOn Tue, May 3, 2016 at 7:15 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Tue, May 3, 2016 at 12:34 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Duy Nguyen <pclouds@gmail.com> writes:\n>>\n>>> I may have rushed to judgement. wrap-for-bin.sh has always been the\n>>> dependency for bin-wrappers/*. If we force that file to change, then\n>>> bin-wrappers/* will be recreated when switching branches. So how about\n>>> this?\n>>\n>> I do not think you are \"force updating wrap-for-bin\" in any way in\n>> the patch, though.  You are building it in such a way that it does\n>> not have to get updated within the revision that contains e6e7530\n>> (assuming that this will be queued directly on top it and merged to\n>> everywhere e6e7530 is contained).\n>\n> Yep.\n>\n>> The new case/esac looks somewhat bad (its knowing that where test-*\n>> lives, test-* is the only thing that is special, etc. troubles me at\n>> the same time that case/esac is funnily formated).\n>\n> We could just make some random changes in this file. That would have\n> the same effect.\n>\n>> Where does \"@@PATH@@\" come from and who rewrites it?  Is that a\n>> misspelt \"@@PROG@@\"?\n>\n> Yep. Should have run make distclean before testing :(\n> --\n> Duy\n-- \nDuy\n"},{"id":"285924","messageId":"xmqqposvxlpb.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"CACsJy8DtFLkfqSHRjFU4N9H9C3MfVOn-XEy4yOwneQaatvvDkQ@mail.gmail.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-09T16:03:44Z","receivedAt":"2016-05-09T16:03:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> So among the options we have so far, which way should we go, or leave it as is?\n\nThanks for reminding me.\n\nI like that version you sent with \"I may have rushed to judgment\"\ncomment the most.  Perhaps I can just queue it with s/PATH/PROG/\nfixup?\n\n>\n> On Tue, May 3, 2016 at 7:15 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n>> On Tue, May 3, 2016 at 12:34 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Duy Nguyen <pclouds@gmail.com> writes:\n>>>\n>>>> I may have rushed to judgement. wrap-for-bin.sh has always been the\n>>>> dependency for bin-wrappers/*. If we force that file to change, then\n>>>> bin-wrappers/* will be recreated when switching branches. So how about\n>>>> this?\n>>>\n>>> I do not think you are \"force updating wrap-for-bin\" in any way in\n>>> the patch, though.  You are building it in such a way that it does\n>>> not have to get updated within the revision that contains e6e7530\n>>> (assuming that this will be queued directly on top it and merged to\n>>> everywhere e6e7530 is contained).\n>>\n>> Yep.\n>>\n>>> The new case/esac looks somewhat bad (its knowing that where test-*\n>>> lives, test-* is the only thing that is special, etc. troubles me at\n>>> the same time that case/esac is funnily formated).\n>>\n>> We could just make some random changes in this file. That would have\n>> the same effect.\n>>\n>>> Where does \"@@PATH@@\" come from and who rewrites it?  Is that a\n>>> misspelt \"@@PROG@@\"?\n>>\n>> Yep. Should have run make distclean before testing :(\n>> --\n>> Duy\n"},{"id":"286044","messageId":"20160510115856.GA1964@lanh","threadId":"42018","inReplyTo":"xmqqposvxlpb.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-05-10T11:58:56Z","receivedAt":"2016-05-10T11:58:56Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, May 09, 2016 at 09:03:44AM -0700, Junio C Hamano wrote:\n> Duy Nguyen <pclouds@gmail.com> writes:\n> \n> > So among the options we have so far, which way should we go, or leave it as is?\n> \n> Thanks for reminding me.\n> \n> I like that version you sent with \"I may have rushed to judgment\"\n> comment the most.  Perhaps I can just queue it with s/PATH/PROG/\n> fixup?\n\nOr a simpler, more-to-the-point patch like this?\n\n-- 8< --\nSubject: [PATCH] wrap-for-bin.sh: regenerate bin-wrappers when switching branches\n\nCommit e6e7530 (test helpers: move test-* to t/helper/ subdirectory -\n2016-04-13) moves test-* to t/helper. However because bin-wrappers/*\nonly depend on wrap-for-bin.sh, when switching between a branch that has\nthis commit and one that does not, bin-wrappers/* may not be regenerated\nand point to the old/outdated test programs.\n\nThis commit makes a non-functional change in wrap-for-bin.sh, just\nenough for 'make' to detect and re-execute wrap-for-bin.sh. When\nswitching between a branch containing both this commit and e6e7530 and\none containing neither, bin-wrappers/*, we should get fresh bin-wrappers/*.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n wrap-for-bin.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\nindex db0ec6a..22b6e49 100644\n--- a/wrap-for-bin.sh\n+++ b/wrap-for-bin.sh\n@@ -17,6 +17,7 @@ fi\n GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'\"${GITPERLLIB:+:$GITPERLLIB}\"\n GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n+\n export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n \n if test -n \"$GIT_TEST_GDB\"\n-- \n2.8.2.524.g6ff3d78\n-- 8< --\n--\nDuy\n"},{"id":"286106","messageId":"xmqqbn4doe66.fsf@gitster.mtv.corp.google.com","threadId":"42018","inReplyTo":"20160510115856.GA1964@lanh","subject":"Re: [PATCH] Move test-* to t/helper/ subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-10T20:23:29Z","receivedAt":"2016-05-10T20:23:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> Or a simpler, more-to-the-point patch like this?\n\nI am OK with that, even though I find it a bit too \"cute\" for my\ntaste.\n\n\n\n> -- 8< --\n> Subject: [PATCH] wrap-for-bin.sh: regenerate bin-wrappers when switching branches\n>\n> Commit e6e7530 (test helpers: move test-* to t/helper/ subdirectory -\n> 2016-04-13) moves test-* to t/helper. However because bin-wrappers/*\n> only depend on wrap-for-bin.sh, when switching between a branch that has\n> this commit and one that does not, bin-wrappers/* may not be regenerated\n> and point to the old/outdated test programs.\n>\n> This commit makes a non-functional change in wrap-for-bin.sh, just\n> enough for 'make' to detect and re-execute wrap-for-bin.sh. When\n> switching between a branch containing both this commit and e6e7530 and\n> one containing neither, bin-wrappers/*, we should get fresh bin-wrappers/*.\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  wrap-for-bin.sh | 1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\n> index db0ec6a..22b6e49 100644\n> --- a/wrap-for-bin.sh\n> +++ b/wrap-for-bin.sh\n> @@ -17,6 +17,7 @@ fi\n>  GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'\"${GITPERLLIB:+:$GITPERLLIB}\"\n>  GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n>  PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n> +\n>  export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n>  \n>  if test -n \"$GIT_TEST_GDB\"\n"}]}