{"thread":{"id":"48064","subject":"[PATCH 00/36] Combine t/helper binaries into a single one","startedAt":"2018-03-17T07:55:38Z","lastAt":"2018-03-27T16:13:06Z","messageCount":110,"participants":["Nguyễn Thái Ngọc Duy","Eric Sunshine","Duy Nguyen","Jeff Hostetler","Ævar Arnfjörð Bjarmason","Junio C Hamano","Johannes Schindelin","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":36},"messages":[{"id":"341973","messageId":"20180317075421.22032-1-pclouds@gmail.com","threadId":"48064","inReplyTo":null,"subject":"[PATCH 00/36] Combine t/helper binaries into a single one","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:45Z","receivedAt":"2018-03-17T07:55:38Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The number of t/helper binaries is growing, which slows down build\nprocess due to increasing link time and also consumes more disk space.\nThis series combines most of them into a new binary called test-tool.\n\nGoing forward, new test helper programs should be part of this\ntest-tool (with few exceptions).\n\nInteresting numbers and exceptions are in 01/36. The four most\ninteresting patches are at the top. The rest is boring mechanical\nsearch and replace.\n\nNguyễn Thái Ngọc Duy (36):\n  t/helper: add an empty test-tool program\n  t/helper: merge test-chmtime into test-tool\n  t/helper: merge test-sha1 into test-tool\n  t/helper: merge test-lazy-init-name-hash into test-tool\n  t/helper: merge test-config into test-tool\n  t/helper: merge test-ctype into test-tool\n  t/helper: merge test-date into test-tool\n  t/helper: merge (unused) test-delta into test-tool\n  t/helper: merge test-drop-caches into test-tool\n  t/helper: merge test-dump-cache-tree into test-tool\n  t/helper: merge test-dump-split-index into test-tool\n  t/helper: merge test-example-decorate into test-tool\n  t/helper: merge test-genrandom into test-tool\n  t/helper: merge test-hashmap into test-tool\n  t/helper: merge test-index-version into test-tool\n  t/helper: merge (unused) test-match-trees into test-tool\n  t/helper: merge (unused) test-mergesort into test-tool\n  t/helper: merge test-mktemp into test-tool\n  t/helper: merge test-online-cpus into test-tool\n  t/helper: merge test-path-utils into test-tool\n  t/helper: merge test-prio-queue into test-tool\n  t/helepr: merge test-read-cache into test-tool\n  t/helper: merge test-ref-store into test-tool\n  t/helper: merge test-regex into test-tool\n  t/helper: merge test-revision-walking into test-tool\n  t/helper: merge test-run-command into test-tool\n  t/helper: merge test-scrap-cache-tree into test-tool\n  t/helper: merge test-sha1-array into test-tool\n  t/helper: merge test-sigchain into test-tool\n  t/helper: merge test-strcmp-offset into test-tool\n  t/helper: merge test-string-list into test-tool\n  t/helper: merge test-submodule-config into test-tool\n  t/helper: merge test-subprocess into test-tool\n  t/helper: merge test-urlmatch-.. into test-tool\n  t/helper: merge test-wildmatch into test-tool\n  t/helper: merge test-write-cache into test-tool\n\n .../howto/recover-corrupted-object-harder.txt |   2 +-\n Makefile                                      |  79 +++---\n cache.h                                       |   2 +-\n name-hash.c                                   |   2 +-\n t/helper/test-chmtime.c                       |  15 +-\n t/helper/test-config.c                        |   5 +-\n t/helper/test-ctype.c                         |   3 +-\n t/helper/test-date.c                          |  17 +-\n t/helper/test-delta.c                         |   5 +-\n t/helper/test-drop-caches.c                   |   3 +-\n t/helper/test-dump-cache-tree.c               |   3 +-\n t/helper/test-dump-split-index.c              |   3 +-\n t/helper/test-example-decorate.c              |   3 +-\n t/helper/test-genrandom.c                     |   3 +-\n t/helper/test-hashmap.c                       |   5 +-\n t/helper/test-index-version.c                 |   3 +-\n t/helper/test-lazy-init-name-hash.c           |  26 +-\n t/helper/test-match-trees.c                   |   3 +-\n t/helper/test-mergesort.c                     |   3 +-\n t/helper/test-mktemp.c                        |   3 +-\n t/helper/test-online-cpus.c                   |   3 +-\n t/helper/test-path-utils.c                    |   3 +-\n t/helper/test-prio-queue.c                    |   3 +-\n t/helper/test-read-cache.c                    |   3 +-\n t/helper/test-ref-store.c                     |   3 +-\n t/helper/test-regex.c                         |   7 +-\n t/helper/test-revision-walking.c              |   3 +-\n t/helper/test-run-command.c                   |   3 +-\n t/helper/test-scrap-cache-tree.c              |   3 +-\n t/helper/test-sha1-array.c                    |   3 +-\n t/helper/test-sha1.c                          |   3 +-\n t/helper/test-sha1.sh                         |   4 +-\n t/helper/test-sigchain.c                      |   3 +-\n t/helper/test-strcmp-offset.c                 |   3 +-\n t/helper/test-string-list.c                   |   3 +-\n t/helper/test-submodule-config.c              |   3 +-\n t/helper/test-subprocess.c                    |   3 +-\n t/helper/test-tool.c                          |  62 ++++\n t/helper/test-tool.h                          |  40 +++\n t/helper/test-urlmatch-normalization.c        |   5 +-\n t/helper/test-wildmatch.c                     |   3 +-\n t/helper/test-write-cache.c                   |   3 +-\n t/lib-git-p4.sh                               |   2 +-\n t/lib-git-svn.sh                              |   2 +-\n t/lib-pack.sh                                 |   2 +-\n t/perf/p0002-read-cache.sh                    |   2 +-\n t/perf/p0004-lazy-init-name-hash.sh           |   8 +-\n t/perf/p0007-write-cache.sh                   |   2 +-\n t/perf/p0071-sort.sh                          |   2 +-\n t/perf/p7519-fsmonitor.sh                     |  12 +-\n t/t0005-signals.sh                            |   6 +-\n t/t0006-date.sh                               |   8 +-\n t/t0009-prio-queue.sh                         |   6 +-\n t/t0011-hashmap.sh                            |   4 +-\n t/t0013-sha1dc.sh                             |   2 +-\n t/t0021-conversion.sh                         |   4 +-\n t/t0060-path-utils.sh                         |  60 ++--\n t/t0061-run-command.sh                        |  24 +-\n t/t0062-revision-walking.sh                   |   2 +-\n t/t0063-string-list.sh                        |  48 ++--\n t/t0064-sha1-array.sh                         |  16 +-\n t/t0065-strcmp-offset.sh                      |   2 +-\n t/t0070-fundamental.sh                        |   8 +-\n t/t0090-cache-tree.sh                         |  18 +-\n t/t0110-urlmatch-normalization.sh             | 266 +++++++++---------\n t/t1006-cat-file.sh                           |   2 +-\n t/t1050-large.sh                              |   6 +-\n t/t1300-repo-config.sh                        |   2 +-\n t/t1305-config-include.sh                     |   2 +-\n t/t1308-config-set.sh                         |  22 +-\n t/t1309-early-config.sh                       |  12 +-\n t/t1405-main-ref-store.sh                     |   2 +-\n t/t1406-submodule-ref-store.sh                |   2 +-\n t/t1407-worktree-ref-store.sh                 |   4 +-\n t/t1501-work-tree.sh                          |  10 +-\n t/t1600-index.sh                              |   2 +-\n t/t1700-split-index.sh                        |  64 ++---\n t/t2022-checkout-paths.sh                     |   4 +-\n t/t2104-update-index-skip-worktree.sh         |   6 +-\n t/t3008-ls-files-lazy-init-name-hash.sh       |   4 +-\n t/t3070-wildmatch.sh                          |  14 +-\n t/t3306-notes-prune.sh                        |   2 +-\n t/t3404-rebase-interactive.sh                 |   4 +-\n t/t3418-rebase-continue.sh                    |   4 +-\n t/t3501-revert-cherry-pick.sh                 |   2 +-\n t/t3510-cherry-pick-sequence.sh               |   4 +-\n t/t3600-rm.sh                                 |   2 +-\n t/t3700-add.sh                                |   2 +-\n t/t4011-diff-symlink.sh                       |   2 +-\n t/t4013-diff-various.sh                       |   2 +-\n t/t4035-diff-quiet.sh                         |   2 +-\n t/t4151-am-abort.sh                           |   4 +-\n t/t4200-rerere.sh                             |  22 +-\n t/t5000-tar-tree.sh                           |   4 +-\n t/t5300-pack-object.sh                        |   4 +-\n t/t5301-sliding-window.sh                     |   2 +-\n t/t5302-pack-index.sh                         |  14 +-\n t/t5303-pack-corruption-resilience.sh         |  10 +-\n t/t5304-prune.sh                              |  16 +-\n t/t5310-pack-bitmaps.sh                       |   2 +-\n t/t5313-pack-bounds-checks.sh                 |   4 +-\n t/t5314-pack-cycle-detection.sh               |   2 +-\n t/t5316-pack-delta-depth.sh                   |   2 +-\n t/t5400-send-pack.sh                          |   2 +-\n t/t5516-fetch-push.sh                         |   2 +-\n t/t5546-receive-limits.sh                     |   2 +-\n t/t5547-push-quarantine.sh                    |   2 +-\n t/t5608-clone-2gb.sh                          |   2 +-\n t/t6022-merge-rename.sh                       |  30 +-\n t/t6500-gc.sh                                 |   2 +-\n t/t6501-freshen-objects.sh                    |   4 +-\n t/t7411-submodule-config.sh                   |  18 +-\n t/t7508-status.sh                             |   6 +-\n t/t7701-repack-unpack-unreachable.sh          |   6 +-\n t/t7812-grep-icase-non-ascii.sh               |   2 +-\n t/t9004-example.sh                            |   2 +-\n t/t9100-git-svn-basic.sh                      |   4 +-\n t/t9300-fast-import.sh                        |   2 +-\n t/t9802-git-p4-filetype.sh                    |   2 +-\n t/t9803-git-p4-shell-metachars.sh             |   4 +-\n t/t9813-git-p4-preserve-users.sh              |   6 +-\n t/t9820-git-p4-editor-handling.sh             |   2 +-\n t/test-lib.sh                                 |  10 +-\n 123 files changed, 694 insertions(+), 549 deletions(-)\n create mode 100644 t/helper/test-tool.c\n create mode 100644 t/helper/test-tool.h\n\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341974","messageId":"20180317075421.22032-2-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 01/36] t/helper: add an empty test-tool program","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:46Z","receivedAt":"2018-03-17T07:55:40Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This will become an umbrella program that absorbs most [1] t/helper\nprograms in. By having a single executable binary we reduce disk usage\n(libgit.a is replicated by every t/helper program) and shorten link\ntime a bit.\n\nRunning \"make --jobs=1; du -sh t/helper\" with ccache fully populated,\nit takes 27 seconds and 277MB at the beginning of this series, 17\nseconds and 42MB at the end.\n\n[1] There are a couple programs that will not become part of\n    test-tool: test-line-buffer and test-svn-fe have extra\n    dependencies and test-fake-ssh's program name has to be a single\n    word for some ssh tests.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile             |  6 +++++-\n t/helper/test-tool.c | 27 +++++++++++++++++++++++++++\n t/helper/test-tool.h |  4 ++++\n 3 files changed, 36 insertions(+), 1 deletion(-)\n create mode 100644 t/helper/test-tool.c\n create mode 100644 t/helper/test-tool.h\n\ndiff --git a/Makefile b/Makefile\nindex a1d8775adb..2376646e98 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -546,6 +546,7 @@ SCRIPT_PERL =\n SCRIPT_PYTHON =\n SCRIPT_SH =\n SCRIPT_LIB =\n+TEST_BUILTINS_OBJS =\n TEST_PROGRAMS_NEED_X =\n \n # Having this variable in your environment would break pipelines because\n@@ -690,6 +691,7 @@ TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n+TEST_PROGRAMS_NEED_X += test-tool\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n TEST_PROGRAMS_NEED_X += test-wildmatch\n \n@@ -2083,7 +2085,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 %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n \t$(XDIFF_OBJS) \\\n \t$(VCSSVN_OBJS) \\\n@@ -2494,6 +2496,8 @@ t/helper/test-svn-fe$X: $(VCSSVN_LIB)\n \n .PRECIOUS: $(TEST_OBJS)\n \n+t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n+\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 \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nnew file mode 100644\nindex 0000000000..c730f718ca\n--- /dev/null\n+++ b/t/helper/test-tool.c\n@@ -0,0 +1,27 @@\n+#include \"git-compat-util.h\"\n+#include \"test-tool.h\"\n+\n+struct test_cmd {\n+\tconst char *name;\n+\tint (*main)(int argc, const char **argv);\n+};\n+\n+static struct test_cmd cmds[] = {\n+};\n+\n+int cmd_main(int argc, const char **argv)\n+{\n+\tint i;\n+\n+\tif (argc < 2)\n+\t\tdie(\"I need a test name!\");\n+\n+\tfor (i = 0; i < ARRAY_SIZE(cmds); i++) {\n+\t\tif (!strcmp(cmds[i].name, argv[1])) {\n+\t\t\targv++;\n+\t\t\targc--;\n+\t\t\treturn cmds[i].main(argc, argv);\n+\t\t}\n+\t}\n+\tdie(\"There is no test named '%s'\", argv[1]);\n+}\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nnew file mode 100644\nindex 0000000000..6ce57ae0cc\n--- /dev/null\n+++ b/t/helper/test-tool.h\n@@ -0,0 +1,4 @@\n+#ifndef __TEST_TOOL_H__\n+#define __TEST_TOOL_H__\n+\n+#endif\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341975","messageId":"20180317075421.22032-4-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 03/36] t/helper: merge test-sha1 into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:48Z","receivedAt":"2018-03-17T07:55:45Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/howto/recover-corrupted-object-harder.txt | 2 +-\n Makefile                                                | 4 ++--\n t/helper/test-sha1.c                                    | 3 ++-\n t/helper/test-sha1.sh                                   | 4 ++--\n t/helper/test-tool.c                                    | 1 +\n t/helper/test-tool.h                                    | 1 +\n t/lib-pack.sh                                           | 2 +-\n t/t0013-sha1dc.sh                                       | 2 +-\n 8 files changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/howto/recover-corrupted-object-harder.txt b/Documentation/howto/recover-corrupted-object-harder.txt\nindex 9c4cd0915f..8994e2559e 100644\n--- a/Documentation/howto/recover-corrupted-object-harder.txt\n+++ b/Documentation/howto/recover-corrupted-object-harder.txt\n@@ -80,7 +80,7 @@ valid pack like:\n     # now add our object data\n     cat object >>tmp.pack\n     # and then append the pack trailer\n-    /path/to/git.git/test-sha1 -b <tmp.pack >trailer\n+    /path/to/git.git/t/helper/test-tool sha1 -b <tmp.pack >trailer\n     cat trailer >>tmp.pack\n ------------\n \ndiff --git a/Makefile b/Makefile\nindex 416a8e39c1..3c0d0474af 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,6 +653,7 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n TEST_PROGRAMS_NEED_X += test-config\n@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n-TEST_PROGRAMS_NEED_X += test-sha1\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n@@ -2502,7 +2502,7 @@ t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\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:: t/helper/test-sha1$X\n+check-sha1:: t/helper/test-tool$X\n \tt/helper/test-sha1.sh\n \n SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\ndiff --git a/t/helper/test-sha1.c b/t/helper/test-sha1.c\nindex a1c13f54ec..afee24e027 100644\n--- a/t/helper/test-sha1.c\n+++ b/t/helper/test-sha1.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int ac, const char **av)\n+int test_sha1(int ac, const char **av)\n {\n \tgit_SHA_CTX ctx;\n \tunsigned char sha1[20];\ndiff --git a/t/helper/test-sha1.sh b/t/helper/test-sha1.sh\nindex 750b95a0a1..84594885c7 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 t/helper/test-tool 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} | ./t/helper/test-tool sha1 $cnt\n \t)\n \tif test \"$expect\" = \"$actual\"\n \tthen\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c22f300f5e..ca1f462cce 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", test_chmtime },\n+\t{ \"sha1\", test_sha1 },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 61ca4a7055..e7a2a7cb5b 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,5 +2,6 @@\n #define __TEST_TOOL_H__\n \n int test_chmtime(int argc, const char **argv);\n+int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/lib-pack.sh b/t/lib-pack.sh\nindex 7509846571..501078249d 100644\n--- a/t/lib-pack.sh\n+++ b/t/lib-pack.sh\n@@ -85,7 +85,7 @@ pack_obj () {\n \n # Compute and append pack trailer to \"$1\"\n pack_trailer () {\n-\ttest-sha1 -b <\"$1\" >trailer.tmp &&\n+\ttest-tool sha1 -b <\"$1\" >trailer.tmp &&\n \tcat trailer.tmp >>\"$1\" &&\n \trm -f trailer.tmp\n }\ndiff --git a/t/t0013-sha1dc.sh b/t/t0013-sha1dc.sh\nindex 6d655cb161..419f31a8f7 100755\n--- a/t/t0013-sha1dc.sh\n+++ b/t/t0013-sha1dc.sh\n@@ -11,7 +11,7 @@ then\n fi\n \n test_expect_success 'test-sha1 detects shattered pdf' '\n-\ttest_must_fail test-sha1 <\"$TEST_DATA/shattered-1.pdf\" 2>err &&\n+\ttest_must_fail test-tool sha1 <\"$TEST_DATA/shattered-1.pdf\" 2>err &&\n \ttest_i18ngrep collision err &&\n \tgrep 38762cf7f55934b34d179ae6a4c80cadccbb7f0a err\n '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341976","messageId":"20180317075421.22032-11-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 10/36] t/helper: merge test-dump-cache-tree into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:55Z","receivedAt":"2018-03-17T07:55:50Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                        | 2 +-\n t/helper/test-dump-cache-tree.c | 3 ++-\n t/helper/test-tool.c            | 1 +\n t/helper/test-tool.h            | 1 +\n t/t0090-cache-tree.sh           | 6 +++---\n t/t1700-split-index.sh          | 2 +-\n 6 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex edd9c43982..991bafa6fb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -658,10 +658,10 @@ TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n+TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-split-index\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\ndiff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\nindex ebf3aab22d..2697152e50 100644\n--- a/t/helper/test-dump-cache-tree.c\n+++ b/t/helper/test-dump-cache-tree.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"tree.h\"\n #include \"cache-tree.h\"\n@@ -54,7 +55,7 @@ static int dump_cache_tree(struct cache_tree *it,\n \treturn errs;\n }\n \n-int cmd_main(int ac, const char **av)\n+int test_dump_cache_tree(int ac, const char **av)\n {\n \tstruct index_state istate;\n \tstruct cache_tree *another = cache_tree();\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 904e4103fd..9c56c169c2 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -13,6 +13,7 @@ static struct test_cmd cmds[] = {\n \t{ \"date\", test_date },\n \t{ \"delta\", test_delta },\n \t{ \"drop-caches\", test_drop_caches },\n+\t{ \"dump-cache-tree\", test_dump_cache_tree },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 1e96bf44a2..37e578b75e 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -7,6 +7,7 @@ int test_ctype(int argc, const char **argv);\n int test_date(int argc, const char **argv);\n int test_delta(int argc, const char **argv);\n int test_drop_caches(int argc, const char **argv);\n+int test_dump_cache_tree(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex adfd4f0b5e..f81e3deead 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -8,13 +8,13 @@ cache-tree extension.\n  . ./test-lib.sh\n \n cmp_cache_tree () {\n-\ttest-dump-cache-tree | sed -e '/#(ref)/d' >actual &&\n+\ttest-tool dump-cache-tree | sed -e '/#(ref)/d' >actual &&\n \tsed \"s/$_x40/SHA/\" <actual >filtered &&\n \ttest_cmp \"$1\" filtered\n }\n \n # We don't bother with actually checking the SHA1:\n-# test-dump-cache-tree already verifies that all existing data is\n+# test-tool dump-cache-tree already verifies that all existing data is\n # correct.\n generate_expected_cache_tree_rec () {\n \tdir=\"$1${1:+/}\" &&\n@@ -47,7 +47,7 @@ test_cache_tree () {\n \n test_invalid_cache_tree () {\n \tprintf \"invalid                                  %s ()\\n\" \"\" \"$@\" >expect &&\n-\ttest-dump-cache-tree |\n+\ttest-tool dump-cache-tree |\n \tsed -n -e \"s/[0-9]* subtrees//\" -e '/#(ref)/d' -e '/^invalid /p' >actual &&\n \ttest_cmp expect actual\n }\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex 4b5d443280..b778975de8 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -435,7 +435,7 @@ test_expect_success 'writing split index with null sha1 does not write cache tre\n \tcommit=$(git commit-tree $tree -p HEAD <msg) &&\n \tgit update-ref HEAD \"$commit\" &&\n \tGIT_ALLOW_NULL_SHA1=1 git reset --hard &&\n-\t(test-dump-cache-tree >cache-tree.out || true) &&\n+\t(test-tool dump-cache-tree >cache-tree.out || true) &&\n \ttest_line_count = 0 cache-tree.out\n '\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341977","messageId":"20180317075421.22032-14-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 13/36] t/helper: merge test-genrandom into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:58Z","receivedAt":"2018-03-17T07:55:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                              |  2 +-\n t/helper/test-genrandom.c             |  3 ++-\n t/helper/test-tool.c                  |  1 +\n t/helper/test-tool.h                  |  1 +\n t/t0005-signals.sh                    |  2 +-\n t/t0021-conversion.sh                 |  4 ++--\n t/t1006-cat-file.sh                   |  2 +-\n t/t1050-large.sh                      |  6 +++---\n t/t5000-tar-tree.sh                   |  2 +-\n t/t5300-pack-object.sh                |  4 ++--\n t/t5301-sliding-window.sh             |  2 +-\n t/t5302-pack-index.sh                 | 14 +++++++-------\n t/t5303-pack-corruption-resilience.sh | 10 +++++-----\n t/t5310-pack-bitmaps.sh               |  2 +-\n t/t5313-pack-bounds-checks.sh         |  4 ++--\n t/t5314-pack-cycle-detection.sh       |  2 +-\n t/t5316-pack-delta-depth.sh           |  2 +-\n t/t5546-receive-limits.sh             |  2 +-\n t/t5547-push-quarantine.sh            |  2 +-\n t/t5608-clone-2gb.sh                  |  2 +-\n t/t9300-fast-import.sh                |  2 +-\n t/t9802-git-p4-filetype.sh            |  2 +-\n 22 files changed, 38 insertions(+), 35 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 895b170fe3..d0bc6cfecf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -661,13 +661,13 @@ TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n+TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n-TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n TEST_PROGRAMS_NEED_X += test-line-buffer\ndiff --git a/t/helper/test-genrandom.c b/t/helper/test-genrandom.c\nindex 8d11d22d98..2cc9515f92 100644\n--- a/t/helper/test-genrandom.c\n+++ b/t/helper/test-genrandom.c\n@@ -4,9 +4,10 @@\n  * Copyright (C) 2007 by Nicolas Pitre, licensed under the GPL version 2.\n  */\n \n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_genrandom(int argc, const char **argv)\n {\n \tunsigned long count, next = 0;\n \tunsigned char *c;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 92e6f0d5b4..ce13108374 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -16,6 +16,7 @@ static struct test_cmd cmds[] = {\n \t{ \"dump-cache-tree\", test_dump_cache_tree },\n \t{ \"dump-split-index\", test_dump_split_index },\n \t{ \"example-decorate\", test_example_decorate },\n+\t{ \"genrandom\", test_genrandom },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex e97d6c4aaa..6742558cb4 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -10,6 +10,7 @@ int test_drop_caches(int argc, const char **argv);\n int test_dump_cache_tree(int argc, const char **argv);\n int test_dump_split_index(int argc, const char **argv);\n int test_example_decorate(int argc, const char **argv);\n+int test_genrandom(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\nindex 46042f1f13..c16947cf5d 100755\n--- a/t/t0005-signals.sh\n+++ b/t/t0005-signals.sh\n@@ -36,7 +36,7 @@ large_git () {\n }\n \n test_expect_success 'create blob' '\n-\ttest-genrandom foo 16384 >file &&\n+\ttest-tool genrandom foo 16384 >file &&\n \tgit add file\n '\n \ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 46f8e583c3..9479a4aaab 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -19,7 +19,7 @@ write_script rot13-filter.pl \"$PERL_PATH\" \\\n generate_random_characters () {\n \tLEN=$1\n \tNAME=$2\n-\ttest-genrandom some-seed $LEN |\n+\ttest-tool genrandom some-seed $LEN |\n \t\tperl -pe \"s/./chr((ord($&) % 26) + ord('a'))/sge\" >\"$TEST_ROOT/$NAME\"\n }\n \n@@ -267,7 +267,7 @@ test_expect_success 'filtering large input to small output should use little mem\n '\n \n test_expect_success 'filter that does not read is fine' '\n-\ttest-genrandom foo $((128 * 1024 + 1)) >big &&\n+\ttest-tool genrandom foo $((128 * 1024 + 1)) >big &&\n \techo \"big filter=epipe\" >.gitattributes &&\n \ttest_config filter.epipe.clean \"echo xyzzy\" &&\n \tgit add big &&\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex b19f332694..2ac3b940c6 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -282,7 +282,7 @@ test_expect_success \"--batch-check with multiple sha1s gives correct format\" '\n '\n \n test_expect_success 'setup blobs which are likely to delta' '\n-\ttest-genrandom foo 10240 >foo &&\n+\ttest-tool genrandom foo 10240 >foo &&\n \t{ cat foo; echo plus; } >foo-plus &&\n \tgit add foo foo-plus &&\n \tgit commit -m foo &&\ndiff --git a/t/t1050-large.sh b/t/t1050-large.sh\nindex 6fd264cff0..f9eb143f43 100755\n--- a/t/t1050-large.sh\n+++ b/t/t1050-large.sh\n@@ -103,9 +103,9 @@ test_expect_success 'packsize limit' '\n \t\t# mid1 and mid2 will fit within 256k limit but\n \t\t# appending mid3 will bust the limit and will\n \t\t# result in a separate packfile.\n-\t\ttest-genrandom \"a\" $(( 66 * 1024 )) >mid1 &&\n-\t\ttest-genrandom \"b\" $(( 80 * 1024 )) >mid2 &&\n-\t\ttest-genrandom \"c\" $(( 128 * 1024 )) >mid3 &&\n+\t\ttest-tool genrandom \"a\" $(( 66 * 1024 )) >mid1 &&\n+\t\ttest-tool genrandom \"b\" $(( 80 * 1024 )) >mid2 &&\n+\t\ttest-tool genrandom \"c\" $(( 128 * 1024 )) >mid3 &&\n \t\tgit add mid1 mid2 mid3 &&\n \n \t\tcount=0\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 266d052efb..af4d9b8876 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -101,7 +101,7 @@ test_expect_success \\\n      ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n      echo long filename >a/four$hundred &&\n      mkdir a/bin &&\n-     test-genrandom \"frotz\" 500000 >a/bin/sh &&\n+     test-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n      printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n      printf \"A not substituted O\" >a/substfile2 &&\n      if test_have_prereq SYMLINKS; then\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 9c68b99251..3bac1f20e0 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -16,8 +16,8 @@ test_expect_success \\\n      perl -e \"print \\\"a\\\" x 4096;\" > a &&\n      perl -e \"print \\\"b\\\" x 4096;\" > b &&\n      perl -e \"print \\\"c\\\" x 4096;\" > c &&\n-     test-genrandom \"seed a\" 2097152 > a_big &&\n-     test-genrandom \"seed b\" 2097152 > b_big &&\n+     test-tool genrandom \"seed a\" 2097152 > a_big &&\n+     test-tool genrandom \"seed b\" 2097152 > b_big &&\n      git update-index --add a a_big b b_big c &&\n      cat c >d && echo foo >>d && git update-index --add d &&\n      tree=$(git write-tree) &&\ndiff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh\nindex cae8c2e882..8132642163 100755\n--- a/t/t5301-sliding-window.sh\n+++ b/t/t5301-sliding-window.sh\n@@ -12,7 +12,7 @@ test_expect_success \\\n      for i in a b c\n      do\n          echo $i >$i &&\n-         test-genrandom \"$i\" 32768 >>$i &&\n+         test-tool genrandom \"$i\" 32768 >>$i &&\n          git update-index --add $i || return 1\n      done &&\n      echo d >d && cat c >>d && git update-index --add d &&\ndiff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh\nindex c2fc584dac..95fb9e40b4 100755\n--- a/t/t5302-pack-index.sh\n+++ b/t/t5302-pack-index.sh\n@@ -15,17 +15,17 @@ test_expect_success \\\n      while test $i -le 100\n      do\n          iii=$(printf '%03i' $i)\n-         test-genrandom \"bar\" 200 > wide_delta_$iii &&\n-         test-genrandom \"baz $iii\" 50 >> wide_delta_$iii &&\n-         test-genrandom \"foo\"$i 100 > deep_delta_$iii &&\n-         test-genrandom \"foo\"$(expr $i + 1) 100 >> deep_delta_$iii &&\n-         test-genrandom \"foo\"$(expr $i + 2) 100 >> deep_delta_$iii &&\n+         test-tool genrandom \"bar\" 200 > wide_delta_$iii &&\n+         test-tool genrandom \"baz $iii\" 50 >> wide_delta_$iii &&\n+         test-tool genrandom \"foo\"$i 100 > deep_delta_$iii &&\n+         test-tool genrandom \"foo\"$(expr $i + 1) 100 >> deep_delta_$iii &&\n+         test-tool genrandom \"foo\"$(expr $i + 2) 100 >> deep_delta_$iii &&\n          echo $iii >file_$iii &&\n-         test-genrandom \"$iii\" 8192 >>file_$iii &&\n+         test-tool genrandom \"$iii\" 8192 >>file_$iii &&\n          git update-index --add file_$iii deep_delta_$iii wide_delta_$iii &&\n          i=$(expr $i + 1) || return 1\n      done &&\n-     { echo 101 && test-genrandom 100 8192; } >file_101 &&\n+     { echo 101 && test-tool genrandom 100 8192; } >file_101 &&\n      git update-index --add file_101 &&\n      tree=$(git write-tree) &&\n      commit=$(git commit-tree $tree </dev/null) && {\ndiff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh\nindex 5940ce2084..3634e258f8 100755\n--- a/t/t5303-pack-corruption-resilience.sh\n+++ b/t/t5303-pack-corruption-resilience.sh\n@@ -19,14 +19,14 @@ test_description='resilience to pack corruptions with redundant objects'\n # 3) object header is always 2 bytes.\n \n create_test_files() {\n-    test-genrandom \"foo\" 2000 > file_1 &&\n-    test-genrandom \"foo\" 1800 > file_2 &&\n-    test-genrandom \"foo\" 1800 > file_3 &&\n+    test-tool genrandom \"foo\" 2000 > file_1 &&\n+    test-tool genrandom \"foo\" 1800 > file_2 &&\n+    test-tool genrandom \"foo\" 1800 > file_3 &&\n     echo \" base \" >> file_1 &&\n     echo \" delta1 \" >> file_2 &&\n     echo \" delta delta2 \" >> file_3 &&\n-    test-genrandom \"bar\" 150 >> file_2 &&\n-    test-genrandom \"baz\" 100 >> file_3\n+    test-tool genrandom \"bar\" 150 >> file_2 &&\n+    test-tool genrandom \"baz\" 100 >> file_3\n }\n \n create_new_pack() {\ndiff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\nindex 20e2473a03..f6d600fd82 100755\n--- a/t/t5310-pack-bitmaps.sh\n+++ b/t/t5310-pack-bitmaps.sh\n@@ -284,7 +284,7 @@ test_expect_success JGIT 'jgit can read our bitmaps' '\n '\n \n test_expect_success 'splitting packs does not generate bogus bitmaps' '\n-\ttest-genrandom foo $((1024 * 1024)) >rand &&\n+\ttest-tool genrandom foo $((1024 * 1024)) >rand &&\n \tgit add rand &&\n \tgit commit -m \"commit with big file\" &&\n \tgit -c pack.packSizeLimit=500k repack -adb &&\ndiff --git a/t/t5313-pack-bounds-checks.sh b/t/t5313-pack-bounds-checks.sh\nindex 9372508c99..4fe4ad9d61 100755\n--- a/t/t5313-pack-bounds-checks.sh\n+++ b/t/t5313-pack-bounds-checks.sh\n@@ -163,8 +163,8 @@ test_expect_success 'bogus offset inside v2 extended table' '\n \n test_expect_success 'bogus OFS_DELTA in packfile' '\n \t# Generate a pack with a delta in it.\n-\tbase=$(test-genrandom foo 3000 | git hash-object --stdin -w) &&\n-\tdelta=$(test-genrandom foo 2000 | git hash-object --stdin -w) &&\n+\tbase=$(test-tool genrandom foo 3000 | git hash-object --stdin -w) &&\n+\tdelta=$(test-tool genrandom foo 2000 | git hash-object --stdin -w) &&\n \tdo_pack \"$base $delta\" --delta-base-offset &&\n \trm -f .git/objects/??/* &&\n \ndiff --git a/t/t5314-pack-cycle-detection.sh b/t/t5314-pack-cycle-detection.sh\nindex f7dbdfb412..f31995d3d2 100755\n--- a/t/t5314-pack-cycle-detection.sh\n+++ b/t/t5314-pack-cycle-detection.sh\n@@ -73,7 +73,7 @@ make_pack () {\n }\n \n test_expect_success 'setup' '\n-\ttest-genrandom base 4096 >base &&\n+\ttest-tool genrandom base 4096 >base &&\n \tfor i in one two\n \tdo\n \t\t# we want shared content here to encourage deltas...\ndiff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh\nindex 2ed479b712..0f06c40eb1 100755\n--- a/t/t5316-pack-delta-depth.sh\n+++ b/t/t5316-pack-delta-depth.sh\n@@ -47,7 +47,7 @@ test_description='pack-objects breaks long cross-pack delta chains'\n # repeatedly-modified file to generate the delta chain).\n \n test_expect_success 'create series of packs' '\n-\ttest-genrandom foo 4096 >content &&\n+\ttest-tool genrandom foo 4096 >content &&\n \tprev= &&\n \tfor i in $(test_seq 1 10)\n \tdo\ndiff --git a/t/t5546-receive-limits.sh b/t/t5546-receive-limits.sh\nindex 10cb0be2b7..0b0e987fdb 100755\n--- a/t/t5546-receive-limits.sh\n+++ b/t/t5546-receive-limits.sh\n@@ -44,7 +44,7 @@ test_pack_input_limit () {\n }\n \n test_expect_success \"create known-size (1024 bytes) commit\" '\n-\ttest-genrandom foo 1024 >one-k &&\n+\ttest-tool genrandom foo 1024 >one-k &&\n \tgit add one-k &&\n \ttest_commit one-k\n '\ndiff --git a/t/t5547-push-quarantine.sh b/t/t5547-push-quarantine.sh\nindex 113c87007f..faaa51ccc5 100755\n--- a/t/t5547-push-quarantine.sh\n+++ b/t/t5547-push-quarantine.sh\n@@ -39,7 +39,7 @@ test_expect_success 'push to repo path with path separator (colon)' '\n \t# so make it likely for us to generate a delta by having\n \t# a non-trivial file with multiple versions.\n \n-\ttest-genrandom foo 4096 >file.bin &&\n+\ttest-tool genrandom foo 4096 >file.bin &&\n \tgit add file.bin &&\n \tgit commit -m bin &&\n \ndiff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh\nindex 191d6d3a78..df822d9a3e 100755\n--- a/t/t5608-clone-2gb.sh\n+++ b/t/t5608-clone-2gb.sh\n@@ -21,7 +21,7 @@ test_expect_success CLONE_2GB 'setup' '\n \t do\n \t\tprintf \"Generating blob $i/$blobcount\\r\" >&2 &&\n \t\tprintf \"blob\\nmark :$i\\ndata $blobsize\\n\" &&\n-\t\t#test-genrandom $i $blobsize &&\n+\t\t#test-tool genrandom $i $blobsize &&\n \t\tprintf \"%-${blobsize}s\" $i &&\n \t\techo \"M 100644 :$i $i\" >> commit\n \t\ti=$(($i+1)) ||\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex e4d06accc4..dc79df7b04 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -2654,7 +2654,7 @@ test_expect_success 'R: corrupt lines do not mess marks file' '\n ##\n test_expect_success 'R: blob bigger than threshold' '\n \tblobsize=$((2*1024*1024 + 53)) &&\n-\ttest-genrandom bar $blobsize >expect &&\n+\ttest-tool genrandom bar $blobsize >expect &&\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/big-file\n \tcommitter $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\ndiff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh\nindex eb9a8ed197..1fc9b33aeb 100755\n--- a/t/t9802-git-p4-filetype.sh\n+++ b/t/t9802-git-p4-filetype.sh\n@@ -237,7 +237,7 @@ test_expect_success 'ignore apple' '\n \tbuild_gendouble &&\n \t(\n \t\tcd \"$cli\" &&\n-\t\ttest-genrandom apple 1024 >double.png &&\n+\t\ttest-tool genrandom apple 1024 >double.png &&\n \t\t\"$PYTHON_PATH\" \"$TRASH_DIRECTORY/gendouble.py\" >%double.png &&\n \t\tp4 add -t apple double.png &&\n \t\tp4 submit -d appledouble\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341978","messageId":"20180317075421.22032-12-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 11/36] t/helper: merge test-dump-split-index into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:56Z","receivedAt":"2018-03-17T07:55:58Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         |  2 +-\n t/helper/test-dump-split-index.c |  3 +-\n t/helper/test-tool.c             |  1 +\n t/helper/test-tool.h             |  1 +\n t/t0090-cache-tree.sh            |  4 +--\n t/t1700-split-index.sh           | 48 ++++++++++++++++----------------\n 6 files changed, 31 insertions(+), 28 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 991bafa6fb..8993cec274 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -659,11 +659,11 @@ TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n+TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n-TEST_PROGRAMS_NEED_X += test-dump-split-index\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-example-decorate\n TEST_PROGRAMS_NEED_X += test-fake-ssh\ndiff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c\nindex e44430b699..1e541b4792 100644\n--- a/t/helper/test-dump-split-index.c\n+++ b/t/helper/test-dump-split-index.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"split-index.h\"\n #include \"ewah/ewok.h\"\n@@ -7,7 +8,7 @@ static void show_bit(size_t pos, void *data)\n \tprintf(\" %d\", (int)pos);\n }\n \n-int cmd_main(int ac, const char **av)\n+int test_dump_split_index(int ac, const char **av)\n {\n \tstruct split_index *si;\n \tint i;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 9c56c169c2..9be6ec3764 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -14,6 +14,7 @@ static struct test_cmd cmds[] = {\n \t{ \"delta\", test_delta },\n \t{ \"drop-caches\", test_drop_caches },\n \t{ \"dump-cache-tree\", test_dump_cache_tree },\n+\t{ \"dump-split-index\", test_dump_split_index },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 37e578b75e..d062bad365 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -8,6 +8,7 @@ int test_date(int argc, const char **argv);\n int test_delta(int argc, const char **argv);\n int test_drop_caches(int argc, const char **argv);\n int test_dump_cache_tree(int argc, const char **argv);\n+int test_dump_split_index(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex f81e3deead..3266209e41 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -246,9 +246,9 @@ test_expect_success 'switching trees does not invalidate shared index' '\n \tgit update-index --split-index &&\n \t>split &&\n \tgit add split &&\n-\ttest-dump-split-index .git/index | grep -v ^own >before &&\n+\ttest-tool dump-split-index .git/index | grep -v ^own >before &&\n \tgit commit -m \"as-is\" &&\n-\ttest-dump-split-index .git/index | grep -v ^own >after &&\n+\ttest-tool dump-split-index .git/index | grep -v ^own >after &&\n \ttest_cmp before after\n '\n \ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex b778975de8..ec179fbaf7 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -11,7 +11,7 @@ sane_unset GIT_FSMONITOR_TEST\n test_expect_success 'enable split index' '\n \tgit config splitIndex.maxPercentChange 100 &&\n \tgit update-index --split-index &&\n-\ttest-dump-split-index .git/index >actual &&\n+\ttest-tool dump-split-index .git/index >actual &&\n \tindexversion=$(test-index-version <.git/index) &&\n \tif test \"$indexversion\" = \"4\"\n \tthen\n@@ -39,7 +39,7 @@ test_expect_success 'add one file' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tbase $base\n \t100644 $EMPTY_BLOB 0\tone\n@@ -57,8 +57,8 @@ test_expect_success 'disable split index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\tBASE=$(test-dump-split-index .git/index | grep \"^own\" | sed \"s/own/base/\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^own\" | sed \"s/own/base/\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tnot a split index\n \tEOF\n@@ -73,7 +73,7 @@ test_expect_success 'enable split index again, \"one\" now belongs to base index\"'\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -91,7 +91,7 @@ test_expect_success 'modify original file, base index untouched' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tq_to_tab >expect <<-EOF &&\n \t$BASE\n \t100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q\n@@ -111,7 +111,7 @@ test_expect_success 'add another file, which stays index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tq_to_tab >expect <<-EOF &&\n \t$BASE\n \t100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q\n@@ -130,7 +130,7 @@ test_expect_success 'remove file not in base index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tq_to_tab >expect <<-EOF &&\n \t$BASE\n \t100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q\n@@ -147,7 +147,7 @@ test_expect_success 'remove file in base index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -165,7 +165,7 @@ test_expect_success 'add original file back' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \t100644 $EMPTY_BLOB 0\tone\n@@ -195,7 +195,7 @@ test_expect_success 'unify index, two files remain' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tnot a split index\n \tEOF\n@@ -229,8 +229,8 @@ test_expect_success 'set core.splitIndex config variable to true' '\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\ttwo\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -248,7 +248,7 @@ test_expect_success 'set core.splitIndex config variable to false' '\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\ttwo\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tnot a split index\n \tEOF\n@@ -259,8 +259,8 @@ test_expect_success 'set core.splitIndex config variable to true' '\n \tgit config core.splitIndex true &&\n \t: >three &&\n \tgit update-index --add three &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -269,7 +269,7 @@ test_expect_success 'set core.splitIndex config variable to true' '\n \ttest_cmp expect actual &&\n \t: >four &&\n \tgit update-index --add four &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tfour\n@@ -283,8 +283,8 @@ test_expect_success 'check behavior with splitIndex.maxPercentChange unset' '\n \tgit config --unset splitIndex.maxPercentChange &&\n \t: >five &&\n \tgit update-index --add five &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -293,7 +293,7 @@ test_expect_success 'check behavior with splitIndex.maxPercentChange unset' '\n \ttest_cmp expect actual &&\n \t: >six &&\n \tgit update-index --add six &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tsix\n@@ -307,8 +307,8 @@ test_expect_success 'check splitIndex.maxPercentChange set to 0' '\n \tgit config splitIndex.maxPercentChange 0 &&\n \t: >seven &&\n \tgit update-index --add seven &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -317,8 +317,8 @@ test_expect_success 'check splitIndex.maxPercentChange set to 0' '\n \ttest_cmp expect actual &&\n \t: >eight &&\n \tgit update-index --add eight &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341979","messageId":"20180317075421.22032-20-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 19/36] t/helper: merge test-online-cpus into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:04Z","receivedAt":"2018-03-17T07:56:03Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                                | 2 +-\n t/helper/test-online-cpus.c             | 3 ++-\n t/helper/test-tool.c                    | 1 +\n t/helper/test-tool.h                    | 1 +\n t/t3008-ls-files-lazy-init-name-hash.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3145a9b1b2..91af906d08 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -668,13 +668,13 @@ TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n+TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-online-cpus\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-path-utils\n TEST_PROGRAMS_NEED_X += test-prio-queue\ndiff --git a/t/helper/test-online-cpus.c b/t/helper/test-online-cpus.c\nindex 06c09c6b88..5899e3098f 100644\n--- a/t/helper/test-online-cpus.c\n+++ b/t/helper/test-online-cpus.c\n@@ -1,7 +1,8 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"thread-utils.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_online_cpus(int argc, const char **argv)\n {\n \tprintf(\"%d\\n\", online_cpus());\n \treturn 0;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 4a563e08c3..29b04dd103 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -23,6 +23,7 @@ static struct test_cmd cmds[] = {\n \t{ \"match-trees\", test_match_trees },\n \t{ \"mergesort\", test_mergesort },\n \t{ \"mktemp\", test_mktemp },\n+\t{ \"online-cpus\", test_online_cpus },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 5bbe3e96cf..b7dafee709 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -17,6 +17,7 @@ int test_lazy_init_name_hash(int argc, const char **argv);\n int test_match_trees(int argc, const char **argv);\n int test_mergesort(int argc, const char **argv);\n int test_mktemp(int argc, const char **argv);\n+int test_online_cpus(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh\nindex 8df4aa7c99..08af596ba6 100755\n--- a/t/t3008-ls-files-lazy-init-name-hash.sh\n+++ b/t/t3008-ls-files-lazy-init-name-hash.sh\n@@ -4,7 +4,7 @@ test_description='Test the lazy init name hash with various folder structures'\n \n . ./test-lib.sh\n \n-if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-online-cpus)\n+if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus)\n then\n \tskip_all='skipping lazy-init tests, single cpu'\n \ttest_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341980","messageId":"20180317075421.22032-23-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 22/36] t/helepr: merge test-read-cache into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:07Z","receivedAt":"2018-03-17T07:56:05Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   | 2 +-\n t/helper/test-read-cache.c | 3 ++-\n t/helper/test-tool.c       | 1 +\n t/helper/test-tool.h       | 1 +\n t/perf/p0002-read-cache.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 076c778494..393fb9aca4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -671,6 +671,7 @@ TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n+TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -678,7 +679,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-read-cache\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-ref-store\n TEST_PROGRAMS_NEED_X += test-regex\ndiff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c\nindex 48255eef31..cd38f09414 100644\n--- a/t/helper/test-read-cache.c\n+++ b/t/helper/test-read-cache.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_read_cache(int argc, const char **argv)\n {\n \tint i, cnt = 1;\n \tif (argc == 2)\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 24ce124868..d82db3c90f 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -26,6 +26,7 @@ static struct test_cmd cmds[] = {\n \t{ \"online-cpus\", test_online_cpus },\n \t{ \"path-utils\", test_path_utils },\n \t{ \"prio-queue\", test_prio_queue },\n+\t{ \"read-cache\", test_read_cache },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 713be481d5..2c98cdde41 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -20,6 +20,7 @@ int test_mktemp(int argc, const char **argv);\n int test_online_cpus(int argc, const char **argv);\n int test_path_utils(int argc, const char **argv);\n int test_prio_queue(int argc, const char **argv);\n+int test_read_cache(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0002-read-cache.sh b/t/perf/p0002-read-cache.sh\nindex 9180ae9343..cdd105a594 100755\n--- a/t/perf/p0002-read-cache.sh\n+++ b/t/perf/p0002-read-cache.sh\n@@ -8,7 +8,7 @@ test_perf_default_repo\n \n count=1000\n test_perf \"read_cache/discard_cache $count times\" \"\n-\ttest-read-cache $count\n+\ttest-tool read-cache $count\n \"\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341981","messageId":"20180317075421.22032-27-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 26/36] t/helper: merge test-run-command into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:11Z","receivedAt":"2018-03-17T07:56:07Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    |  2 +-\n t/helper/test-run-command.c |  3 ++-\n t/helper/test-tool.c        |  1 +\n t/helper/test-tool.h        |  1 +\n t/t0061-run-command.sh      | 24 ++++++++++++------------\n 5 files changed, 17 insertions(+), 14 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3ed461cd55..adece67b8e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -675,6 +675,7 @@ TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n+TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -683,7 +684,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 153342e44d..3aa49c3fbb 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -8,6 +8,7 @@\n  * published by the Free Software Foundation.\n  */\n \n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"run-command.h\"\n #include \"argv-array.h\"\n@@ -49,7 +50,7 @@ static int task_finished(int result,\n \treturn 1;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_run_command(int argc, const char **argv)\n {\n \tstruct child_process proc = CHILD_PROCESS_INIT;\n \tint jobs;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 4586ae9440..a8a92b6a10 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -30,6 +30,7 @@ static struct test_cmd cmds[] = {\n \t{ \"ref-store\", test_ref_store },\n \t{ \"regex\", test_regex },\n \t{ \"revision-walking\", test_revision_walking },\n+\t{ \"run-command\", test_run_command },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 9bbdb05848..23f63ee357 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -24,6 +24,7 @@ int test_read_cache(int argc, const char **argv);\n int test_ref_store(int argc, const char **argv);\n int test_regex(int argc, const char **argv);\n int test_revision_walking(int argc, const char **argv);\n+int test_run_command(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh\nindex 24c92b6cd7..d03149be9f 100755\n--- a/t/t0061-run-command.sh\n+++ b/t/t0061-run-command.sh\n@@ -14,13 +14,13 @@ EOF\n >empty\n \n test_expect_success 'start_command reports ENOENT' '\n-\ttest-run-command start-command-ENOENT ./does-not-exist\n+\ttest-tool run-command start-command-ENOENT ./does-not-exist\n '\n \n test_expect_success 'run_command can run a command' '\n \tcat hello-script >hello.sh &&\n \tchmod +x hello.sh &&\n-\ttest-run-command run-command ./hello.sh >actual 2>err &&\n+\ttest-tool run-command run-command ./hello.sh >actual 2>err &&\n \n \ttest_cmp hello-script actual &&\n \ttest_cmp empty err\n@@ -31,7 +31,7 @@ test_expect_success !MINGW 'run_command can run a script without a #! line' '\n \tcat hello-script\n \tEOF\n \tchmod +x hello &&\n-\ttest-run-command run-command ./hello >actual 2>err &&\n+\ttest-tool run-command run-command ./hello >actual 2>err &&\n \n \ttest_cmp hello-script actual &&\n \ttest_cmp empty err\n@@ -45,7 +45,7 @@ test_expect_success 'run_command does not try to execute a directory' '\n \tEOF\n \n \tPATH=$PWD/bin1:$PWD/bin2:$PATH \\\n-\t\ttest-run-command run-command greet >actual 2>err &&\n+\t\ttest-tool run-command run-command greet >actual 2>err &&\n \ttest_cmp bin2/greet actual &&\n \ttest_cmp empty err\n '\n@@ -62,7 +62,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '\n \tEOF\n \n \tPATH=$PWD/bin1:$PWD/bin2:$PATH \\\n-\t\ttest-run-command run-command greet >actual 2>err &&\n+\t\ttest-tool run-command run-command greet >actual 2>err &&\n \ttest_cmp bin2/greet actual &&\n \ttest_cmp empty err\n '\n@@ -70,7 +70,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '\n test_expect_success POSIXPERM 'run_command reports EACCES' '\n \tcat hello-script >hello.sh &&\n \tchmod -x hello.sh &&\n-\ttest_must_fail test-run-command run-command ./hello.sh 2>err &&\n+\ttest_must_fail test-tool run-command run-command ./hello.sh 2>err &&\n \n \tgrep \"fatal: cannot exec.*hello.sh\" err\n '\n@@ -104,17 +104,17 @@ World\n EOF\n \n test_expect_success 'run_command runs in parallel with more jobs available than tasks' '\n-\ttest-run-command run-command-parallel 5 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-parallel 5 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'run_command runs in parallel with as many jobs as tasks' '\n-\ttest-run-command run-command-parallel 4 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-parallel 4 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'run_command runs in parallel with more tasks than jobs available' '\n-\ttest-run-command run-command-parallel 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-parallel 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n@@ -128,7 +128,7 @@ asking for a quick stop\n EOF\n \n test_expect_success 'run_command is asked to abort gracefully' '\n-\ttest-run-command run-command-abort 3 false 2>actual &&\n+\ttest-tool run-command run-command-abort 3 false 2>actual &&\n \ttest_cmp expect actual\n '\n \n@@ -137,14 +137,14 @@ no further jobs available\n EOF\n \n test_expect_success 'run_command outputs ' '\n-\ttest-run-command run-command-no-jobs 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-no-jobs 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_trace () {\n \texpect=\"$1\"\n \tshift\n-\tGIT_TRACE=1 test-run-command \"$@\" run-command true 2>&1 >/dev/null | \\\n+\tGIT_TRACE=1 test-tool run-command \"$@\" run-command true 2>&1 >/dev/null | \\\n \t\tsed 's/.* run_command: //' >actual &&\n \techo \"$expect true\" >expect &&\n \ttest_cmp expect actual\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341982","messageId":"20180317075421.22032-29-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 28/36] t/helper: merge test-sha1-array into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:13Z","receivedAt":"2018-03-17T07:56:11Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   |  2 +-\n t/helper/test-sha1-array.c |  3 ++-\n t/helper/test-tool.c       |  1 +\n t/helper/test-tool.h       |  1 +\n t/t0064-sha1-array.sh      | 16 ++++++++--------\n 5 files changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ba7c7d8a79..b50a0818a9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -677,6 +677,7 @@ TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n+TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -685,7 +686,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n TEST_PROGRAMS_NEED_X += test-string-list\ndiff --git a/t/helper/test-sha1-array.c b/t/helper/test-sha1-array.c\nindex edfd52d82a..1e08598beb 100644\n--- a/t/helper/test-sha1-array.c\n+++ b/t/helper/test-sha1-array.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"sha1-array.h\"\n \n@@ -7,7 +8,7 @@ static int print_oid(const struct object_id *oid, void *data)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_sha1_array(int argc, const char **argv)\n {\n \tstruct oid_array array = OID_ARRAY_INIT;\n \tstruct strbuf line = STRBUF_INIT;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex f12f1ec5bb..54d62b8b32 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -32,6 +32,7 @@ static struct test_cmd cmds[] = {\n \t{ \"revision-walking\", test_revision_walking },\n \t{ \"run-command\", test_run_command },\n \t{ \"scrap-cache-tree\", test_scrap_cache_tree },\n+\t{ \"sha1-array\", test_sha1_array },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 92504e951f..10d1322e0d 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -26,6 +26,7 @@ int test_regex(int argc, const char **argv);\n int test_revision_walking(int argc, const char **argv);\n int test_run_command(int argc, const char **argv);\n int test_scrap_cache_tree(int argc, const char **argv);\n+int test_sha1_array(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0064-sha1-array.sh b/t/t0064-sha1-array.sh\nindex 50b31ffe75..67484502a0 100755\n--- a/t/t0064-sha1-array.sh\n+++ b/t/t0064-sha1-array.sh\n@@ -18,7 +18,7 @@ test_expect_success 'ordered enumeration' '\n \t{\n \t\techo20 append 88 44 aa 55 &&\n \t\techo for_each_unique\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -28,7 +28,7 @@ test_expect_success 'ordered enumeration with duplicate suppression' '\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 append 88 44 aa 55 &&\n \t\techo for_each_unique\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'lookup' '\n \t{\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -eq 1\n '\n@@ -45,7 +45,7 @@ test_expect_success 'lookup non-existing entry' '\n \t{\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 33\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -lt 0\n '\n@@ -55,7 +55,7 @@ test_expect_success 'lookup with duplicates' '\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -ge 2 &&\n \ttest \"$n\" -le 3\n@@ -66,7 +66,7 @@ test_expect_success 'lookup non-existing entry with duplicates' '\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 66\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -lt 0\n '\n@@ -76,7 +76,7 @@ test_expect_success 'lookup with almost duplicate values' '\n \t\techo \"append 5555555555555555555555555555555555555555\" &&\n \t\techo \"append 555555555555555555555555555555555555555f\" &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -eq 0\n '\n@@ -85,7 +85,7 @@ test_expect_success 'lookup with single duplicate value' '\n \t{\n \t\techo20 append 55 55 &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -ge 0 &&\n \ttest \"$n\" -le 1\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341983","messageId":"20180317075421.22032-32-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 31/36] t/helper: merge test-string-list into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:16Z","receivedAt":"2018-03-17T07:56:13Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    |  2 +-\n t/helper/test-string-list.c |  3 ++-\n t/helper/test-tool.c        |  1 +\n t/helper/test-tool.h        |  1 +\n t/perf/p0071-sort.sh        |  2 +-\n t/t0063-string-list.sh      | 48 ++++++++++++++++++-------------------\n 6 files changed, 30 insertions(+), 27 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 528a80b6a6..6819792c2b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -681,6 +681,7 @@ TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n+TEST_BUILTINS_OBJS += test-string-list.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -688,7 +689,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\ndiff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c\nindex 829ec3d7d2..4ad957c31c 100644\n--- a/t/helper/test-string-list.c\n+++ b/t/helper/test-string-list.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"string-list.h\"\n \n@@ -41,7 +42,7 @@ static int prefix_cb(struct string_list_item *item, void *cb_data)\n \treturn starts_with(item->string, prefix);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_string_list(int argc, const char **argv)\n {\n \tif (argc == 5 && !strcmp(argv[1], \"split\")) {\n \t\tstruct string_list list = STRING_LIST_INIT_DUP;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 7e684960e0..2e428825d5 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -36,6 +36,7 @@ static struct test_cmd cmds[] = {\n \t{ \"sha1\", test_sha1 },\n \t{ \"sigchain\", test_sigchain },\n \t{ \"strcmp-offset\", test_strcmp_offset },\n+\t{ \"string-list\", test_string_list },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 42ebb67af6..943d92452a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -30,5 +30,6 @@ int test_sha1_array(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n int test_sigchain(int argc, const char **argv);\n int test_strcmp_offset(int argc, const char **argv);\n+int test_string_list(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0071-sort.sh b/t/perf/p0071-sort.sh\nindex 7c9a35a646..6e924f5fa3 100755\n--- a/t/perf/p0071-sort.sh\n+++ b/t/perf/p0071-sort.sh\n@@ -16,7 +16,7 @@ test_perf 'sort(1)' '\n '\n \n test_perf 'string_list_sort()' '\n-\ttest-string-list sort <unsorted >actual\n+\ttest-tool string-list sort <unsorted >actual\n '\n \n test_expect_success 'string_list_sort() sorts like sort(1)' '\ndiff --git a/t/t0063-string-list.sh b/t/t0063-string-list.sh\nindex dbfc05ebdc..c6ee9f66b1 100755\n--- a/t/t0063-string-list.sh\n+++ b/t/t0063-string-list.sh\n@@ -10,9 +10,9 @@ test_description='Test string list functionality'\n test_split () {\n \tcat >expected &&\n \ttest_expect_success \"split $1 at $2, max $3\" \"\n-\t\ttest-string-list split '$1' '$2' '$3' >actual &&\n+\t\ttest-tool string-list split '$1' '$2' '$3' >actual &&\n \t\ttest_cmp expected actual &&\n-\t\ttest-string-list split_in_place '$1' '$2' '$3' >actual &&\n+\t\ttest-tool string-list split_in_place '$1' '$2' '$3' >actual &&\n \t\ttest_cmp expected actual\n \t\"\n }\n@@ -61,31 +61,31 @@ test_split \":\" \":\" \"-1\" <<EOF\n EOF\n \n test_expect_success \"test filter_string_list\" '\n-\ttest \"x-\" = \"x$(test-string-list filter - y)\" &&\n-\ttest \"x-\" = \"x$(test-string-list filter no y)\" &&\n-\ttest yes = \"$(test-string-list filter yes y)\" &&\n-\ttest yes = \"$(test-string-list filter no:yes y)\" &&\n-\ttest yes = \"$(test-string-list filter yes:no y)\" &&\n-\ttest y1:y2 = \"$(test-string-list filter y1:y2 y)\" &&\n-\ttest y2:y1 = \"$(test-string-list filter y2:y1 y)\" &&\n-\ttest \"x-\" = \"x$(test-string-list filter x1:x2 y)\"\n+\ttest \"x-\" = \"x$(test-tool string-list filter - y)\" &&\n+\ttest \"x-\" = \"x$(test-tool string-list filter no y)\" &&\n+\ttest yes = \"$(test-tool string-list filter yes y)\" &&\n+\ttest yes = \"$(test-tool string-list filter no:yes y)\" &&\n+\ttest yes = \"$(test-tool string-list filter yes:no y)\" &&\n+\ttest y1:y2 = \"$(test-tool string-list filter y1:y2 y)\" &&\n+\ttest y2:y1 = \"$(test-tool string-list filter y2:y1 y)\" &&\n+\ttest \"x-\" = \"x$(test-tool string-list filter x1:x2 y)\"\n '\n \n test_expect_success \"test remove_duplicates\" '\n-\ttest \"x-\" = \"x$(test-string-list remove_duplicates -)\" &&\n-\ttest \"x\" = \"x$(test-string-list remove_duplicates \"\")\" &&\n-\ttest a = \"$(test-string-list remove_duplicates a)\" &&\n-\ttest a = \"$(test-string-list remove_duplicates a:a)\" &&\n-\ttest a = \"$(test-string-list remove_duplicates a:a:a:a:a)\" &&\n-\ttest a:b = \"$(test-string-list remove_duplicates a:b)\" &&\n-\ttest a:b = \"$(test-string-list remove_duplicates a:a:b)\" &&\n-\ttest a:b = \"$(test-string-list remove_duplicates a:b:b)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:b:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:a:b:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:b:b:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:b:c:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:a:b:b:c:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:a:a:b:b:b:c:c:c)\"\n+\ttest \"x-\" = \"x$(test-tool string-list remove_duplicates -)\" &&\n+\ttest \"x\" = \"x$(test-tool string-list remove_duplicates \"\")\" &&\n+\ttest a = \"$(test-tool string-list remove_duplicates a)\" &&\n+\ttest a = \"$(test-tool string-list remove_duplicates a:a)\" &&\n+\ttest a = \"$(test-tool string-list remove_duplicates a:a:a:a:a)\" &&\n+\ttest a:b = \"$(test-tool string-list remove_duplicates a:b)\" &&\n+\ttest a:b = \"$(test-tool string-list remove_duplicates a:a:b)\" &&\n+\ttest a:b = \"$(test-tool string-list remove_duplicates a:b:b)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:b:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:a:b:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:b:b:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:b:c:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:a:b:b:c:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:a:a:b:b:b:c:c:c)\"\n '\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341984","messageId":"20180317075421.22032-34-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 33/36] t/helper: merge test-subprocess into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:18Z","receivedAt":"2018-03-17T07:56:15Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   | 2 +-\n t/helper/test-subprocess.c | 3 ++-\n t/helper/test-tool.c       | 1 +\n t/helper/test-tool.h       | 1 +\n t/t1501-work-tree.sh       | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c1dc9ff8d6..893ea64ca2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -683,6 +683,7 @@ TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n+TEST_BUILTINS_OBJS += test-subprocess.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -690,7 +691,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\ndiff --git a/t/helper/test-subprocess.c b/t/helper/test-subprocess.c\nindex 30c5765bfc..2699257663 100644\n--- a/t/helper/test-subprocess.c\n+++ b/t/helper/test-subprocess.c\n@@ -1,7 +1,8 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"run-command.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_subprocess(int argc, const char **argv)\n {\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n \tint nogit = 0;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 1b95f1b30b..49f4d6f901 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -38,6 +38,7 @@ static struct test_cmd cmds[] = {\n \t{ \"strcmp-offset\", test_strcmp_offset },\n \t{ \"string-list\", test_string_list },\n \t{ \"submodule-config\", test_submodule_config },\n+\t{ \"subprocess\", test_subprocess },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 16a05993e5..eaf15cbd84 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -32,5 +32,6 @@ int test_sigchain(int argc, const char **argv);\n int test_strcmp_offset(int argc, const char **argv);\n int test_string_list(int argc, const char **argv);\n int test_submodule_config(int argc, const char **argv);\n+int test_subprocess(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh\nindex b07cb9140e..02cf2013fc 100755\n--- a/t/t1501-work-tree.sh\n+++ b/t/t1501-work-tree.sh\n@@ -341,7 +341,7 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '\n \n test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' '\n \tGIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \\\n-\ttest-subprocess --setup-work-tree rev-parse --show-toplevel >actual &&\n+\ttest-tool subprocess --setup-work-tree rev-parse --show-toplevel >actual &&\n \techo \"$(pwd)/repo.git/work\" >expected &&\n \ttest_cmp expected actual\n '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341985","messageId":"20180317075421.22032-36-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 35/36] t/helper: merge test-wildmatch into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:20Z","receivedAt":"2018-03-17T07:56:18Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  |  2 +-\n t/helper/test-tool.c      |  1 +\n t/helper/test-tool.h      |  1 +\n t/helper/test-wildmatch.c |  3 ++-\n t/t3070-wildmatch.sh      | 14 +++++++-------\n 5 files changed, 12 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7923ec3747..2ab76c6838 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -685,6 +685,7 @@ TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n+TEST_BUILTINS_OBJS += test-wildmatch.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -694,7 +695,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n-TEST_PROGRAMS_NEED_X += test-wildmatch\n \n TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex f2d60af898..ebf28859b4 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -40,6 +40,7 @@ static struct test_cmd cmds[] = {\n \t{ \"submodule-config\", test_submodule_config },\n \t{ \"subprocess\", test_subprocess },\n \t{ \"urlmatch-normalization\", test_urlmatch_normalization },\n+\t{ \"wildmatch\", test_wildmatch },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 704ac9df35..b7c8272689 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -34,5 +34,6 @@ int test_string_list(int argc, const char **argv);\n int test_submodule_config(int argc, const char **argv);\n int test_subprocess(int argc, const char **argv);\n int test_urlmatch_normalization(int argc, const char **argv);\n+int test_wildmatch(int argc, const char **argv);\n \n #endif\ndiff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c\nindex 66d33dfcfd..b5c6d10b5e 100644\n--- a/t/helper/test-wildmatch.c\n+++ b/t/helper/test-wildmatch.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_wildmatch(int argc, const char **argv)\n {\n \tint i;\n \tfor (i = 2; i < argc; i++) {\ndiff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh\nindex c1fc6ca730..dce102130f 100755\n--- a/t/t3070-wildmatch.sh\n+++ b/t/t3070-wildmatch.sh\n@@ -79,12 +79,12 @@ match_with_function() {\n \tif test \"$match_expect\" = 1\n \tthen\n \t\ttest_expect_success \"$match_function: match '$text' '$pattern'\" \"\n-\t\t\ttest-wildmatch $match_function '$text' '$pattern'\n+\t\t\ttest-tool wildmatch $match_function '$text' '$pattern'\n \t\t\"\n \telif test \"$match_expect\" = 0\n \tthen\n \t\ttest_expect_success \"$match_function: no match '$text' '$pattern'\" \"\n-\t\t\ttest_must_fail test-wildmatch $match_function '$text' '$pattern'\n+\t\t\ttest_must_fail test-tool wildmatch $match_function '$text' '$pattern'\n \t\t\"\n \telse\n \t\ttest_expect_success \"PANIC: Test framework error. Unknown matches value $match_expect\" 'false'\n@@ -148,7 +148,7 @@ match_with_ls_files() {\n match() {\n \tif test \"$#\" = 6\n \tthen\n-\t\t# When test-wildmatch and git ls-files produce the same\n+\t\t# When test-tool wildmatch and git ls-files produce the same\n \t\t# result.\n \t\tmatch_glob=$1\n \t\tmatch_file_glob=$match_glob\n@@ -204,19 +204,19 @@ match() {\n \t\tfi\n \t'\n \n-\t# $1: Case sensitive glob match: test-wildmatch & ls-files\n+\t# $1: Case sensitive glob match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_glob \"wildmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_glob \"wildmatch\" \" --glob-pathspecs\"\n \n-\t# $2: Case insensitive glob match: test-wildmatch & ls-files\n+\t# $2: Case insensitive glob match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_iglob \"iwildmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_iglob \"iwildmatch\" \" --glob-pathspecs --icase-pathspecs\"\n \n-\t# $3: Case sensitive path match: test-wildmatch & ls-files\n+\t# $3: Case sensitive path match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_pathmatch \"pathmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_pathmatch \"pathmatch\" \"\"\n \n-\t# $4: Case insensitive path match: test-wildmatch & ls-files\n+\t# $4: Case insensitive path match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_pathmatchi \"ipathmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_pathmatchi \"ipathmatch\" \" --icase-pathspecs\"\n }\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341986","messageId":"20180317075421.22032-35-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 34/36] t/helper: merge test-urlmatch-.. into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:19Z","receivedAt":"2018-03-17T07:56:23Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                               |   2 +-\n t/helper/test-tool.c                   |   1 +\n t/helper/test-tool.h                   |   1 +\n t/helper/test-urlmatch-normalization.c |   5 +-\n t/t0110-urlmatch-normalization.sh      | 266 ++++++++++++-------------\n 5 files changed, 139 insertions(+), 136 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 893ea64ca2..7923ec3747 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -684,6 +684,7 @@ TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n+TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -693,7 +694,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\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))\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 49f4d6f901..f2d60af898 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -39,6 +39,7 @@ static struct test_cmd cmds[] = {\n \t{ \"string-list\", test_string_list },\n \t{ \"submodule-config\", test_submodule_config },\n \t{ \"subprocess\", test_subprocess },\n+\t{ \"urlmatch-normalization\", test_urlmatch_normalization },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex eaf15cbd84..704ac9df35 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -33,5 +33,6 @@ int test_strcmp_offset(int argc, const char **argv);\n int test_string_list(int argc, const char **argv);\n int test_submodule_config(int argc, const char **argv);\n int test_subprocess(int argc, const char **argv);\n+int test_urlmatch_normalization(int argc, const char **argv);\n \n #endif\ndiff --git a/t/helper/test-urlmatch-normalization.c b/t/helper/test-urlmatch-normalization.c\nindex 49b6e836be..8edd4da7e1 100644\n--- a/t/helper/test-urlmatch-normalization.c\n+++ b/t/helper/test-urlmatch-normalization.c\n@@ -1,9 +1,10 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"urlmatch.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_urlmatch_normalization(int argc, const char **argv)\n {\n-\tconst char usage[] = \"test-urlmatch-normalization [-p | -l] <url1> | <url1> <url2>\";\n+\tconst char usage[] = \"test-tool urlmatch-normalization [-p | -l] <url1> | <url1> <url2>\";\n \tchar *url1, *url2;\n \tint opt_p = 0, opt_l = 0;\n \ndiff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh\nindex 410d5768ca..f99529d838 100755\n--- a/t/t0110-urlmatch-normalization.sh\n+++ b/t/t0110-urlmatch-normalization.sh\n@@ -9,172 +9,172 @@ tu=\"$TEST_DIRECTORY/t0110/url\"\n # Note that only file: URLs should be allowed without a host\n \n test_expect_success 'url scheme' '\n-\t! test-urlmatch-normalization \"\" &&\n-\t! test-urlmatch-normalization \"_\" &&\n-\t! test-urlmatch-normalization \"scheme\" &&\n-\t! test-urlmatch-normalization \"scheme:\" &&\n-\t! test-urlmatch-normalization \"scheme:/\" &&\n-\t! test-urlmatch-normalization \"scheme://\" &&\n-\t! test-urlmatch-normalization \"file\" &&\n-\t! test-urlmatch-normalization \"file:\" &&\n-\t! test-urlmatch-normalization \"file:/\" &&\n-\ttest-urlmatch-normalization \"file://\" &&\n-\t! test-urlmatch-normalization \"://acme.co\" &&\n-\t! test-urlmatch-normalization \"x_test://acme.co\" &&\n-\t! test-urlmatch-normalization \"-test://acme.co\" &&\n-\t! test-urlmatch-normalization \"0test://acme.co\" &&\n-\t! test-urlmatch-normalization \"+test://acme.co\" &&\n-\t! test-urlmatch-normalization \".test://acme.co\" &&\n-\t! test-urlmatch-normalization \"schem%6e://\" &&\n-\ttest-urlmatch-normalization \"x-Test+v1.0://acme.co\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"AbCdeF://x.Y\")\" = \"abcdef://x.y/\"\n+\t! test-tool urlmatch-normalization \"\" &&\n+\t! test-tool urlmatch-normalization \"_\" &&\n+\t! test-tool urlmatch-normalization \"scheme\" &&\n+\t! test-tool urlmatch-normalization \"scheme:\" &&\n+\t! test-tool urlmatch-normalization \"scheme:/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://\" &&\n+\t! test-tool urlmatch-normalization \"file\" &&\n+\t! test-tool urlmatch-normalization \"file:\" &&\n+\t! test-tool urlmatch-normalization \"file:/\" &&\n+\ttest-tool urlmatch-normalization \"file://\" &&\n+\t! test-tool urlmatch-normalization \"://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"x_test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"-test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"0test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"+test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \".test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"schem%6e://\" &&\n+\ttest-tool urlmatch-normalization \"x-Test+v1.0://acme.co\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"AbCdeF://x.Y\")\" = \"abcdef://x.y/\"\n '\n \n test_expect_success 'url authority' '\n-\t! test-urlmatch-normalization \"scheme://user:pass@\" &&\n-\t! test-urlmatch-normalization \"scheme://?\" &&\n-\t! test-urlmatch-normalization \"scheme://#\" &&\n-\t! test-urlmatch-normalization \"scheme:///\" &&\n-\t! test-urlmatch-normalization \"scheme://:\" &&\n-\t! test-urlmatch-normalization \"scheme://:555\" &&\n-\ttest-urlmatch-normalization \"file://user:pass@\" &&\n-\ttest-urlmatch-normalization \"file://?\" &&\n-\ttest-urlmatch-normalization \"file://#\" &&\n-\ttest-urlmatch-normalization \"file:///\" &&\n-\ttest-urlmatch-normalization \"file://:\" &&\n-\t! test-urlmatch-normalization \"file://:555\" &&\n-\ttest-urlmatch-normalization \"scheme://user:pass@host\" &&\n-\ttest-urlmatch-normalization \"scheme://@host\" &&\n-\ttest-urlmatch-normalization \"scheme://%00@host\" &&\n-\t! test-urlmatch-normalization \"scheme://%%@host\" &&\n-\t! test-urlmatch-normalization \"scheme://host_\" &&\n-\ttest-urlmatch-normalization \"scheme://user:pass@host/\" &&\n-\ttest-urlmatch-normalization \"scheme://@host/\" &&\n-\ttest-urlmatch-normalization \"scheme://host/\" &&\n-\ttest-urlmatch-normalization \"scheme://host?x\" &&\n-\ttest-urlmatch-normalization \"scheme://host#x\" &&\n-\ttest-urlmatch-normalization \"scheme://host/@\" &&\n-\ttest-urlmatch-normalization \"scheme://host?@x\" &&\n-\ttest-urlmatch-normalization \"scheme://host#@x\" &&\n-\ttest-urlmatch-normalization \"scheme://[::1]\" &&\n-\ttest-urlmatch-normalization \"scheme://[::1]/\" &&\n-\t! test-urlmatch-normalization \"scheme://hos%41/\" &&\n-\ttest-urlmatch-normalization \"scheme://[invalid....:/\" &&\n-\ttest-urlmatch-normalization \"scheme://invalid....:]/\" &&\n-\t! test-urlmatch-normalization \"scheme://invalid....:[/\" &&\n-\t! test-urlmatch-normalization \"scheme://invalid....:[\"\n+\t! test-tool urlmatch-normalization \"scheme://user:pass@\" &&\n+\t! test-tool urlmatch-normalization \"scheme://?\" &&\n+\t! test-tool urlmatch-normalization \"scheme://#\" &&\n+\t! test-tool urlmatch-normalization \"scheme:///\" &&\n+\t! test-tool urlmatch-normalization \"scheme://:\" &&\n+\t! test-tool urlmatch-normalization \"scheme://:555\" &&\n+\ttest-tool urlmatch-normalization \"file://user:pass@\" &&\n+\ttest-tool urlmatch-normalization \"file://?\" &&\n+\ttest-tool urlmatch-normalization \"file://#\" &&\n+\ttest-tool urlmatch-normalization \"file:///\" &&\n+\ttest-tool urlmatch-normalization \"file://:\" &&\n+\t! test-tool urlmatch-normalization \"file://:555\" &&\n+\ttest-tool urlmatch-normalization \"scheme://user:pass@host\" &&\n+\ttest-tool urlmatch-normalization \"scheme://@host\" &&\n+\ttest-tool urlmatch-normalization \"scheme://%00@host\" &&\n+\t! test-tool urlmatch-normalization \"scheme://%%@host\" &&\n+\t! test-tool urlmatch-normalization \"scheme://host_\" &&\n+\ttest-tool urlmatch-normalization \"scheme://user:pass@host/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://@host/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host?x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host#x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host/@\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host?@x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host#@x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://[::1]\" &&\n+\ttest-tool urlmatch-normalization \"scheme://[::1]/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://hos%41/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://[invalid....:/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://invalid....:]/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://invalid....:[/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://invalid....:[\"\n '\n \n test_expect_success 'url port checks' '\n-\ttest-urlmatch-normalization \"xyz://q@some.host:\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:456/\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:0\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:0000000\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:0000001?\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:065535#\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:65535\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:65536\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:99999\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:100000\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:100001\" &&\n-\ttest-urlmatch-normalization \"http://q@some.host:80\" &&\n-\ttest-urlmatch-normalization \"https://q@some.host:443\" &&\n-\ttest-urlmatch-normalization \"http://q@some.host:80/\" &&\n-\ttest-urlmatch-normalization \"https://q@some.host:443?\" &&\n-\t! test-urlmatch-normalization \"http://q@:8008\" &&\n-\t! test-urlmatch-normalization \"http://:8080\" &&\n-\t! test-urlmatch-normalization \"http://:\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:456/\" &&\n-\ttest-urlmatch-normalization \"xyz://[::1]:456/\" &&\n-\ttest-urlmatch-normalization \"xyz://[::1]:/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:000/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:0%300/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:0x80/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:4294967297/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:030f/\"\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:456/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:0\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:0000000\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:0000001?\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:065535#\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:65535\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:65536\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:99999\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:100000\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:100001\" &&\n+\ttest-tool urlmatch-normalization \"http://q@some.host:80\" &&\n+\ttest-tool urlmatch-normalization \"https://q@some.host:443\" &&\n+\ttest-tool urlmatch-normalization \"http://q@some.host:80/\" &&\n+\ttest-tool urlmatch-normalization \"https://q@some.host:443?\" &&\n+\t! test-tool urlmatch-normalization \"http://q@:8008\" &&\n+\t! test-tool urlmatch-normalization \"http://:8080\" &&\n+\t! test-tool urlmatch-normalization \"http://:\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:456/\" &&\n+\ttest-tool urlmatch-normalization \"xyz://[::1]:456/\" &&\n+\ttest-tool urlmatch-normalization \"xyz://[::1]:/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:000/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:0%300/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:0x80/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:4294967297/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:030f/\"\n '\n \n test_expect_success 'url port normalization' '\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:800\")\" = \"http://x:800/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:0800\")\" = \"http://x:800/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:00000800\")\" = \"http://x:800/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:065535\")\" = \"http://x:65535/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:1\")\" = \"http://x:1/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:80\")\" = \"http://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:080\")\" = \"http://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:000000080\")\" = \"http://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"https://x:443\")\" = \"https://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"https://x:0443\")\" = \"https://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"https://x:000000443\")\" = \"https://x/\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:800\")\" = \"http://x:800/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:0800\")\" = \"http://x:800/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:00000800\")\" = \"http://x:800/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:065535\")\" = \"http://x:65535/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:1\")\" = \"http://x:1/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:80\")\" = \"http://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:080\")\" = \"http://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:000000080\")\" = \"http://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"https://x:443\")\" = \"https://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"https://x:0443\")\" = \"https://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"https://x:000000443\")\" = \"https://x/\"\n '\n \n test_expect_success 'url general escapes' '\n-\t! test-urlmatch-normalization \"http://x.y?%fg\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/%7e%41^%3a\")\" = \"x://w/~A%5E%3A\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/:/?#[]@\")\" = \"x://w/:/?#[]@\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/$&()*+,;=\")\" = \"x://w/$&()*+,;=\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/'\\''\")\" = \"x://w/'\\''\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W?'\\!'\")\" = \"x://w/?'\\!'\"\n+\t! test-tool urlmatch-normalization \"http://x.y?%fg\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/%7e%41^%3a\")\" = \"x://w/~A%5E%3A\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/:/?#[]@\")\" = \"x://w/:/?#[]@\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/$&()*+,;=\")\" = \"x://w/$&()*+,;=\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/'\\''\")\" = \"x://w/'\\''\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W?'\\!'\")\" = \"x://w/?'\\!'\"\n '\n \n test_expect_success !MINGW 'url high-bit escapes' '\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-1\")\")\" = \"x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-2\")\")\" = \"x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-3\")\")\" = \"x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-4\")\")\" = \"x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-5\")\")\" = \"x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-6\")\")\" = \"x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-7\")\")\" = \"x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-8\")\")\" = \"x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-9\")\")\" = \"x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-10\")\")\" = \"x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-1\")\")\" = \"x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-2\")\")\" = \"x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-3\")\")\" = \"x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-4\")\")\" = \"x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-5\")\")\" = \"x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-6\")\")\" = \"x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-7\")\")\" = \"x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-8\")\")\" = \"x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-9\")\")\" = \"x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-10\")\")\" = \"x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF\"\n '\n \n test_expect_success 'url utf-8 escapes' '\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-11\")\")\" = \"x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-11\")\")\" = \"x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD\"\n '\n \n test_expect_success 'url username/password escapes' '\n-\ttest \"$(test-urlmatch-normalization -p \"x://%41%62(^):%70+d@foo\")\" = \"x://Ab(%5E):p+d@foo/\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://%41%62(^):%70+d@foo\")\" = \"x://Ab(%5E):p+d@foo/\"\n '\n \n test_expect_success 'url normalized lengths' '\n-\ttest \"$(test-urlmatch-normalization -l \"Http://%4d%65:%4d^%70@The.Host\")\" = 25 &&\n-\ttest \"$(test-urlmatch-normalization -l \"http://%41:%42@x.y/%61/\")\" = 17 &&\n-\ttest \"$(test-urlmatch-normalization -l \"http://@x.y/^\")\" = 15\n+\ttest \"$(test-tool urlmatch-normalization -l \"Http://%4d%65:%4d^%70@The.Host\")\" = 25 &&\n+\ttest \"$(test-tool urlmatch-normalization -l \"http://%41:%42@x.y/%61/\")\" = 17 &&\n+\ttest \"$(test-tool urlmatch-normalization -l \"http://@x.y/^\")\" = 15\n '\n \n test_expect_success 'url . and .. segments' '\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/.\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/./\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/.\")\" = \"x://y/a\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./\")\" = \"x://y/a/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/.?\")\" = \"x://y/?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/./?\")\" = \"x://y/?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/.?\")\" = \"x://y/a?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./?\")\" = \"x://y/a/?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./b/.././../c\")\" = \"x://y/c\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./b/../.././c/\")\" = \"x://y/c/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./b/.././../c/././.././.\")\" = \"x://y/\" &&\n-\t! test-urlmatch-normalization \"x://y/a/./b/.././../c/././.././..\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./?/././..\")\" = \"x://y/a/?/././..\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/%2e/\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/%2E/\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/%2e./\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/b/.%2E/\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/c/%2e%2E/\")\" = \"x://y/\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/.\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/./\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/.\")\" = \"x://y/a\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./\")\" = \"x://y/a/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/.?\")\" = \"x://y/?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/./?\")\" = \"x://y/?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/.?\")\" = \"x://y/a?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./?\")\" = \"x://y/a/?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./b/.././../c\")\" = \"x://y/c\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./b/../.././c/\")\" = \"x://y/c/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./b/.././../c/././.././.\")\" = \"x://y/\" &&\n+\t! test-tool urlmatch-normalization \"x://y/a/./b/.././../c/././.././..\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./?/././..\")\" = \"x://y/a/?/././..\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/%2e/\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/%2E/\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/%2e./\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/b/.%2E/\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/c/%2e%2E/\")\" = \"x://y/\"\n '\n \n # http://@foo specifies an empty user name but does not specify a password\n # http://foo  specifies neither a user name nor a password\n # So they should not be equivalent\n test_expect_success 'url equivalents' '\n-\ttest-urlmatch-normalization \"httP://x\" \"Http://X/\" &&\n-\ttest-urlmatch-normalization \"Http://%4d%65:%4d^%70@The.Host\" \"hTTP://Me:%4D^p@the.HOST:80/\" &&\n-\t! test-urlmatch-normalization \"https://@x.y/^\" \"httpS://x.y:443/^\" &&\n-\ttest-urlmatch-normalization \"https://@x.y/^\" \"httpS://@x.y:0443/^\" &&\n-\ttest-urlmatch-normalization \"https://@x.y/^/../abc\" \"httpS://@x.y:0443/abc\" &&\n-\ttest-urlmatch-normalization \"https://@x.y/^/..\" \"httpS://@x.y:0443/\"\n+\ttest-tool urlmatch-normalization \"httP://x\" \"Http://X/\" &&\n+\ttest-tool urlmatch-normalization \"Http://%4d%65:%4d^%70@The.Host\" \"hTTP://Me:%4D^p@the.HOST:80/\" &&\n+\t! test-tool urlmatch-normalization \"https://@x.y/^\" \"httpS://x.y:443/^\" &&\n+\ttest-tool urlmatch-normalization \"https://@x.y/^\" \"httpS://@x.y:0443/^\" &&\n+\ttest-tool urlmatch-normalization \"https://@x.y/^/../abc\" \"httpS://@x.y:0443/abc\" &&\n+\ttest-tool urlmatch-normalization \"https://@x.y/^/..\" \"httpS://@x.y:0443/\"\n '\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341987","messageId":"20180317075421.22032-37-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 36/36] t/helper: merge test-write-cache into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:21Z","receivedAt":"2018-03-17T07:56:26Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    | 2 +-\n t/helper/test-tool.c        | 1 +\n t/helper/test-tool.h        | 1 +\n t/helper/test-write-cache.c | 3 ++-\n t/perf/p0007-write-cache.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2ab76c6838..8ad9a2a1a9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -686,13 +686,13 @@ TEST_BUILTINS_OBJS += test-submodule-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n TEST_BUILTINS_OBJS += test-wildmatch.o\n+TEST_BUILTINS_OBJS += test-write-cache.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex ebf28859b4..e4c04cd593 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -41,6 +41,7 @@ static struct test_cmd cmds[] = {\n \t{ \"subprocess\", test_subprocess },\n \t{ \"urlmatch-normalization\", test_urlmatch_normalization },\n \t{ \"wildmatch\", test_wildmatch },\n+\t{ \"write-cache\", test_write_cache },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex b7c8272689..c0c2d1d18c 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -35,5 +35,6 @@ int test_submodule_config(int argc, const char **argv);\n int test_subprocess(int argc, const char **argv);\n int test_urlmatch_normalization(int argc, const char **argv);\n int test_wildmatch(int argc, const char **argv);\n+int test_write_cache(int argc, const char **argv);\n \n #endif\ndiff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c\nindex b7ee039669..69de7f95aa 100644\n--- a/t/helper/test-write-cache.c\n+++ b/t/helper/test-write-cache.c\n@@ -1,9 +1,10 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"lockfile.h\"\n \n static struct lock_file index_lock;\n \n-int cmd_main(int argc, const char **argv)\n+int test_write_cache(int argc, const char **argv)\n {\n \tint i, cnt = 1, lockfd;\n \tif (argc == 2)\ndiff --git a/t/perf/p0007-write-cache.sh b/t/perf/p0007-write-cache.sh\nindex 261fe92fd9..09595264f0 100755\n--- a/t/perf/p0007-write-cache.sh\n+++ b/t/perf/p0007-write-cache.sh\n@@ -23,7 +23,7 @@ test_expect_success \"setup repo\" '\n \n count=3\n test_perf \"write_locked_index $count times ($nr_files files)\" \"\n-\ttest-write-cache $count\n+\ttest-tool write-cache $count\n \"\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341988","messageId":"20180317075421.22032-33-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 32/36] t/helper: merge test-submodule-config into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:17Z","receivedAt":"2018-03-17T07:56:30Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         |  2 +-\n t/helper/test-submodule-config.c |  3 ++-\n t/helper/test-tool.c             |  1 +\n t/helper/test-tool.h             |  1 +\n t/t7411-submodule-config.sh      | 18 +++++++++---------\n 5 files changed, 14 insertions(+), 11 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6819792c2b..c1dc9ff8d6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -682,6 +682,7 @@ TEST_BUILTINS_OBJS += test-sha1.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n+TEST_BUILTINS_OBJS += test-submodule-config.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -689,7 +690,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\ndiff --git a/t/helper/test-submodule-config.c b/t/helper/test-submodule-config.c\nindex f23db3b19a..63c4b90e37 100644\n--- a/t/helper/test-submodule-config.c\n+++ b/t/helper/test-submodule-config.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"config.h\"\n #include \"submodule-config.h\"\n@@ -10,7 +11,7 @@ static void die_usage(int argc, const char **argv, const char *msg)\n \texit(1);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_submodule_config(int argc, const char **argv)\n {\n \tconst char **arg = argv;\n \tint my_argc = argc;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 2e428825d5..1b95f1b30b 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -37,6 +37,7 @@ static struct test_cmd cmds[] = {\n \t{ \"sigchain\", test_sigchain },\n \t{ \"strcmp-offset\", test_strcmp_offset },\n \t{ \"string-list\", test_string_list },\n+\t{ \"submodule-config\", test_submodule_config },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 943d92452a..16a05993e5 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -31,5 +31,6 @@ int test_sha1(int argc, const char **argv);\n int test_sigchain(int argc, const char **argv);\n int test_strcmp_offset(int argc, const char **argv);\n int test_string_list(int argc, const char **argv);\n+int test_submodule_config(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex 46c09c7765..0bde5850ac 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -41,7 +41,7 @@ test_expect_success 'configuration parsing with error' '\n \tEOF\n \t(\n \t\tcd repo &&\n-\t\ttest_must_fail test-submodule-config \"\" s 2>actual &&\n+\t\ttest_must_fail test-tool submodule-config \"\" s 2>actual &&\n \t\ttest_i18ngrep \"bad config\" actual\n \t)\n '\n@@ -55,7 +55,7 @@ EOF\n \n test_expect_success 'test parsing and lookup of submodule config by path' '\n \t(cd super &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD^ a \\\n \t\t\tHEAD b \\\n \t\t\tHEAD^ submodule \\\n@@ -67,7 +67,7 @@ test_expect_success 'test parsing and lookup of submodule config by path' '\n \n test_expect_success 'test parsing and lookup of submodule config by name' '\n \t(cd super &&\n-\t\ttest-submodule-config --name \\\n+\t\ttest-tool submodule-config --name \\\n \t\t\tHEAD^ a \\\n \t\t\tHEAD a \\\n \t\t\tHEAD^ submodule \\\n@@ -89,7 +89,7 @@ test_expect_success 'error in one submodule config lets continue' '\n \t\tgit add .gitmodules &&\n \t\tmv .gitmodules.bak .gitmodules &&\n \t\tgit commit -m \"add error\" &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t>actual &&\n@@ -100,7 +100,7 @@ test_expect_success 'error in one submodule config lets continue' '\n test_expect_success 'error message contains blob reference' '\n \t(cd super &&\n \t\tsha1=$(git rev-parse HEAD) &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t2>actual_err &&\n@@ -114,9 +114,9 @@ test_expect_success 'using different treeishs works' '\n \t\tgit tag new_tag &&\n \t\ttree=$(git rev-parse HEAD^{tree}) &&\n \t\tcommit=$(git rev-parse HEAD^{commit}) &&\n-\t\ttest-submodule-config $commit b >expect &&\n-\t\ttest-submodule-config $tree b >actual.1 &&\n-\t\ttest-submodule-config new_tag b >actual.2 &&\n+\t\ttest-tool submodule-config $commit b >expect &&\n+\t\ttest-tool submodule-config $tree b >actual.1 &&\n+\t\ttest-tool submodule-config new_tag b >actual.2 &&\n \t\ttest_cmp expect actual.1 &&\n \t\ttest_cmp expect actual.2\n \t)\n@@ -130,7 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '\n \t\tgit config --unset -f .gitmodules \\\n \t\t\tsubmodule.submodule.fetchrecursesubmodules &&\n \t\tgit commit -m \"add error in fetchrecursesubmodules\" &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t>actual &&\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341989","messageId":"20180317075421.22032-31-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 30/36] t/helper: merge test-strcmp-offset into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:15Z","receivedAt":"2018-03-17T07:56:33Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                      | 2 +-\n t/helper/test-strcmp-offset.c | 3 ++-\n t/helper/test-tool.c          | 1 +\n t/helper/test-tool.h          | 1 +\n t/t0065-strcmp-offset.sh      | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 51de8882d0..528a80b6a6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -680,6 +680,7 @@ TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n+TEST_BUILTINS_OBJS += test-strcmp-offset.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -687,7 +688,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-strcmp-offset\n TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\ndiff --git a/t/helper/test-strcmp-offset.c b/t/helper/test-strcmp-offset.c\nindex e159c9a127..3f80833542 100644\n--- a/t/helper/test-strcmp-offset.c\n+++ b/t/helper/test-strcmp-offset.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_strcmp_offset(int argc, const char **argv)\n {\n \tint result;\n \tsize_t offset;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 99db507a24..7e684960e0 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -35,6 +35,7 @@ static struct test_cmd cmds[] = {\n \t{ \"sha1-array\", test_sha1_array },\n \t{ \"sha1\", test_sha1 },\n \t{ \"sigchain\", test_sigchain },\n+\t{ \"strcmp-offset\", test_strcmp_offset },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 4c71df8c79..42ebb67af6 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -29,5 +29,6 @@ int test_scrap_cache_tree(int argc, const char **argv);\n int test_sha1_array(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n int test_sigchain(int argc, const char **argv);\n+int test_strcmp_offset(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0065-strcmp-offset.sh b/t/t0065-strcmp-offset.sh\nindex 7d6d21425f..91fa639c4a 100755\n--- a/t/t0065-strcmp-offset.sh\n+++ b/t/t0065-strcmp-offset.sh\n@@ -8,7 +8,7 @@ while read s1 s2 expect\n do\n \ttest_expect_success \"strcmp_offset($s1, $s2)\" '\n \t\techo \"$expect\" >expect &&\n-\t\ttest-strcmp-offset \"$s1\" \"$s2\" >actual &&\n+\t\ttest-tool strcmp-offset \"$s1\" \"$s2\" >actual &&\n \t\ttest_cmp expect actual\n \t'\n done <<-EOF\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341990","messageId":"20180317075421.22032-28-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 27/36] t/helper: merge test-scrap-cache-tree into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:12Z","receivedAt":"2018-03-17T07:56:36Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         | 2 +-\n t/helper/test-scrap-cache-tree.c | 3 ++-\n t/helper/test-tool.c             | 1 +\n t/helper/test-tool.h             | 1 +\n t/t0090-cache-tree.sh            | 8 ++++----\n 5 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex adece67b8e..ba7c7d8a79 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -676,6 +676,7 @@ TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-run-command.o\n+TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\ndiff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\nindex d2a63bea43..e1246602a7 100644\n--- a/t/helper/test-scrap-cache-tree.c\n+++ b/t/helper/test-scrap-cache-tree.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"lockfile.h\"\n #include \"tree.h\"\n@@ -5,7 +6,7 @@\n \n static struct lock_file index_lock;\n \n-int cmd_main(int ac, const char **av)\n+int test_scrap_cache_tree(int ac, const char **av)\n {\n \tsetup_git_directory();\n \thold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex a8a92b6a10..f12f1ec5bb 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -31,6 +31,7 @@ static struct test_cmd cmds[] = {\n \t{ \"regex\", test_regex },\n \t{ \"revision-walking\", test_revision_walking },\n \t{ \"run-command\", test_run_command },\n+\t{ \"scrap-cache-tree\", test_scrap_cache_tree },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 23f63ee357..92504e951f 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -25,6 +25,7 @@ int test_ref_store(int argc, const char **argv);\n int test_regex(int argc, const char **argv);\n int test_revision_walking(int argc, const char **argv);\n int test_run_command(int argc, const char **argv);\n+int test_scrap_cache_tree(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex 3266209e41..4ae0995cd9 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -115,14 +115,14 @@ test_expect_success 'update-index invalidates cache-tree' '\n '\n \n test_expect_success 'write-tree establishes cache-tree' '\n-\ttest-scrap-cache-tree &&\n+\ttest-tool scrap-cache-tree &&\n \tgit write-tree &&\n \ttest_cache_tree\n '\n \n-test_expect_success 'test-scrap-cache-tree works' '\n+test_expect_success 'test-tool scrap-cache-tree works' '\n \tgit read-tree HEAD &&\n-\ttest-scrap-cache-tree &&\n+\ttest-tool scrap-cache-tree &&\n \ttest_no_cache_tree\n '\n \n@@ -170,7 +170,7 @@ test_expect_success 'commit in child dir has cache-tree' '\n '\n \n test_expect_success 'reset --hard gives cache-tree' '\n-\ttest-scrap-cache-tree &&\n+\ttest-tool scrap-cache-tree &&\n \tgit reset --hard &&\n \ttest_cache_tree\n '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341991","messageId":"20180317075421.22032-30-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 29/36] t/helper: merge test-sigchain into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:14Z","receivedAt":"2018-03-17T07:56:38Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                 | 2 +-\n t/helper/test-sigchain.c | 3 ++-\n t/helper/test-tool.c     | 1 +\n t/helper/test-tool.h     | 1 +\n t/t0005-signals.sh       | 4 ++--\n 5 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b50a0818a9..51de8882d0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -679,6 +679,7 @@ TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n+TEST_BUILTINS_OBJS += test-sigchain.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -686,7 +687,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\ndiff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c\nindex b71edbd442..0cfbf9e0af 100644\n--- a/t/helper/test-sigchain.c\n+++ b/t/helper/test-sigchain.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"sigchain.h\"\n \n@@ -13,7 +14,7 @@ X(two)\n X(three)\n #undef X\n \n-int cmd_main(int argc, const char **argv) {\n+int test_sigchain(int argc, const char **argv) {\n \tsigchain_push(SIGTERM, one);\n \tsigchain_push(SIGTERM, two);\n \tsigchain_push(SIGTERM, three);\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 54d62b8b32..99db507a24 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -34,6 +34,7 @@ static struct test_cmd cmds[] = {\n \t{ \"scrap-cache-tree\", test_scrap_cache_tree },\n \t{ \"sha1-array\", test_sha1_array },\n \t{ \"sha1\", test_sha1 },\n+\t{ \"sigchain\", test_sigchain },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 10d1322e0d..4c71df8c79 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -28,5 +28,6 @@ int test_run_command(int argc, const char **argv);\n int test_scrap_cache_tree(int argc, const char **argv);\n int test_sha1_array(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n+int test_sigchain(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\nindex c16947cf5d..4c214bd11c 100755\n--- a/t/t0005-signals.sh\n+++ b/t/t0005-signals.sh\n@@ -10,7 +10,7 @@ one\n EOF\n \n test_expect_success 'sigchain works' '\n-\t{ test-sigchain >actual; ret=$?; } &&\n+\t{ test-tool sigchain >actual; ret=$?; } &&\n \t{\n \t\t# Signal death by raise() on Windows acts like exit(3),\n \t\t# regardless of the signal number. So we must allow that\n@@ -24,7 +24,7 @@ test_expect_success 'sigchain works' '\n test_expect_success !MINGW 'signals are propagated using shell convention' '\n \t# we use exec here to avoid any sub-shell interpretation\n \t# of the exit code\n-\tgit config alias.sigterm \"!exec test-sigchain\" &&\n+\tgit config alias.sigterm \"!exec test-tool sigchain\" &&\n \ttest_expect_code 143 git sigterm\n '\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341992","messageId":"20180317075421.22032-19-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 18/36] t/helper: merge test-mktemp into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:03Z","receivedAt":"2018-03-17T07:56:41Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               | 2 +-\n t/helper/test-mktemp.c | 3 ++-\n t/helper/test-tool.c   | 1 +\n t/helper/test-tool.h   | 1 +\n t/t0070-fundamental.sh | 4 ++--\n 5 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 67f37b849e..3145a9b1b2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -667,13 +667,13 @@ TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n+TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-mktemp\n TEST_PROGRAMS_NEED_X += test-online-cpus\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-path-utils\ndiff --git a/t/helper/test-mktemp.c b/t/helper/test-mktemp.c\nindex 89d9b2f7be..afc9dee91d 100644\n--- a/t/helper/test-mktemp.c\n+++ b/t/helper/test-mktemp.c\n@@ -1,9 +1,10 @@\n /*\n  * test-mktemp.c: code to exercise the creation of temporary files\n  */\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_mktemp(int argc, const char **argv)\n {\n \tif (argc != 2)\n \t\tusage(\"Expected 1 parameter defining the temporary file template\");\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 4206d96304..4a563e08c3 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -22,6 +22,7 @@ static struct test_cmd cmds[] = {\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"match-trees\", test_match_trees },\n \t{ \"mergesort\", test_mergesort },\n+\t{ \"mktemp\", test_mktemp },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex dff1b804cb..5bbe3e96cf 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -16,6 +16,7 @@ int test_index_version(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_match_trees(int argc, const char **argv);\n int test_mergesort(int argc, const char **argv);\n+int test_mktemp(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex 70d4d98a2e..ac007938ee 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -13,7 +13,7 @@ test_expect_success 'character classes (isspace, isalpha etc.)' '\n '\n \n test_expect_success 'mktemp to nonexistent directory prints filename' '\n-\ttest_must_fail test-mktemp doesnotexist/testXXXXXX 2>err &&\n+\ttest_must_fail test-tool mktemp doesnotexist/testXXXXXX 2>err &&\n \tgrep \"doesnotexist/test\" err\n '\n \n@@ -21,7 +21,7 @@ test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints file\n \tmkdir cannotwrite &&\n \tchmod -w cannotwrite &&\n \ttest_when_finished \"chmod +w cannotwrite\" &&\n-\ttest_must_fail test-mktemp cannotwrite/testXXXXXX 2>err &&\n+\ttest_must_fail test-tool mktemp cannotwrite/testXXXXXX 2>err &&\n \tgrep \"cannotwrite/test\" err\n '\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341993","messageId":"20180317075421.22032-26-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 25/36] t/helper: merge test-revision-walking into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:10Z","receivedAt":"2018-03-17T07:56:44Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         | 2 +-\n t/helper/test-revision-walking.c | 3 ++-\n t/helper/test-tool.c             | 1 +\n t/helper/test-tool.h             | 1 +\n t/t0062-revision-walking.sh      | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7444c00bbb..3ed461cd55 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -674,6 +674,7 @@ TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-regex.o\n+TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -682,7 +683,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n TEST_PROGRAMS_NEED_X += test-sha1-array\ndiff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c\nindex b8e6fe1d00..467d710da8 100644\n--- a/t/helper/test-revision-walking.c\n+++ b/t/helper/test-revision-walking.c\n@@ -8,6 +8,7 @@\n  * published by the Free Software Foundation.\n  */\n \n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n@@ -45,7 +46,7 @@ static int run_revision_walk(void)\n \treturn got_revision;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_revision_walking(int argc, const char **argv)\n {\n \tif (argc < 2)\n \t\treturn 1;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 7352bd40e8..4586ae9440 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -29,6 +29,7 @@ static struct test_cmd cmds[] = {\n \t{ \"read-cache\", test_read_cache },\n \t{ \"ref-store\", test_ref_store },\n \t{ \"regex\", test_regex },\n+\t{ \"revision-walking\", test_revision_walking },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 3cb2fd9509..9bbdb05848 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -23,6 +23,7 @@ int test_prio_queue(int argc, const char **argv);\n int test_read_cache(int argc, const char **argv);\n int test_ref_store(int argc, const char **argv);\n int test_regex(int argc, const char **argv);\n+int test_revision_walking(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0062-revision-walking.sh b/t/t0062-revision-walking.sh\nindex 113c728e67..8e215867b8 100755\n--- a/t/t0062-revision-walking.sh\n+++ b/t/t0062-revision-walking.sh\n@@ -26,7 +26,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'revision walking can be done twice' '\n-\ttest-revision-walking run-twice >run_twice_actual &&\n+\ttest-tool revision-walking run-twice >run_twice_actual &&\n \ttest_cmp run_twice_expected run_twice_actual\n '\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341994","messageId":"20180317075421.22032-22-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 21/36] t/helper: merge test-prio-queue into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:06Z","receivedAt":"2018-03-17T07:56:48Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   | 2 +-\n t/helper/test-prio-queue.c | 3 ++-\n t/helper/test-tool.c       | 1 +\n t/helper/test-tool.h       | 1 +\n t/t0009-prio-queue.sh      | 6 +++---\n 5 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 751ea6cad7..076c778494 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -670,6 +670,7 @@ TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n+TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -677,7 +678,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-prio-queue\n TEST_PROGRAMS_NEED_X += test-read-cache\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-ref-store\ndiff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c\nindex ae58fff359..a50216e332 100644\n--- a/t/helper/test-prio-queue.c\n+++ b/t/helper/test-prio-queue.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"prio-queue.h\"\n \n@@ -16,7 +17,7 @@ static void show(int *v)\n \tfree(v);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_prio_queue(int argc, const char **argv)\n {\n \tstruct prio_queue pq = { intcmp };\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 23e843ab46..24ce124868 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -25,6 +25,7 @@ static struct test_cmd cmds[] = {\n \t{ \"mktemp\", test_mktemp },\n \t{ \"online-cpus\", test_online_cpus },\n \t{ \"path-utils\", test_path_utils },\n+\t{ \"prio-queue\", test_prio_queue },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 4bcca38f8e..713be481d5 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -19,6 +19,7 @@ int test_mergesort(int argc, const char **argv);\n int test_mktemp(int argc, const char **argv);\n int test_online_cpus(int argc, const char **argv);\n int test_path_utils(int argc, const char **argv);\n+int test_prio_queue(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0009-prio-queue.sh b/t/t0009-prio-queue.sh\nindex 94045c3fad..e56dfce668 100755\n--- a/t/t0009-prio-queue.sh\n+++ b/t/t0009-prio-queue.sh\n@@ -17,7 +17,7 @@ cat >expect <<'EOF'\n 10\n EOF\n test_expect_success 'basic ordering' '\n-\ttest-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&\n+\ttest-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -30,7 +30,7 @@ cat >expect <<'EOF'\n 6\n EOF\n test_expect_success 'mixed put and get' '\n-\ttest-prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&\n+\ttest-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -43,7 +43,7 @@ NULL\n NULL\n EOF\n test_expect_success 'notice empty queue' '\n-\ttest-prio-queue 1 2 get get get 1 2 get get get >actual &&\n+\ttest-tool prio-queue 1 2 get get get 1 2 get get get >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341995","messageId":"20180317075421.22032-25-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 24/36] t/helper: merge test-regex into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:09Z","receivedAt":"2018-03-17T07:56:50Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                        | 2 +-\n t/helper/test-regex.c           | 7 ++++---\n t/helper/test-tool.c            | 1 +\n t/helper/test-tool.h            | 1 +\n t/t0070-fundamental.sh          | 2 +-\n t/t7812-grep-icase-non-ascii.sh | 2 +-\n 6 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 20080fddb8..7444c00bbb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -673,6 +673,7 @@ TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n+TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -681,7 +682,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\ndiff --git a/t/helper/test-regex.c b/t/helper/test-regex.c\nindex b5ea8a97c5..99d1c8edae 100644\n--- a/t/helper/test-regex.c\n+++ b/t/helper/test-regex.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n \n@@ -36,7 +37,7 @@ static int test_regex_bug(void)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_regex(int argc, const char **argv)\n {\n \tconst char *pat;\n \tconst char *str;\n@@ -47,8 +48,8 @@ int cmd_main(int argc, const char **argv)\n \tif (argc == 2 && !strcmp(argv[1], \"--bug\"))\n \t\treturn test_regex_bug();\n \telse if (argc < 3)\n-\t\tusage(\"test-regex --bug\\n\"\n-\t\t      \"test-regex <pattern> <string> [<options>]\");\n+\t\tusage(\"test-tool regex --bug\\n\"\n+\t\t      \"test-tool regex <pattern> <string> [<options>]\");\n \n \targv++;\n \tpat = *argv++;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 92bd38ac61..7352bd40e8 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -28,6 +28,7 @@ static struct test_cmd cmds[] = {\n \t{ \"prio-queue\", test_prio_queue },\n \t{ \"read-cache\", test_read_cache },\n \t{ \"ref-store\", test_ref_store },\n+\t{ \"regex\", test_regex },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 662d3c9645..3cb2fd9509 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -22,6 +22,7 @@ int test_path_utils(int argc, const char **argv);\n int test_prio_queue(int argc, const char **argv);\n int test_read_cache(int argc, const char **argv);\n int test_ref_store(int argc, const char **argv);\n+int test_regex(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex ac007938ee..23fbe6434a 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -31,7 +31,7 @@ test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '\n \n test_expect_success 'check for a bug in the regex routines' '\n \t# if this test fails, re-build git with NO_REGEX=1\n-\ttest-regex --bug\n+\ttest-tool regex --bug\n '\n \n test_done\ndiff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh\nindex 0059a1f837..0c685d3598 100755\n--- a/t/t7812-grep-icase-non-ascii.sh\n+++ b/t/t7812-grep-icase-non-ascii.sh\n@@ -12,7 +12,7 @@ test_expect_success GETTEXT_LOCALE 'setup' '\n '\n \n test_have_prereq GETTEXT_LOCALE &&\n-test-regex \"HALLÓ\" \"Halló\" ICASE &&\n+test-tool regex \"HALLÓ\" \"Halló\" ICASE &&\n test_set_prereq REGEX_LOCALE\n \n test_expect_success REGEX_LOCALE 'grep literal string, no -F' '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341996","messageId":"20180317075421.22032-21-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 20/36] t/helper: merge test-path-utils into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:05Z","receivedAt":"2018-03-17T07:56:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   |  2 +-\n t/helper/test-path-utils.c |  3 +-\n t/helper/test-tool.c       |  1 +\n t/helper/test-tool.h       |  1 +\n t/lib-git-p4.sh            |  2 +-\n t/t0060-path-utils.sh      | 60 +++++++++++++++++++-------------------\n t/t1501-work-tree.sh       |  8 ++---\n 7 files changed, 40 insertions(+), 37 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 91af906d08..751ea6cad7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -669,6 +669,7 @@ TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n+TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -676,7 +677,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-path-utils\n TEST_PROGRAMS_NEED_X += test-prio-queue\n TEST_PROGRAMS_NEED_X += test-read-cache\n TEST_PROGRAMS_NEED_X += test-write-cache\ndiff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c\nindex 2b3c5092a1..e00e423325 100644\n--- a/t/helper/test-path-utils.c\n+++ b/t/helper/test-path-utils.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"string-list.h\"\n \n@@ -170,7 +171,7 @@ static struct test_data dirname_data[] = {\n \t{ NULL,              NULL     }\n };\n \n-int cmd_main(int argc, const char **argv)\n+int test_path_utils(int argc, const char **argv)\n {\n \tif (argc == 3 && !strcmp(argv[1], \"normalize_path_copy\")) {\n \t\tchar *buf = xmallocz(strlen(argv[2]));\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 29b04dd103..23e843ab46 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -24,6 +24,7 @@ static struct test_cmd cmds[] = {\n \t{ \"mergesort\", test_mergesort },\n \t{ \"mktemp\", test_mktemp },\n \t{ \"online-cpus\", test_online_cpus },\n+\t{ \"path-utils\", test_path_utils },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex b7dafee709..4bcca38f8e 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -18,6 +18,7 @@ int test_match_trees(int argc, const char **argv);\n int test_mergesort(int argc, const char **argv);\n int test_mktemp(int argc, const char **argv);\n int test_online_cpus(int argc, const char **argv);\n+int test_path_utils(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh\nindex 54fd5a6ca0..c27599474c 100644\n--- a/t/lib-git-p4.sh\n+++ b/t/lib-git-p4.sh\n@@ -39,7 +39,7 @@ native_path () {\n \tthen\n \t\tpath=$(cygpath --windows \"$path\")\n \telse\n-\t\tpath=$(test-path-utils real_path \"$path\")\n+\t\tpath=$(test-tool path-utils real_path \"$path\")\n \tfi &&\n \techo \"$path\"\n }\ndiff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh\nindex 7ea2bb515b..f46e3c4995 100755\n--- a/t/t0060-path-utils.sh\n+++ b/t/t0060-path-utils.sh\n@@ -8,15 +8,15 @@ test_description='Test various path utilities'\n . ./test-lib.sh\n \n norm_path() {\n-\texpected=$(test-path-utils print_path \"$2\")\n+\texpected=$(test-tool path-utils print_path \"$2\")\n \ttest_expect_success $3 \"normalize path: $1 => $2\" \\\n-\t\"test \\\"\\$(test-path-utils normalize_path_copy '$1')\\\" = '$expected'\"\n+\t\"test \\\"\\$(test-tool path-utils normalize_path_copy '$1')\\\" = '$expected'\"\n }\n \n relative_path() {\n-\texpected=$(test-path-utils print_path \"$3\")\n+\texpected=$(test-tool path-utils print_path \"$3\")\n \ttest_expect_success $4 \"relative path: $1 $2 => $3\" \\\n-\t\"test \\\"\\$(test-path-utils relative_path '$1' '$2')\\\" = '$expected'\"\n+\t\"test \\\"\\$(test-tool path-utils relative_path '$1' '$2')\\\" = '$expected'\"\n }\n \n test_submodule_relative_url() {\n@@ -37,7 +37,7 @@ test_git_path() {\n # On Windows, we are using MSYS's bash, which mangles the paths.\n # Absolute paths are anchored at the MSYS installation directory,\n # which means that the path / accounts for this many characters:\n-rootoff=$(test-path-utils normalize_path_copy / | wc -c)\n+rootoff=$(test-tool path-utils normalize_path_copy / | wc -c)\n # Account for the trailing LF:\n if test $rootoff = 2; then\n \trootoff=\t# we are on Unix\n@@ -46,7 +46,7 @@ else\n \t# In MSYS2, the root directory \"/\" is translated into a Windows\n \t# directory *with* trailing slash. Let's test for that and adjust\n \t# our expected longest ancestor length accordingly.\n-\tcase \"$(test-path-utils print_path /)\" in\n+\tcase \"$(test-tool path-utils print_path /)\" in\n \t*/) rootslash=1;;\n \t*) rootslash=0;;\n \tesac\n@@ -61,7 +61,7 @@ ancestor() {\n \t\texpected=$(($expected+$rootoff))\n \tfi\n \ttest_expect_success \"longest ancestor: $1 $2 => $expected\" \\\n-\t\"actual=\\$(test-path-utils longest_ancestor_length '$1' '$2') &&\n+\t\"actual=\\$(test-tool path-utils longest_ancestor_length '$1' '$2') &&\n \t test \\\"\\$actual\\\" = '$expected'\"\n }\n \n@@ -77,8 +77,8 @@ case $(uname -s) in\n \t;;\n esac\n \n-test_expect_success basename 'test-path-utils basename'\n-test_expect_success dirname 'test-path-utils dirname'\n+test_expect_success basename 'test-tool path-utils basename'\n+test_expect_success dirname 'test-tool path-utils dirname'\n \n norm_path \"\" \"\"\n norm_path . \"\"\n@@ -157,48 +157,48 @@ ancestor /foo/bar /foo:/bar 4\n ancestor /foo/bar /bar -1\n \n test_expect_success 'strip_path_suffix' '\n-\ttest c:/msysgit = $(test-path-utils strip_path_suffix \\\n+\ttest c:/msysgit = $(test-tool path-utils strip_path_suffix \\\n \t\tc:/msysgit/libexec//git-core libexec/git-core)\n '\n \n test_expect_success 'absolute path rejects the empty string' '\n-\ttest_must_fail test-path-utils absolute_path \"\"\n+\ttest_must_fail test-tool path-utils absolute_path \"\"\n '\n \n test_expect_success 'real path rejects the empty string' '\n-\ttest_must_fail test-path-utils real_path \"\"\n+\ttest_must_fail test-tool path-utils real_path \"\"\n '\n \n test_expect_success POSIX 'real path works on absolute paths 1' '\n \tnopath=\"hopefully-absent-path\" &&\n-\ttest \"/\" = \"$(test-path-utils real_path \"/\")\" &&\n-\ttest \"/$nopath\" = \"$(test-path-utils real_path \"/$nopath\")\"\n+\ttest \"/\" = \"$(test-tool path-utils real_path \"/\")\" &&\n+\ttest \"/$nopath\" = \"$(test-tool path-utils real_path \"/$nopath\")\"\n '\n \n test_expect_success 'real path works on absolute paths 2' '\n \tnopath=\"hopefully-absent-path\" &&\n \t# Find an existing top-level directory for the remaining tests:\n \td=$(pwd -P | sed -e \"s|^\\([^/]*/[^/]*\\)/.*|\\1|\") &&\n-\ttest \"$d\" = \"$(test-path-utils real_path \"$d\")\" &&\n-\ttest \"$d/$nopath\" = \"$(test-path-utils real_path \"$d/$nopath\")\"\n+\ttest \"$d\" = \"$(test-tool path-utils real_path \"$d\")\" &&\n+\ttest \"$d/$nopath\" = \"$(test-tool path-utils real_path \"$d/$nopath\")\"\n '\n \n test_expect_success POSIX 'real path removes extra leading slashes' '\n \tnopath=\"hopefully-absent-path\" &&\n-\ttest \"/\" = \"$(test-path-utils real_path \"///\")\" &&\n-\ttest \"/$nopath\" = \"$(test-path-utils real_path \"///$nopath\")\" &&\n+\ttest \"/\" = \"$(test-tool path-utils real_path \"///\")\" &&\n+\ttest \"/$nopath\" = \"$(test-tool path-utils real_path \"///$nopath\")\" &&\n \t# Find an existing top-level directory for the remaining tests:\n \td=$(pwd -P | sed -e \"s|^\\([^/]*/[^/]*\\)/.*|\\1|\") &&\n-\ttest \"$d\" = \"$(test-path-utils real_path \"//$d\")\" &&\n-\ttest \"$d/$nopath\" = \"$(test-path-utils real_path \"//$d/$nopath\")\"\n+\ttest \"$d\" = \"$(test-tool path-utils real_path \"//$d\")\" &&\n+\ttest \"$d/$nopath\" = \"$(test-tool path-utils real_path \"//$d/$nopath\")\"\n '\n \n test_expect_success 'real path removes other extra slashes' '\n \tnopath=\"hopefully-absent-path\" &&\n \t# Find an existing top-level directory for the remaining tests:\n \td=$(pwd -P | sed -e \"s|^\\([^/]*/[^/]*\\)/.*|\\1|\") &&\n-\ttest \"$d\" = \"$(test-path-utils real_path \"$d///\")\" &&\n-\ttest \"$d/$nopath\" = \"$(test-path-utils real_path \"$d///$nopath\")\"\n+\ttest \"$d\" = \"$(test-tool path-utils real_path \"$d///\")\" &&\n+\ttest \"$d/$nopath\" = \"$(test-tool path-utils real_path \"$d///$nopath\")\"\n '\n \n test_expect_success SYMLINKS 'real path works on symlinks' '\n@@ -209,35 +209,35 @@ test_expect_success SYMLINKS 'real path works on symlinks' '\n \tmkdir third &&\n \tdir=\"$(cd .git; pwd -P)\" &&\n \tdir2=third/../second/other/.git &&\n-\ttest \"$dir\" = \"$(test-path-utils real_path $dir2)\" &&\n+\ttest \"$dir\" = \"$(test-tool path-utils real_path $dir2)\" &&\n \tfile=\"$dir\"/index &&\n-\ttest \"$file\" = \"$(test-path-utils real_path $dir2/index)\" &&\n+\ttest \"$file\" = \"$(test-tool path-utils real_path $dir2/index)\" &&\n \tbasename=blub &&\n-\ttest \"$dir/$basename\" = \"$(cd .git && test-path-utils real_path \"$basename\")\" &&\n+\ttest \"$dir/$basename\" = \"$(cd .git && test-tool path-utils real_path \"$basename\")\" &&\n \tln -s ../first/file .git/syml &&\n \tsym=\"$(cd first; pwd -P)\"/file &&\n-\ttest \"$sym\" = \"$(test-path-utils real_path \"$dir2/syml\")\"\n+\ttest \"$sym\" = \"$(test-tool path-utils real_path \"$dir2/syml\")\"\n '\n \n test_expect_success SYMLINKS 'prefix_path works with absolute paths to work tree symlinks' '\n \tln -s target symlink &&\n-\ttest \"$(test-path-utils prefix_path prefix \"$(pwd)/symlink\")\" = \"symlink\"\n+\ttest \"$(test-tool path-utils prefix_path prefix \"$(pwd)/symlink\")\" = \"symlink\"\n '\n \n test_expect_success 'prefix_path works with only absolute path to work tree' '\n \techo \"\" >expected &&\n-\ttest-path-utils prefix_path prefix \"$(pwd)\" >actual &&\n+\ttest-tool path-utils prefix_path prefix \"$(pwd)\" >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success 'prefix_path rejects absolute path to dir with same beginning as work tree' '\n-\ttest_must_fail test-path-utils prefix_path prefix \"$(pwd)a\"\n+\ttest_must_fail test-tool path-utils prefix_path prefix \"$(pwd)a\"\n '\n \n test_expect_success SYMLINKS 'prefix_path works with absolute path to a symlink to work tree having  same beginning as work tree' '\n \tgit init repo &&\n \tln -s repo repolink &&\n-\ttest \"a\" = \"$(cd repo && test-path-utils prefix_path prefix \"$(pwd)/../repolink/a\")\"\n+\ttest \"a\" = \"$(cd repo && test-tool path-utils prefix_path prefix \"$(pwd)/../repolink/a\")\"\n '\n \n relative_path /foo/a/b/c/\t/foo/a/b/\tc/\ndiff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh\nindex b06210ec5e..b07cb9140e 100755\n--- a/t/t1501-work-tree.sh\n+++ b/t/t1501-work-tree.sh\n@@ -360,7 +360,7 @@ test_expect_success 'GIT_DIR set (1)' '\n \t(\n \t\tcd work &&\n \t\tGIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -371,7 +371,7 @@ test_expect_success 'GIT_DIR set (2)' '\n \t(\n \t\tcd work &&\n \t\tGIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -382,7 +382,7 @@ test_expect_success 'Auto discovery' '\n \t(\n \t\tcd work &&\n \t\tgit rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual &&\n \t\techo haha >data1 &&\n \t\tgit add data1 &&\n@@ -400,7 +400,7 @@ test_expect_success '$GIT_DIR/common overrides core.worktree' '\n \t(\n \t\tcd work &&\n \t\tgit rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual &&\n \t\techo haha >data2 &&\n \t\tgit add data2 &&\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341997","messageId":"20180317075421.22032-24-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 23/36] t/helper: merge test-ref-store into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:08Z","receivedAt":"2018-03-17T07:56:56Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                       | 2 +-\n t/helper/test-ref-store.c      | 3 ++-\n t/helper/test-tool.c           | 1 +\n t/helper/test-tool.h           | 1 +\n t/t1405-main-ref-store.sh      | 2 +-\n t/t1406-submodule-ref-store.sh | 2 +-\n t/t1407-worktree-ref-store.sh  | 4 ++--\n 7 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 393fb9aca4..20080fddb8 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -672,6 +672,7 @@ TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n+TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -680,7 +681,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-ref-store\n TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex 7120634b04..a797bc532b 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"refs.h\"\n #include \"worktree.h\"\n@@ -274,7 +275,7 @@ static struct command commands[] = {\n \t{ NULL, NULL }\n };\n \n-int cmd_main(int argc, const char **argv)\n+int test_ref_store(int argc, const char **argv)\n {\n \tstruct ref_store *refs;\n \tconst char *func;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex d82db3c90f..92bd38ac61 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -27,6 +27,7 @@ static struct test_cmd cmds[] = {\n \t{ \"path-utils\", test_path_utils },\n \t{ \"prio-queue\", test_prio_queue },\n \t{ \"read-cache\", test_read_cache },\n+\t{ \"ref-store\", test_ref_store },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 2c98cdde41..662d3c9645 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -21,6 +21,7 @@ int test_online_cpus(int argc, const char **argv);\n int test_path_utils(int argc, const char **argv);\n int test_prio_queue(int argc, const char **argv);\n int test_read_cache(int argc, const char **argv);\n+int test_ref_store(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh\nindex e8115df5ba..a30a080b20 100755\n--- a/t/t1405-main-ref-store.sh\n+++ b/t/t1405-main-ref-store.sh\n@@ -4,7 +4,7 @@ test_description='test main ref store api'\n \n . ./test-lib.sh\n \n-RUN=\"test-ref-store main\"\n+RUN=\"test-tool ref-store main\"\n \n test_expect_success 'pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' '\n \ttest_commit one &&\ndiff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh\nindex c32d4cc465..e093782cc3 100755\n--- a/t/t1406-submodule-ref-store.sh\n+++ b/t/t1406-submodule-ref-store.sh\n@@ -4,7 +4,7 @@ test_description='test submodule ref store api'\n \n . ./test-lib.sh\n \n-RUN=\"test-ref-store submodule:sub\"\n+RUN=\"test-tool ref-store submodule:sub\"\n \n test_expect_success 'setup' '\n \tgit init sub &&\ndiff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\nindex 8842d0329f..2211f9831f 100755\n--- a/t/t1407-worktree-ref-store.sh\n+++ b/t/t1407-worktree-ref-store.sh\n@@ -4,8 +4,8 @@ test_description='test worktree ref store api'\n \n . ./test-lib.sh\n \n-RWT=\"test-ref-store worktree:wt\"\n-RMAIN=\"test-ref-store worktree:main\"\n+RWT=\"test-tool ref-store worktree:wt\"\n+RMAIN=\"test-tool ref-store worktree:main\"\n \n test_expect_success 'setup' '\n \ttest_commit first &&\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341998","messageId":"20180317075421.22032-13-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 12/36] t/helper: merge test-example-decorate into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:57Z","receivedAt":"2018-03-17T07:57:00Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         | 2 +-\n t/helper/test-example-decorate.c | 3 ++-\n t/helper/test-tool.c             | 1 +\n t/helper/test-tool.h             | 1 +\n t/t9004-example.sh               | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 8993cec274..895b170fe3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -660,12 +660,12 @@ TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n+TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n-TEST_PROGRAMS_NEED_X += test-example-decorate\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\ndiff --git a/t/helper/test-example-decorate.c b/t/helper/test-example-decorate.c\nindex 90dc97a9d0..280b5a8fbe 100644\n--- a/t/helper/test-example-decorate.c\n+++ b/t/helper/test-example-decorate.c\n@@ -1,8 +1,9 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"object.h\"\n #include \"decorate.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_example_decorate(int argc, const char **argv)\n {\n \tstruct decoration n;\n \tstruct object_id one_oid = { {1} };\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 9be6ec3764..92e6f0d5b4 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -15,6 +15,7 @@ static struct test_cmd cmds[] = {\n \t{ \"drop-caches\", test_drop_caches },\n \t{ \"dump-cache-tree\", test_dump_cache_tree },\n \t{ \"dump-split-index\", test_dump_split_index },\n+\t{ \"example-decorate\", test_example_decorate },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex d062bad365..e97d6c4aaa 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -9,6 +9,7 @@ int test_delta(int argc, const char **argv);\n int test_drop_caches(int argc, const char **argv);\n int test_dump_cache_tree(int argc, const char **argv);\n int test_dump_split_index(int argc, const char **argv);\n+int test_example_decorate(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t9004-example.sh b/t/t9004-example.sh\nindex b28a028f55..7e8894a4a7 100755\n--- a/t/t9004-example.sh\n+++ b/t/t9004-example.sh\n@@ -4,7 +4,7 @@ test_description='check that example code compiles and runs'\n . ./test-lib.sh\n \n test_expect_success 'decorate' '\n-\ttest-example-decorate\n+\ttest-tool example-decorate\n '\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"341999","messageId":"20180317075421.22032-15-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 14/36] t/helper: merge test-hashmap into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:59Z","receivedAt":"2018-03-17T07:57:03Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                | 2 +-\n t/helper/test-hashmap.c | 5 +++--\n t/helper/test-tool.c    | 1 +\n t/helper/test-tool.h    | 1 +\n t/t0011-hashmap.sh      | 4 ++--\n 5 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d0bc6cfecf..f6c3ddc703 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -662,13 +662,13 @@ TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-genrandom.o\n+TEST_BUILTINS_OBJS += test-hashmap.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n-TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\ndiff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c\nindex 9ae9281c07..6fc840ff72 100644\n--- a/t/helper/test-hashmap.c\n+++ b/t/helper/test-hashmap.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"hashmap.h\"\n #include \"strbuf.h\"\n@@ -77,7 +78,7 @@ static unsigned int hash(unsigned int method, unsigned int i, const char *key)\n \n /*\n  * Test performance of hashmap.[ch]\n- * Usage: time echo \"perfhashmap method rounds\" | test-hashmap\n+ * Usage: time echo \"perfhashmap method rounds\" | test-tool hashmap\n  */\n static void perf_hashmap(unsigned int method, unsigned int rounds)\n {\n@@ -144,7 +145,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)\n  *\n  * perfhashmap method rounds -> test hashmap.[ch] performance\n  */\n-int cmd_main(int argc, const char **argv)\n+int test_hashmap(int argc, const char **argv)\n {\n \tstruct strbuf line = STRBUF_INIT;\n \tstruct hashmap map;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex ce13108374..924d8c80f7 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -17,6 +17,7 @@ static struct test_cmd cmds[] = {\n \t{ \"dump-split-index\", test_dump_split_index },\n \t{ \"example-decorate\", test_example_decorate },\n \t{ \"genrandom\", test_genrandom },\n+\t{ \"hashmap\", test_hashmap },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 6742558cb4..161f5becb7 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -11,6 +11,7 @@ int test_dump_cache_tree(int argc, const char **argv);\n int test_dump_split_index(int argc, const char **argv);\n int test_example_decorate(int argc, const char **argv);\n int test_genrandom(int argc, const char **argv);\n+int test_hashmap(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t0011-hashmap.sh b/t/t0011-hashmap.sh\nindex 9c217d948c..3f1f505e89 100755\n--- a/t/t0011-hashmap.sh\n+++ b/t/t0011-hashmap.sh\n@@ -4,7 +4,7 @@ test_description='test hashmap and string hash functions'\n . ./test-lib.sh\n \n test_hashmap() {\n-\techo \"$1\" | test-hashmap $3 > actual &&\n+\techo \"$1\" | test-tool hashmap $3 > actual &&\n \techo \"$2\" > expect &&\n \ttest_cmp expect actual\n }\n@@ -232,7 +232,7 @@ test_expect_success 'grow / shrink' '\n \techo value40 >> expect &&\n \techo size >> in &&\n \techo 64 39 >> expect &&\n-\tcat in | test-hashmap > out &&\n+\tcat in | test-tool hashmap > out &&\n \ttest_cmp expect out\n \n '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342000","messageId":"20180317075421.22032-18-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 17/36] t/helper: merge (unused) test-mergesort into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:02Z","receivedAt":"2018-03-17T07:57:05Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  | 2 +-\n t/helper/test-mergesort.c | 3 ++-\n t/helper/test-tool.c      | 1 +\n t/helper/test-tool.h      | 1 +\n 4 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6552a8f4ed..67f37b849e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -666,13 +666,13 @@ TEST_BUILTINS_OBJS += test-hashmap.o\n TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-match-trees.o\n+TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-mergesort\n TEST_PROGRAMS_NEED_X += test-mktemp\n TEST_PROGRAMS_NEED_X += test-online-cpus\n TEST_PROGRAMS_NEED_X += test-parse-options\ndiff --git a/t/helper/test-mergesort.c b/t/helper/test-mergesort.c\nindex 335cf6b626..31258e40d9 100644\n--- a/t/helper/test-mergesort.c\n+++ b/t/helper/test-mergesort.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"mergesort.h\"\n \n@@ -22,7 +23,7 @@ static int compare_strings(const void *a, const void *b)\n \treturn strcmp(x->text, y->text);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_mergesort(int argc, const char **argv)\n {\n \tstruct line *line, *p = NULL, *lines = NULL;\n \tstruct strbuf sb = STRBUF_INIT;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex cde9f16fc8..4206d96304 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -21,6 +21,7 @@ static struct test_cmd cmds[] = {\n \t{ \"index-version\", test_index_version },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"match-trees\", test_match_trees },\n+\t{ \"mergesort\", test_mergesort },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 937c408dcc..dff1b804cb 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -15,6 +15,7 @@ int test_hashmap(int argc, const char **argv);\n int test_index_version(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_match_trees(int argc, const char **argv);\n+int test_mergesort(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342001","messageId":"20180317075421.22032-16-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 15/36] t/helper: merge test-index-version into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:00Z","receivedAt":"2018-03-17T07:57:09Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                              | 2 +-\n t/helper/test-index-version.c         | 3 ++-\n t/helper/test-tool.c                  | 1 +\n t/helper/test-tool.h                  | 1 +\n t/t1600-index.sh                      | 2 +-\n t/t1700-split-index.sh                | 2 +-\n t/t2104-update-index-skip-worktree.sh | 6 +++---\n 7 files changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f6c3ddc703..d7342e3a8b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -663,13 +663,13 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-hashmap.o\n+TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n-TEST_PROGRAMS_NEED_X += test-index-version\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\ndiff --git a/t/helper/test-index-version.c b/t/helper/test-index-version.c\nindex f569f6b7ef..5fc3b8d7ba 100644\n--- a/t/helper/test-index-version.c\n+++ b/t/helper/test-index-version.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_index_version(int argc, const char **argv)\n {\n \tstruct cache_header hdr;\n \tint version;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 924d8c80f7..c8c8f3ead6 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -18,6 +18,7 @@ static struct test_cmd cmds[] = {\n \t{ \"example-decorate\", test_example_decorate },\n \t{ \"genrandom\", test_genrandom },\n \t{ \"hashmap\", test_hashmap },\n+\t{ \"index-version\", test_index_version },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 161f5becb7..a81e071a80 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -12,6 +12,7 @@ int test_dump_split_index(int argc, const char **argv);\n int test_example_decorate(int argc, const char **argv);\n int test_genrandom(int argc, const char **argv);\n int test_hashmap(int argc, const char **argv);\n+int test_index_version(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t1600-index.sh b/t/t1600-index.sh\nindex 079d241145..c4422312f4 100755\n--- a/t/t1600-index.sh\n+++ b/t/t1600-index.sh\n@@ -68,7 +68,7 @@ test_expect_success 'GIT_INDEX_VERSION takes precedence over config' '\n \t\tgit config --add index.version 2 &&\n \t\tgit add a 2>&1 &&\n \t\techo 4 >expect &&\n-\t\ttest-index-version <.git/index >actual &&\n+\t\ttest-tool index-version <.git/index >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex ec179fbaf7..e4f4c4df4e 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -12,7 +12,7 @@ test_expect_success 'enable split index' '\n \tgit config splitIndex.maxPercentChange 100 &&\n \tgit update-index --split-index &&\n \ttest-tool dump-split-index .git/index >actual &&\n-\tindexversion=$(test-index-version <.git/index) &&\n+\tindexversion=$(test-tool index-version <.git/index) &&\n \tif test \"$indexversion\" = \"4\"\n \tthen\n \t\town=432ef4b63f32193984f339431fd50ca796493569\ndiff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh\nindex cc830da58d..7e2e7dd4ae 100755\n--- a/t/t2104-update-index-skip-worktree.sh\n+++ b/t/t2104-update-index-skip-worktree.sh\n@@ -33,7 +33,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'index is at version 2' '\n-\ttest \"$(test-index-version < .git/index)\" = 2\n+\ttest \"$(test-tool index-version < .git/index)\" = 2\n '\n \n test_expect_success 'update-index --skip-worktree' '\n@@ -42,7 +42,7 @@ test_expect_success 'update-index --skip-worktree' '\n '\n \n test_expect_success 'index is at version 3 after having some skip-worktree entries' '\n-\ttest \"$(test-index-version < .git/index)\" = 3\n+\ttest \"$(test-tool index-version < .git/index)\" = 3\n '\n \n test_expect_success 'ls-files -t' '\n@@ -55,7 +55,7 @@ test_expect_success 'update-index --no-skip-worktree' '\n '\n \n test_expect_success 'index version is back to 2 when there is no skip-worktree entry' '\n-\ttest \"$(test-index-version < .git/index)\" = 2\n+\ttest \"$(test-tool index-version < .git/index)\" = 2\n '\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342002","messageId":"20180317075421.22032-17-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 16/36] t/helper: merge (unused) test-match-trees into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:54:01Z","receivedAt":"2018-03-17T07:57:10Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    | 2 +-\n t/helper/test-match-trees.c | 3 ++-\n t/helper/test-tool.c        | 1 +\n t/helper/test-tool.h        | 1 +\n 4 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d7342e3a8b..6552a8f4ed 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -665,13 +665,13 @@ TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-hashmap.o\n TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n+TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\n TEST_PROGRAMS_NEED_X += test-mktemp\n TEST_PROGRAMS_NEED_X += test-online-cpus\ndiff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c\nindex 356d8edef1..2d58886acb 100644\n--- a/t/helper/test-match-trees.c\n+++ b/t/helper/test-match-trees.c\n@@ -1,7 +1,8 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"tree.h\"\n \n-int cmd_main(int ac, const char **av)\n+int test_match_trees(int ac, const char **av)\n {\n \tstruct object_id hash1, hash2, shifted;\n \tstruct tree *one, *two;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c8c8f3ead6..cde9f16fc8 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -20,6 +20,7 @@ static struct test_cmd cmds[] = {\n \t{ \"hashmap\", test_hashmap },\n \t{ \"index-version\", test_index_version },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n+\t{ \"match-trees\", test_match_trees },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex a81e071a80..937c408dcc 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -14,6 +14,7 @@ int test_genrandom(int argc, const char **argv);\n int test_hashmap(int argc, const char **argv);\n int test_index_version(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n+int test_match_trees(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342003","messageId":"20180317075421.22032-9-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 08/36] t/helper: merge (unused) test-delta into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:53Z","receivedAt":"2018-03-17T07:57:14Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile              | 2 +-\n t/helper/test-delta.c | 5 +++--\n t/helper/test-tool.c  | 1 +\n t/helper/test-tool.h  | 1 +\n 4 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex efb1872c52..327d63217a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -656,10 +656,10 @@ TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-date.o\n+TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\ndiff --git a/t/helper/test-delta.c b/t/helper/test-delta.c\nindex 591730adc4..fae9712d57 100644\n--- a/t/helper/test-delta.c\n+++ b/t/helper/test-delta.c\n@@ -8,14 +8,15 @@\n  * published by the Free Software Foundation.\n  */\n \n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"delta.h\"\n #include \"cache.h\"\n \n static const char usage_str[] =\n-\t\"test-delta (-d|-p) <from_file> <data_file> <out_file>\";\n+\t\"test-tool delta (-d|-p) <from_file> <data_file> <out_file>\";\n \n-int cmd_main(int argc, const char **argv)\n+int test_delta(int argc, const char **argv)\n {\n \tint fd;\n \tstruct stat st;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex fe130ffbf2..e48c1f2d5f 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -11,6 +11,7 @@ static struct test_cmd cmds[] = {\n \t{ \"config\", test_config },\n \t{ \"ctype\", test_ctype },\n \t{ \"date\", test_date },\n+\t{ \"delta\", test_delta },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 99ca1176dc..0ee098f1e3 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -5,6 +5,7 @@ int test_chmtime(int argc, const char **argv);\n int test_config(int argc, const char **argv);\n int test_ctype(int argc, const char **argv);\n int test_date(int argc, const char **argv);\n+int test_delta(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342004","messageId":"20180317075421.22032-6-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 05/36] t/helper: merge test-config into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:50Z","receivedAt":"2018-03-17T07:57:15Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  |  2 +-\n t/helper/test-config.c    |  5 +++--\n t/helper/test-tool.c      |  1 +\n t/helper/test-tool.h      |  1 +\n t/t1305-config-include.sh |  2 +-\n t/t1308-config-set.sh     | 22 +++++++++++-----------\n t/t1309-early-config.sh   | 12 ++++++------\n 7 files changed, 24 insertions(+), 21 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 31287cedf2..227f16ad17 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,11 +653,11 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n-TEST_PROGRAMS_NEED_X += test-config\n TEST_PROGRAMS_NEED_X += test-date\n TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\ndiff --git a/t/helper/test-config.c b/t/helper/test-config.c\nindex 1a7b8bd3d6..b91cac2c6f 100644\n--- a/t/helper/test-config.c\n+++ b/t/helper/test-config.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"config.h\"\n #include \"string-list.h\"\n@@ -32,7 +33,7 @@\n  * Examples:\n  *\n  * To print the value with highest priority for key \"foo.bAr Baz.rock\":\n- * \ttest-config get_value \"foo.bAr Baz.rock\"\n+ * \ttest-tool config get_value \"foo.bAr Baz.rock\"\n  *\n  */\n \n@@ -77,7 +78,7 @@ static int early_config_cb(const char *var, const char *value, void *vdata)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_config(int argc, const char **argv)\n {\n \tint i, val;\n \tconst char *v;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c4e9933f93..64d1632d92 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", test_chmtime },\n+\t{ \"config\", test_config },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex eaec143259..00eef888fa 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,6 +2,7 @@\n #define __TEST_TOOL_H__\n \n int test_chmtime(int argc, const char **argv);\n+int test_config(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh\nindex d9d2f545a4..f035ee40a3 100755\n--- a/t/t1305-config-include.sh\n+++ b/t/t1305-config-include.sh\n@@ -224,7 +224,7 @@ test_expect_success 'conditional include, early config reading' '\n \t\techo \"[includeIf \\\"gitdir:foo/\\\"]path=bar6\" >>.git/config &&\n \t\techo \"[test]six=6\" >.git/bar6 &&\n \t\techo 6 >expect &&\n-\t\ttest-config read_early_config test.six >actual &&\n+\t\ttest-tool config read_early_config test.six >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh\nindex bafed5c9b8..3e00d1af01 100755\n--- a/t/t1308-config-set.sh\n+++ b/t/t1308-config-set.sh\n@@ -18,7 +18,7 @@ check_config () {\n \tthen\n \t\tprintf \"%s\\n\" \"$@\"\n \tfi >expect &&\n-\ttest_expect_code $expect_code test-config \"$op\" \"$key\" >actual &&\n+\ttest_expect_code $expect_code test-tool config \"$op\" \"$key\" >actual &&\n \ttest_cmp expect actual\n }\n \n@@ -125,7 +125,7 @@ test_expect_success 'find string value for a key' '\n '\n \n test_expect_success 'check line error when NULL string is queried' '\n-\ttest_expect_code 128 test-config get_string case.foo 2>result &&\n+\ttest_expect_code 128 test-tool config get_string case.foo 2>result &&\n \ttest_i18ngrep \"fatal: .*case\\.foo.*\\.git/config.*line 7\" result\n '\n \n@@ -155,13 +155,13 @@ test_expect_success 'find value from a configset' '\n \t\tbaz = ball\n \tEOF\n \techo silk >expect &&\n-\ttest-config configset_get_value my.new config2 .git/config >actual &&\n+\ttest-tool config configset_get_value my.new config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'find value with highest priority from a configset' '\n \techo hask >expect &&\n-\ttest-config configset_get_value case.baz config2 .git/config >actual &&\n+\ttest-tool config configset_get_value case.baz config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -173,20 +173,20 @@ test_expect_success 'find value_list for a key from a configset' '\n \tlama\n \tball\n \tEOF\n-\ttest-config configset_get_value case.baz config2 .git/config >actual &&\n+\ttest-tool config configset_get_value case.baz config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'proper error on non-existent files' '\n \techo \"Error (-1) reading configuration file non-existent-file.\" >expect &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar non-existent-file 2>actual &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar non-existent-file 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'proper error on directory \"files\"' '\n \techo \"Error (-1) reading configuration file a-directory.\" >expect &&\n \tmkdir a-directory &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar a-directory 2>output &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar a-directory 2>output &&\n \tgrep \"^warning:\" output &&\n \tgrep \"^Error\" output >actual &&\n \ttest_cmp expect actual\n@@ -196,7 +196,7 @@ test_expect_success POSIXPERM,SANITY 'proper error on non-accessible files' '\n \tchmod -r .git/config &&\n \ttest_when_finished \"chmod +r .git/config\" &&\n \techo \"Error (-1) reading configuration file .git/config.\" >expect &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar .git/config 2>output &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar .git/config 2>output &&\n \tgrep \"^warning:\" output &&\n \tgrep \"^Error\" output >actual &&\n \ttest_cmp expect actual\n@@ -207,14 +207,14 @@ test_expect_success 'proper error on error in default config files' '\n \ttest_when_finished \"mv .git/config.old .git/config\" &&\n \techo \"[\" >>.git/config &&\n \techo \"fatal: bad config line 34 in file .git/config\" >expect &&\n-\ttest_expect_code 128 test-config get_value foo.bar 2>actual &&\n+\ttest_expect_code 128 test-tool config get_value foo.bar 2>actual &&\n \ttest_i18ncmp expect actual\n '\n \n test_expect_success 'proper error on error in custom config files' '\n \techo \"[\" >>syntax-error &&\n \techo \"fatal: bad config line 1 in file syntax-error\" >expect &&\n-\ttest_expect_code 128 test-config configset_get_value foo.bar syntax-error 2>actual &&\n+\ttest_expect_code 128 test-tool config configset_get_value foo.bar syntax-error 2>actual &&\n \ttest_i18ncmp expect actual\n '\n \n@@ -267,7 +267,7 @@ test_expect_success 'iteration shows correct origins' '\n \tname=\n \tscope=cmdline\n \tEOF\n-\tGIT_CONFIG_PARAMETERS=$cmdline_config test-config iterate >actual &&\n+\tGIT_CONFIG_PARAMETERS=$cmdline_config test-tool config iterate >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh\nindex 3dda215e8e..413642aa56 100755\n--- a/t/t1309-early-config.sh\n+++ b/t/t1309-early-config.sh\n@@ -6,7 +6,7 @@ test_description='Test read_early_config()'\n \n test_expect_success 'read early config' '\n \ttest_config early.config correct &&\n-\ttest-config read_early_config early.config >output &&\n+\ttest-tool config read_early_config early.config >output &&\n \ttest correct = \"$(cat output)\"\n '\n \n@@ -15,7 +15,7 @@ test_expect_success 'in a sub-directory' '\n \tmkdir -p sub &&\n \t(\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest sub = \"$(cat output)\"\n '\n@@ -27,7 +27,7 @@ test_expect_success 'ceiling' '\n \t\tGIT_CEILING_DIRECTORIES=\"$PWD\" &&\n \t\texport GIT_CEILING_DIRECTORIES &&\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest -z \"$(cat output)\"\n '\n@@ -42,7 +42,7 @@ test_expect_success 'ceiling #2' '\n \t\tGIT_CEILING_DIRECTORIES=\"$PWD\" &&\n \t\texport GIT_CEILING_DIRECTORIES XDG_CONFIG_HOME &&\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest xdg = \"$(cat output)\"\n '\n@@ -54,7 +54,7 @@ test_expect_success 'read config file in right order' '\n \t(\n \t\tcd foo &&\n \t\techo \"[test]source = repo\" >>.git/config &&\n-\t\tGIT_CONFIG_PARAMETERS=$cmdline_config test-config \\\n+\t\tGIT_CONFIG_PARAMETERS=$cmdline_config test-tool config \\\n \t\t\tread_early_config test.source >actual &&\n \t\tcat >expected <<-\\EOF &&\n \t\thome\n@@ -71,7 +71,7 @@ test_with_config () {\n \t(\n \t\tcd throwaway &&\n \t\techo \"$*\" >.git/config &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t)\n }\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342005","messageId":"20180317075421.22032-3-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 02/36] t/helper: merge test-chmtime into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:47Z","receivedAt":"2018-03-17T07:57:19Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                             |  3 ++-\n t/helper/test-chmtime.c              | 15 +++++++-------\n t/helper/test-tool.c                 |  1 +\n t/helper/test-tool.h                 |  2 ++\n t/lib-git-svn.sh                     |  2 +-\n t/t1700-split-index.sh               | 12 +++++------\n t/t2022-checkout-paths.sh            |  4 ++--\n t/t3306-notes-prune.sh               |  2 +-\n t/t3404-rebase-interactive.sh        |  4 ++--\n t/t3418-rebase-continue.sh           |  4 ++--\n t/t3501-revert-cherry-pick.sh        |  2 +-\n t/t3510-cherry-pick-sequence.sh      |  4 ++--\n t/t3600-rm.sh                        |  2 +-\n t/t3700-add.sh                       |  2 +-\n t/t4011-diff-symlink.sh              |  2 +-\n t/t4013-diff-various.sh              |  2 +-\n t/t4035-diff-quiet.sh                |  2 +-\n t/t4151-am-abort.sh                  |  4 ++--\n t/t4200-rerere.sh                    | 22 ++++++++++----------\n t/t5000-tar-tree.sh                  |  2 +-\n t/t5304-prune.sh                     | 16 +++++++--------\n t/t5400-send-pack.sh                 |  2 +-\n t/t5516-fetch-push.sh                |  2 +-\n t/t6022-merge-rename.sh              | 30 ++++++++++++++--------------\n t/t6500-gc.sh                        |  2 +-\n t/t6501-freshen-objects.sh           |  4 ++--\n t/t7508-status.sh                    |  6 +++---\n t/t7701-repack-unpack-unreachable.sh |  6 +++---\n t/t9100-git-svn-basic.sh             |  4 ++--\n t/t9803-git-p4-shell-metachars.sh    |  4 ++--\n t/t9813-git-p4-preserve-users.sh     |  6 +++---\n t/t9820-git-p4-editor-handling.sh    |  2 +-\n t/test-lib.sh                        |  6 +++---\n 33 files changed, 94 insertions(+), 89 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2376646e98..416a8e39c1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -652,7 +652,8 @@ X =\n \n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n-TEST_PROGRAMS_NEED_X += test-chmtime\n+TEST_BUILTINS_OBJS += test-chmtime.o\n+\n TEST_PROGRAMS_NEED_X += test-ctype\n TEST_PROGRAMS_NEED_X += test-config\n TEST_PROGRAMS_NEED_X += test-date\ndiff --git a/t/helper/test-chmtime.c b/t/helper/test-chmtime.c\nindex e760256406..f460b660a6 100644\n--- a/t/helper/test-chmtime.c\n+++ b/t/helper/test-chmtime.c\n@@ -5,28 +5,29 @@\n  *\n  * The mtime can be changed to an absolute value:\n  *\n- *\ttest-chmtime =<seconds> file...\n+ *\ttest-tool chmtime =<seconds> file...\n  *\n  * Relative to the current time as returned by time(3):\n  *\n- *\ttest-chmtime =+<seconds> (or =-<seconds>) file...\n+ *\ttest-tool chmtime =+<seconds> (or =-<seconds>) file...\n  *\n  * Or relative to the current mtime of the file:\n  *\n- *\ttest-chmtime <seconds> file...\n- *\ttest-chmtime +<seconds> (or -<seconds>) file...\n+ *\ttest-tool chmtime <seconds> file...\n+ *\ttest-tool chmtime +<seconds> (or -<seconds>) file...\n  *\n  * Examples:\n  *\n  * To just print the mtime use --verbose and set the file mtime offset to 0:\n  *\n- *\ttest-chmtime -v +0 file\n+ *\ttest-tool chmtime -v +0 file\n  *\n  * To set the mtime to current time:\n  *\n- *\ttest-chmtime =+0 file\n+ *\ttest-tool chmtime =+0 file\n  *\n  */\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include <utime.h>\n \n@@ -56,7 +57,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)\n \treturn 1;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_chmtime(int argc, const char **argv)\n {\n \tstatic int verbose;\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c730f718ca..c22f300f5e 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -7,6 +7,7 @@ struct test_cmd {\n };\n \n static struct test_cmd cmds[] = {\n+\t{ \"chmtime\", test_chmtime },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 6ce57ae0cc..61ca4a7055 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -1,4 +1,6 @@\n #ifndef __TEST_TOOL_H__\n #define __TEST_TOOL_H__\n \n+int test_chmtime(int argc, const char **argv);\n+\n #endif\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 4c1f81f167..a8130f9119 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -49,7 +49,7 @@ rawsvnrepo=\"$svnrepo\"\n svnrepo=\"file://$svnrepo\"\n \n poke() {\n-\ttest-chmtime +1 \"$1\"\n+\ttest-tool chmtime +1 \"$1\"\n }\n \n # We need this, because we should pass empty configuration directory to\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex a66936fe9b..4b5d443280 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -332,12 +332,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '\n \tgit update-index --add ten &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_under_2_weeks_ago=$((5-14*86400)) &&\n-\ttest-chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&\n \t: >eleven &&\n \tgit update-index --add eleven &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_over_2_weeks_ago=$((-1-14*86400)) &&\n-\ttest-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n \t: >twelve &&\n \tgit update-index --add twelve &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\n@@ -345,12 +345,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '\n \n test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '\n \tgit config splitIndex.sharedIndexExpire \"16.days.ago\" &&\n-\ttest-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n \t: >thirteen &&\n \tgit update-index --add thirteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_over_16_days_ago=$((-1-16*86400)) &&\n-\ttest-chmtime =$just_over_16_days_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_16_days_ago .git/sharedindex.* &&\n \t: >fourteen &&\n \tgit update-index --add fourteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\n@@ -359,13 +359,13 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '\n test_expect_success 'check splitIndex.sharedIndexExpire set to \"never\" and \"now\"' '\n \tgit config splitIndex.sharedIndexExpire never &&\n \tjust_10_years_ago=$((-365*10*86400)) &&\n-\ttest-chmtime =$just_10_years_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_10_years_ago .git/sharedindex.* &&\n \t: >fifteen &&\n \tgit update-index --add fifteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tgit config splitIndex.sharedIndexExpire now &&\n \tjust_1_second_ago=-1 &&\n-\ttest-chmtime =$just_1_second_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_1_second_ago .git/sharedindex.* &&\n \t: >sixteen &&\n \tgit update-index --add sixteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\ndiff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh\nindex f46d0499bc..e74d58b9e1 100755\n--- a/t/t2022-checkout-paths.sh\n+++ b/t/t2022-checkout-paths.sh\n@@ -68,13 +68,13 @@ test_expect_success 'do not touch files that are already up-to-date' '\n \tgit add file1 file2 &&\n \tgit commit -m base &&\n \techo modified >file1 &&\n-\ttest-chmtime =1000000000 file2 &&\n+\ttest-tool chmtime =1000000000 file2 &&\n \tgit update-index -q --refresh &&\n \tgit checkout HEAD -- file1 file2 &&\n \techo one >expect &&\n \ttest_cmp expect file1 &&\n \techo \"1000000000\tfile2\" >expect &&\n-\ttest-chmtime -v +0 file2 >actual &&\n+\ttest-tool chmtime -v +0 file2 >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh\nindex 86bf909ee3..61748088eb 100755\n--- a/t/t3306-notes-prune.sh\n+++ b/t/t3306-notes-prune.sh\n@@ -22,7 +22,7 @@ test_expect_success 'setup: create a few commits with notes' '\n \tgit commit -m 3rd &&\n \tCOMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&\n \ttest -f $COMMIT_FILE &&\n-\ttest-chmtime =+0 $COMMIT_FILE &&\n+\ttest-tool chmtime =+0 $COMMIT_FILE &&\n \tgit notes add -m \"Note #3\"\n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 3b905406df..961ac9d6b8 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -711,13 +711,13 @@ test_expect_success 'rebase -i continue with unstaged submodule' '\n test_expect_success 'avoid unnecessary reset' '\n \tgit checkout master &&\n \tgit reset --hard &&\n-\ttest-chmtime =123456789 file3 &&\n+\ttest-tool chmtime =123456789 file3 &&\n \tgit update-index --refresh &&\n \tHEAD=$(git rev-parse HEAD) &&\n \tset_fake_editor &&\n \tgit rebase -i HEAD~4 &&\n \ttest $HEAD = $(git rev-parse HEAD) &&\n-\tMTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&\n+\tMTIME=$(test-tool chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&\n \ttest 123456789 = $MTIME\n '\n \ndiff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh\nindex 7c91a85f43..9214d0bb51 100755\n--- a/t/t3418-rebase-continue.sh\n+++ b/t/t3418-rebase-continue.sh\n@@ -24,7 +24,7 @@ test_expect_success 'interactive rebase --continue works with touched file' '\n \tgit checkout master &&\n \n \tFAKE_LINES=\"edit 1\" git rebase -i HEAD^ &&\n-\ttest-chmtime =-60 F1 &&\n+\ttest-tool chmtime =-60 F1 &&\n \tgit rebase --continue\n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'non-interactive rebase --continue works with touched file'\n \ttest_must_fail git rebase --onto master master topic &&\n \techo \"Resolved\" >F2 &&\n \tgit add F2 &&\n-\ttest-chmtime =-60 F1 &&\n+\ttest-tool chmtime =-60 F1 &&\n \tgit rebase --continue\n '\n \ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 783bdbf59d..ccbc118514 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -86,7 +86,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '\n \t(\n \t\tcd copy &&\n \t\tgit checkout initial &&\n-\t\ttest-chmtime +40 oops &&\n+\t\ttest-tool chmtime +40 oops &&\n \t\tgit cherry-pick added\n \t)\n '\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 0acf4b1461..9f93445f1e 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -247,9 +247,9 @@ test_expect_success '--abort after last commit in sequence' '\n test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '\n \tpristine_detach initial &&\n \ttest_expect_code 1 git cherry-pick base..anotherpick &&\n-\ttest-chmtime -v +0 .git/sequencer >expect &&\n+\ttest-tool chmtime -v +0 .git/sequencer >expect &&\n \ttest_expect_code 128 git cherry-pick unrelatedpick &&\n-\ttest-chmtime -v +0 .git/sequencer >actual &&\n+\ttest-tool chmtime -v +0 .git/sequencer >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 46f15169f5..b8fbdefcdc 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -232,7 +232,7 @@ test_expect_success 'Call \"rm\" from outside the work tree' '\n test_expect_success 'refresh index before checking if it is up-to-date' '\n \n \tgit reset --hard &&\n-\ttest-chmtime -86400 frotz/nitfol &&\n+\ttest-tool chmtime -86400 frotz/nitfol &&\n \tgit rm frotz/nitfol &&\n \ttest ! -f frotz/nitfol\n \ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 2748805642..07af05d7ae 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -187,7 +187,7 @@ test_expect_success 'git add --refresh with pathspec' '\n \techo >foo && echo >bar && echo >baz &&\n \tgit add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo &&\n \techo \"100644 $H 3\tfoo\" | git update-index --index-info &&\n-\ttest-chmtime -60 bar baz &&\n+\ttest-tool chmtime -60 bar baz &&\n \t>expect &&\n \tgit add --refresh bar >actual &&\n \ttest_cmp expect actual &&\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 13e7f621ab..cf0f3a1ee7 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -73,7 +73,7 @@ test_expect_success 'diff identical, but newly created symlink and file' '\n \t>expected &&\n \trm -f frotz nitfol &&\n \techo xyzzy >nitfol &&\n-\ttest-chmtime +10 nitfol &&\n+\ttest-tool chmtime +10 nitfol &&\n \tif test_have_prereq SYMLINKS\n \tthen\n \t\tln -s xyzzy frotz\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 3f9a24fd56..f8d853595b 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -76,7 +76,7 @@ test_expect_success setup '\n \n \tmkdir dir3 &&\n \tcp dir/sub dir3/sub &&\n-\ttest-chmtime +1 dir3/sub &&\n+\ttest-tool chmtime +1 dir3/sub &&\n \n \tgit config log.showroot false &&\n \tgit commit --amend &&\ndiff --git a/t/t4035-diff-quiet.sh b/t/t4035-diff-quiet.sh\nindex 2f1737fcef..0352bf81a9 100755\n--- a/t/t4035-diff-quiet.sh\n+++ b/t/t4035-diff-quiet.sh\n@@ -147,7 +147,7 @@ test_expect_success 'git diff --ignore-all-space, both files outside repo' '\n '\n \n test_expect_success 'git diff --quiet ignores stat-change only entries' '\n-\ttest-chmtime +10 a &&\n+\ttest-tool chmtime +10 a &&\n \techo modified >>b &&\n \ttest_expect_code 1 git diff --quiet\n '\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex 16432781d2..9d8d3c72e7 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -171,7 +171,7 @@ test_expect_success 'am --skip leaves index stat info alone' '\n \tgit checkout -f --orphan skip-stat-info &&\n \tgit reset &&\n \ttest_commit skip-should-be-untouched &&\n-\ttest-chmtime =0 skip-should-be-untouched.t &&\n+\ttest-tool chmtime =0 skip-should-be-untouched.t &&\n \tgit update-index --refresh &&\n \tgit diff-files --exit-code --quiet &&\n \ttest_must_fail git am 0001-*.patch &&\n@@ -183,7 +183,7 @@ test_expect_success 'am --abort leaves index stat info alone' '\n \tgit checkout -f --orphan abort-stat-info &&\n \tgit reset &&\n \ttest_commit abort-should-be-untouched &&\n-\ttest-chmtime =0 abort-should-be-untouched.t &&\n+\ttest-tool chmtime =0 abort-should-be-untouched.t &&\n \tgit update-index --refresh &&\n \tgit diff-files --exit-code --quiet &&\n \ttest_must_fail git am 0001-*.patch &&\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex d97d2bebc9..deafaa3e07 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -166,7 +166,7 @@ test_expect_success 'first postimage wins' '\n \tgit commit -q -a -m \"prefer first over second\" &&\n \ttest -f $rr/postimage &&\n \n-\toldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) &&\n+\toldmtimepost=$(test-tool chmtime -v -60 $rr/postimage | cut -f 1) &&\n \n \tgit checkout -b third master &&\n \tgit show second^:a1 | sed \"s/To die: t/To die! T/\" >a1 &&\n@@ -179,7 +179,7 @@ test_expect_success 'first postimage wins' '\n '\n \n test_expect_success 'rerere updates postimage timestamp' '\n-\tnewmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) &&\n+\tnewmtimepost=$(test-tool chmtime -v +0 $rr/postimage | cut -f 1) &&\n \ttest $oldmtimepost -lt $newmtimepost\n '\n \n@@ -220,9 +220,9 @@ test_expect_success 'set up for garbage collection tests' '\n \talmost_60_days_ago=$((60-60*86400)) &&\n \tjust_over_60_days_ago=$((-1-60*86400)) &&\n \n-\ttest-chmtime =$just_over_60_days_ago $rr/preimage &&\n-\ttest-chmtime =$almost_60_days_ago $rr/postimage &&\n-\ttest-chmtime =$almost_15_days_ago $rr2/preimage\n+\ttest-tool chmtime =$just_over_60_days_ago $rr/preimage &&\n+\ttest-tool chmtime =$almost_60_days_ago $rr/postimage &&\n+\ttest-tool chmtime =$almost_15_days_ago $rr2/preimage\n '\n \n test_expect_success 'gc preserves young or recently used records' '\n@@ -232,8 +232,8 @@ test_expect_success 'gc preserves young or recently used records' '\n '\n \n test_expect_success 'old records rest in peace' '\n-\ttest-chmtime =$just_over_60_days_ago $rr/postimage &&\n-\ttest-chmtime =$just_over_15_days_ago $rr2/preimage &&\n+\ttest-tool chmtime =$just_over_60_days_ago $rr/postimage &&\n+\ttest-tool chmtime =$just_over_15_days_ago $rr2/preimage &&\n \tgit rerere gc &&\n \t! test -f $rr/preimage &&\n \t! test -f $rr2/preimage\n@@ -249,8 +249,8 @@ rerere_gc_custom_expiry_test () {\n \t\t>\"$rr/postimage\" &&\n \n \t\ttwo_days_ago=$((-2*86400)) &&\n-\t\ttest-chmtime =$two_days_ago \"$rr/preimage\" &&\n-\t\ttest-chmtime =$two_days_ago \"$rr/postimage\" &&\n+\t\ttest-tool chmtime =$two_days_ago \"$rr/preimage\" &&\n+\t\ttest-tool chmtime =$two_days_ago \"$rr/postimage\" &&\n \n \t\tfind .git/rr-cache -type f | sort >original &&\n \n@@ -512,7 +512,7 @@ test_expect_success 'multiple identical conflicts' '\n \tcount_pre_post 2 0 &&\n \n \t# Pretend that the conflicts were made quite some time ago\n-\tfind .git/rr-cache/ -type f | xargs test-chmtime -172800 &&\n+\tfind .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&\n \n \t# Unresolved entries have not expired yet\n \tgit -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&\n@@ -568,7 +568,7 @@ test_expect_success 'multiple identical conflicts' '\n \tgit rerere &&\n \n \t# Pretend that the resolutions are old again\n-\tfind .git/rr-cache/ -type f | xargs test-chmtime -172800 &&\n+\tfind .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&\n \n \t# Resolved entries have not expired yet\n \tgit -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex fe2d4f15a7..266d052efb 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -192,7 +192,7 @@ test_expect_success \\\n     'validate file modification time' \\\n     'mkdir extract &&\n      \"$TAR\" xf b.tar -C extract a/a &&\n-     test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&\n+     test-tool chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&\n      echo \"1117231200\" >expected.mtime &&\n      test_cmp expected.mtime b.mtime'\n \ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 6694c19a1e..f0f6e2a5f3 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -15,7 +15,7 @@ add_blob() {\n \tBLOB_FILE=.git/objects/$(echo $BLOB | sed \"s/^../&\\//\") &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =+0 $BLOB_FILE\n+\ttest-tool chmtime =+0 $BLOB_FILE\n }\n \n test_expect_success setup '\n@@ -33,7 +33,7 @@ test_expect_success 'prune stale packs' '\n \torig_pack=$(echo .git/objects/pack/*.pack) &&\n \t: > .git/objects/tmp_1.pack &&\n \t: > .git/objects/tmp_2.pack &&\n-\ttest-chmtime =-86501 .git/objects/tmp_1.pack &&\n+\ttest-tool chmtime =-86501 .git/objects/tmp_1.pack &&\n \tgit prune --expire 1.day &&\n \ttest_path_is_file $orig_pack &&\n \ttest_path_is_file .git/objects/tmp_2.pack &&\n@@ -47,7 +47,7 @@ test_expect_success 'prune --expire' '\n \tgit prune --expire=1.hour.ago &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =-86500 $BLOB_FILE &&\n+\ttest-tool chmtime =-86500 $BLOB_FILE &&\n \tgit prune --expire 1.day &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n@@ -57,11 +57,11 @@ test_expect_success 'prune --expire' '\n test_expect_success 'gc: implicit prune --expire' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((2*$week-30)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&\n \tgit gc &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =-$((2*$week+1)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&\n \tgit gc &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n@@ -141,7 +141,7 @@ test_expect_success 'prune: do not prune heads listed as an argument' '\n test_expect_success 'gc --no-prune' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((5001*$day)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc --no-prune &&\n \tverbose test 1 = $(git count-objects | sed \"s/ .*//\") &&\n@@ -163,7 +163,7 @@ test_expect_success 'gc respects gc.pruneExpire' '\n test_expect_success 'gc --prune=<date>' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((5001*$day)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit gc --prune=5002.days.ago &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=5000.days.ago &&\n@@ -205,7 +205,7 @@ test_expect_success 'prune --expire=never' '\n \n test_expect_success 'gc: prune old objects after local clone' '\n \tadd_blob &&\n-\ttest-chmtime =-$((2*$week+1)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&\n \tgit clone --no-hardlinks . aclone &&\n \t(\n \t\tcd aclone &&\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex d375d7110d..911eae1bf7 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -180,7 +180,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n \t    # And create a file that follows the temporary object naming\n \t    # convention for the auto-gc to remove\n \t    : >.git/objects/tmp_test_object &&\n-\t    test-chmtime =-1209601 .git/objects/tmp_test_object\n+\t    test-tool chmtime =-1209601 .git/objects/tmp_test_object\n \t) &&\n \t(\n \t    cd parent &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 177897ea0b..82239138d5 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -1418,7 +1418,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '\n \t\tcd testrepo &&\n \t\tgit reset --hard HEAD^ &&\n \t\ttest $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&\n-\t\ttest-chmtime +100 path1\n+\t\ttest-tool chmtime +100 path1\n \t) &&\n \tgit push testrepo master &&\n \t(\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex c01f721f13..a1fad6980b 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -635,10 +635,10 @@ test_expect_success 'setup avoid unnecessary update, normal rename' '\n \n test_expect_success 'avoid unnecessary update, normal rename' '\n \tgit checkout -q avoid-unnecessary-update-1^0 &&\n-\ttest-chmtime =1000000000 rename &&\n-\ttest-chmtime -v +0 rename >expect &&\n+\ttest-tool chmtime =1000000000 rename &&\n+\ttest-tool chmtime -v +0 rename >expect &&\n \tgit merge merge-branch-1 &&\n-\ttest-chmtime -v +0 rename >actual &&\n+\ttest-tool chmtime -v +0 rename >actual &&\n \ttest_cmp expect actual # \"rename\" should have stayed intact\n '\n \n@@ -668,10 +668,10 @@ test_expect_success 'setup to test avoiding unnecessary update, with D/F conflic\n \n test_expect_success 'avoid unnecessary update, with D/F conflict' '\n \tgit checkout -q avoid-unnecessary-update-2^0 &&\n-\ttest-chmtime =1000000000 df &&\n-\ttest-chmtime -v +0 df >expect &&\n+\ttest-tool chmtime =1000000000 df &&\n+\ttest-tool chmtime -v +0 df >expect &&\n \tgit merge merge-branch-2 &&\n-\ttest-chmtime -v +0 df >actual &&\n+\ttest-tool chmtime -v +0 df >actual &&\n \ttest_cmp expect actual # \"df\" should have stayed intact\n '\n \n@@ -700,10 +700,10 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '\n \n test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 df &&\n-\ttest-chmtime -v +0 df >expect &&\n+\ttest-tool chmtime =1000000000 df &&\n+\ttest-tool chmtime -v +0 df >expect &&\n \tgit merge side &&\n-\ttest-chmtime -v +0 df >actual &&\n+\ttest-tool chmtime -v +0 df >actual &&\n \ttest_cmp expect actual # \"df\" should have stayed intact\n '\n \n@@ -730,10 +730,10 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '\n \n test_expect_success 'avoid unnecessary update, modify/delete' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 file &&\n-\ttest-chmtime -v +0 file >expect &&\n+\ttest-tool chmtime =1000000000 file &&\n+\ttest-tool chmtime -v +0 file >expect &&\n \ttest_must_fail git merge side &&\n-\ttest-chmtime -v +0 file >actual &&\n+\ttest-tool chmtime -v +0 file >actual &&\n \ttest_cmp expect actual # \"file\" should have stayed intact\n '\n \n@@ -759,10 +759,10 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '\n \n test_expect_success 'avoid unnecessary update, rename/add-dest' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 newfile &&\n-\ttest-chmtime -v +0 newfile >expect &&\n+\ttest-tool chmtime =1000000000 newfile &&\n+\ttest-tool chmtime -v +0 newfile >expect &&\n \tgit merge side &&\n-\ttest-chmtime -v +0 newfile >actual &&\n+\ttest-tool chmtime -v +0 newfile >actual &&\n \ttest_cmp expect actual # \"file\" should have stayed intact\n '\n \ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 41b0be575d..d5255dd576 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -87,7 +87,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re\n \ttest_must_fail git gc --auto 2>err &&\n \ttest_i18ngrep \"^error:\" err &&\n \ttest_config gc.logexpiry 5.days &&\n-\ttest-chmtime =-345600 .git/gc.log &&\n+\ttest-tool chmtime =-345600 .git/gc.log &&\n \ttest_must_fail git gc --auto &&\n \ttest_config gc.logexpiry 2.days &&\n \trun_and_wait_for_auto_gc &&\ndiff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh\nindex 394b169ead..765cced60b 100755\n--- a/t/t6501-freshen-objects.sh\n+++ b/t/t6501-freshen-objects.sh\n@@ -73,7 +73,7 @@ for repack in '' true; do\n \n \ttest_expect_success \"simulate time passing ($title)\" '\n \t\tfind .git/objects -type f |\n-\t\txargs test-chmtime -v -86400\n+\t\txargs test-tool chmtime -v -86400\n \t'\n \n \ttest_expect_success \"start writing new commit with old blob ($title)\" '\n@@ -104,7 +104,7 @@ for repack in '' true; do\n \ttest_expect_success \"abandon objects again ($title)\" '\n \t\tgit reset --hard HEAD^ &&\n \t\tfind .git/objects -type f |\n-\t\txargs test-chmtime -v -86400\n+\t\txargs test-tool chmtime -v -86400\n \t'\n \n \ttest_expect_success \"start writing new commit with same tree ($title)\" '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 50052e2872..7afadb175a 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1672,12 +1672,12 @@ test_expect_success '\"Initial commit\" should not be noted in commit template' '\n '\n \n test_expect_success '--no-optional-locks prevents index update' '\n-\ttest-chmtime =1234567890 .git/index &&\n+\ttest-tool chmtime =1234567890 .git/index &&\n \tgit --no-optional-locks status &&\n-\ttest-chmtime -v +0 .git/index >out &&\n+\ttest-tool chmtime -v +0 .git/index >out &&\n \tgrep ^1234567890 out &&\n \tgit status &&\n-\ttest-chmtime -v +0 .git/index >out &&\n+\ttest-tool chmtime -v +0 .git/index >out &&\n \t! grep ^1234567890 out\n '\n \ndiff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh\nindex 987573c41f..8a586ab021 100755\n--- a/t/t7701-repack-unpack-unreachable.sh\n+++ b/t/t7701-repack-unpack-unreachable.sh\n@@ -90,7 +90,7 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '\n \ttmppack=\".git/objects/pack/tmp_pack\" &&\n \tln \"$packfile\" \"$tmppack\" &&\n \tgit repack -A -l -d &&\n-\ttest-chmtime -v +0 \"$tmppack\" \"$fsha1path\" \"$csha1path\" \"$tsha1path\" \\\n+\ttest-tool chmtime -v +0 \"$tmppack\" \"$fsha1path\" \"$csha1path\" \"$tsha1path\" \\\n \t\t> mtimes &&\n \tcompare_mtimes < mtimes\n '\n@@ -103,7 +103,7 @@ test_expect_success 'do not bother loosening old objects' '\n \tgit prune-packed &&\n \tgit cat-file -p $obj1 &&\n \tgit cat-file -p $obj2 &&\n-\ttest-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&\n+\ttest-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&\n \tgit repack -A -d --unpack-unreachable=1.hour.ago &&\n \tgit cat-file -p $obj1 &&\n \ttest_must_fail git cat-file -p $obj2\n@@ -117,7 +117,7 @@ test_expect_success 'keep packed objects found only in index' '\n \tgit reset HEAD^ &&\n \tgit reflog expire --expire=now --all &&\n \tgit add file &&\n-\ttest-chmtime =-86400 .git/objects/pack/* &&\n+\ttest-tool chmtime =-86400 .git/objects/pack/* &&\n \tgit gc --prune=1.hour.ago &&\n \tgit cat-file blob :file\n '\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 8a8ba65a2a..c937330a5f 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -288,12 +288,12 @@ test_expect_success 'able to dcommit to a subdirectory' '\n \n test_expect_success 'dcommit should not fail with a touched file' '\n \ttest_commit \"commit-new-file-foo2\" foo2 &&\n-\ttest-chmtime =-60 foo &&\n+\ttest-tool chmtime =-60 foo &&\n \tgit svn dcommit\n '\n \n test_expect_success 'rebase should not fail with a touched file' '\n-\ttest-chmtime =-60 foo &&\n+\ttest-tool chmtime =-60 foo &&\n \tgit svn rebase\n '\n \ndiff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh\nindex d950c7d665..d5c3675100 100755\n--- a/t/t9803-git-p4-shell-metachars.sh\n+++ b/t/t9803-git-p4-shell-metachars.sh\n@@ -28,7 +28,7 @@ test_expect_success 'shell metachars in filenames' '\n \t\techo f2 >\"file with spaces\" &&\n \t\tgit add \"file with spaces\" &&\n \t\tgit commit -m \"add files\" &&\n-\t\tP4EDITOR=\"test-chmtime +5\" git p4 submit\n+\t\tP4EDITOR=\"test-tool chmtime +5\" git p4 submit\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\n@@ -47,7 +47,7 @@ test_expect_success 'deleting with shell metachars' '\n \t\tgit rm foo\\$bar &&\n \t\tgit rm file\\ with\\ spaces &&\n \t\tgit commit -m \"remove files\" &&\n-\t\tP4EDITOR=\"test-chmtime +5\" git p4 submit\n+\t\tP4EDITOR=\"test-tool chmtime +5\" git p4 submit\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\ndiff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh\nindex bda222aa02..783c6ad165 100755\n--- a/t/t9813-git-p4-preserve-users.sh\n+++ b/t/t9813-git-p4-preserve-users.sh\n@@ -53,7 +53,7 @@ test_expect_success 'preserve users' '\n \t\tgit commit --author \"Alice <alice@example.com>\" -m \"a change by alice\" file1 &&\n \t\tgit commit --author \"Bob <bob@example.com>\" -m \"a change by bob\" file2 &&\n \t\tgit config git-p4.skipSubmitEditCheck true &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=alice P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=alice P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\tgit p4 commit --preserve-user &&\n \t\tp4_check_commit_author file1 alice &&\n@@ -71,7 +71,7 @@ test_expect_success 'refuse to preserve users without perms' '\n \t\tgit config git-p4.skipSubmitEditCheck true &&\n \t\techo \"username-noperms: a change by alice\" >>file1 &&\n \t\tgit commit --author \"Alice <alice@example.com>\" -m \"perms: a change by alice\" file1 &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=bob P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=bob P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\ttest_must_fail git p4 commit --preserve-user &&\n \t\t! git diff --exit-code HEAD..p4/master\n@@ -89,7 +89,7 @@ test_expect_success 'preserve user where author is unknown to p4' '\n \t\tgit commit --author \"Bob <bob@example.com>\" -m \"preserve: a change by bob\" file1 &&\n \t\techo \"username-unknown: a change by charlie\" >>file1 &&\n \t\tgit commit --author \"Charlie <charlie@example.com>\" -m \"preserve: a change by charlie\" file1 &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=alice P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=alice P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\ttest_must_fail git p4 commit --preserve-user &&\n \t\t! git diff --exit-code HEAD..p4/master &&\ndiff --git a/t/t9820-git-p4-editor-handling.sh b/t/t9820-git-p4-editor-handling.sh\nindex 6dc6df032e..3c22f74bd4 100755\n--- a/t/t9820-git-p4-editor-handling.sh\n+++ b/t/t9820-git-p4-editor-handling.sh\n@@ -26,7 +26,7 @@ test_expect_success 'EDITOR with options' '\n \t\tcd \"$git\" &&\n \t\techo change >file1 &&\n \t\tgit commit -m \"change\" file1 &&\n-\t\tP4EDITOR=\": >\\\"$git/touched\\\" && test-chmtime +5\" git p4 submit &&\n+\t\tP4EDITOR=\": >\\\"$git/touched\\\" && test-tool chmtime +5\" git p4 submit &&\n \t\ttest_path_is_file \"$git/touched\"\n \t)\n '\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7740d511d2..7ab8af47a5 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -963,10 +963,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\"/t/helper/test-tool\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 'You need to build test-tool:'\n+\techo >&2 'Run \"make t/helper/test-tool\" in the source (toplevel) directory'\n \texit 1\n fi\n \n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342006","messageId":"20180317075421.22032-10-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 09/36] t/helper: merge test-drop-caches into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:54Z","receivedAt":"2018-03-17T07:57:22Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    |  2 +-\n t/helper/test-drop-caches.c |  3 ++-\n t/helper/test-tool.c        |  1 +\n t/helper/test-tool.h        |  1 +\n t/perf/p7519-fsmonitor.sh   | 12 ++++++------\n 5 files changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 327d63217a..edd9c43982 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -657,10 +657,10 @@ TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n+TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-split-index\ndiff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\nindex bd1a857d52..2aa7c57b4a 100644\n--- a/t/helper/test-drop-caches.c\n+++ b/t/helper/test-drop-caches.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n \n #if defined(GIT_WINDOWS_NATIVE)\n@@ -157,7 +158,7 @@ static int cmd_dropcaches(void)\n \n #endif\n \n-int cmd_main(int argc, const char **argv)\n+int test_drop_caches(int argc, const char **argv)\n {\n \tcmd_sync();\n \treturn cmd_dropcaches();\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex e48c1f2d5f..904e4103fd 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -12,6 +12,7 @@ static struct test_cmd cmds[] = {\n \t{ \"ctype\", test_ctype },\n \t{ \"date\", test_date },\n \t{ \"delta\", test_delta },\n+\t{ \"drop-caches\", test_drop_caches },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 0ee098f1e3..1e96bf44a2 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -6,6 +6,7 @@ int test_config(int argc, const char **argv);\n int test_ctype(int argc, const char **argv);\n int test_date(int argc, const char **argv);\n int test_delta(int argc, const char **argv);\n+int test_drop_caches(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh\nindex 65e145c02d..def7ecdbc7 100755\n--- a/t/perf/p7519-fsmonitor.sh\n+++ b/t/perf/p7519-fsmonitor.sh\n@@ -118,7 +118,7 @@ test_expect_success \"setup for fsmonitor\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -126,7 +126,7 @@ test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -134,7 +134,7 @@ test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uall (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -148,7 +148,7 @@ test_expect_success \"setup without fsmonitor\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -156,7 +156,7 @@ test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -164,7 +164,7 @@ test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uall (fsmonitor=$INTEGRATION_SCRIPT)\" '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342007","messageId":"20180317075421.22032-5-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:49Z","receivedAt":"2018-03-17T07:57:26Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                                |  2 +-\n cache.h                                 |  2 +-\n name-hash.c                             |  2 +-\n t/helper/test-lazy-init-name-hash.c     | 26 ++++++++++++++-----------\n t/helper/test-tool.c                    |  1 +\n t/helper/test-tool.h                    |  1 +\n t/perf/p0004-lazy-init-name-hash.sh     |  8 ++++----\n t/t3008-ls-files-lazy-init-name-hash.sh |  2 +-\n 8 files changed, 25 insertions(+), 19 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3c0d0474af..31287cedf2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,6 +653,7 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n@@ -669,7 +670,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n-TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\ndiff --git a/cache.h b/cache.h\nindex d06932ed0b..8ff5ae9903 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -333,7 +333,7 @@ struct index_state {\n extern struct index_state the_index;\n \n /* Name hashing */\n-extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);\n+extern int lazy_init_name_hash_for_testing(struct index_state *istate, int try_threaded);\n extern void add_name_hash(struct index_state *istate, struct cache_entry *ce);\n extern void remove_name_hash(struct index_state *istate, struct cache_entry *ce);\n extern void free_name_hash(struct index_state *istate);\ndiff --git a/name-hash.c b/name-hash.c\nindex 163849831c..182f630acc 100644\n--- a/name-hash.c\n+++ b/name-hash.c\n@@ -614,7 +614,7 @@ static void lazy_init_name_hash(struct index_state *istate)\n  * Requesting threading WILL NOT override guards\n  * in lookup_lazy_params().\n  */\n-int test_lazy_init_name_hash(struct index_state *istate, int try_threaded)\n+int lazy_init_name_hash_for_testing(struct index_state *istate, int try_threaded)\n {\n \tlazy_nr_dir_threads = 0;\n \tlazy_try_threaded = try_threaded;\ndiff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\nindex 297fb01d61..dd4e753008 100644\n--- a/t/helper/test-lazy-init-name-hash.c\n+++ b/t/helper/test-lazy-init-name-hash.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"parse-options.h\"\n \n@@ -9,6 +10,9 @@ static int perf;\n static int analyze;\n static int analyze_step;\n \n+static int (*init_name_hash)(struct index_state *istate, int try_threaded) =\n+\tlazy_init_name_hash_for_testing;\n+\n /*\n  * Dump the contents of the \"dir\" and \"name\" hash tables to stdout.\n  * If you sort the result, you can compare it with the other type\n@@ -33,9 +37,9 @@ static void dump_run(void)\n \n \tread_cache();\n \tif (single) {\n-\t\ttest_lazy_init_name_hash(&the_index, 0);\n+\t\tinit_name_hash(&the_index, 0);\n \t} else {\n-\t\tint nr_threads_used = test_lazy_init_name_hash(&the_index, 1);\n+\t\tint nr_threads_used = init_name_hash(&the_index, 1);\n \t\tif (!nr_threads_used)\n \t\t\tdie(\"non-threaded code path used\");\n \t}\n@@ -71,7 +75,7 @@ static uint64_t time_runs(int try_threaded)\n \t\tt0 = getnanotime();\n \t\tread_cache();\n \t\tt1 = getnanotime();\n-\t\tnr_threads_used = test_lazy_init_name_hash(&the_index, try_threaded);\n+\t\tnr_threads_used = init_name_hash(&the_index, try_threaded);\n \t\tt2 = getnanotime();\n \n \t\tsum += (t2 - t1);\n@@ -134,7 +138,7 @@ static void analyze_run(void)\n \t\t\tread_cache();\n \t\t\tthe_index.cache_nr = nr; /* cheap truncate of index */\n \t\t\tt1s = getnanotime();\n-\t\t\ttest_lazy_init_name_hash(&the_index, 0);\n+\t\t\tinit_name_hash(&the_index, 0);\n \t\t\tt2s = getnanotime();\n \t\t\tsum_single += (t2s - t1s);\n \t\t\tthe_index.cache_nr = cache_nr_limit;\n@@ -143,7 +147,7 @@ static void analyze_run(void)\n \t\t\tread_cache();\n \t\t\tthe_index.cache_nr = nr; /* cheap truncate of index */\n \t\t\tt1m = getnanotime();\n-\t\t\tnr_threads_used = test_lazy_init_name_hash(&the_index, 1);\n+\t\t\tnr_threads_used = init_name_hash(&the_index, 1);\n \t\t\tt2m = getnanotime();\n \t\t\tsum_multi += (t2m - t1m);\n \t\t\tthe_index.cache_nr = cache_nr_limit;\n@@ -184,14 +188,14 @@ static void analyze_run(void)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_lazy_init_name_hash(int argc, const char **argv)\n {\n \tconst char *usage[] = {\n-\t\t\"test-lazy-init-name-hash -d (-s | -m)\",\n-\t\t\"test-lazy-init-name-hash -p [-c c]\",\n-\t\t\"test-lazy-init-name-hash -a a [--step s] [-c c]\",\n-\t\t\"test-lazy-init-name-hash (-s | -m) [-c c]\",\n-\t\t\"test-lazy-init-name-hash -s -m [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -d (-s | -m)\",\n+\t\t\"test-tool lazy-init-name-hash -p [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -a a [--step s] [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash (-s | -m) [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -s -m [-c c]\",\n \t\tNULL\n \t};\n \tstruct option options[] = {\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex ca1f462cce..c4e9933f93 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", test_chmtime },\n+\t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex e7a2a7cb5b..eaec143259 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,6 +2,7 @@\n #define __TEST_TOOL_H__\n \n int test_chmtime(int argc, const char **argv);\n+int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0004-lazy-init-name-hash.sh b/t/perf/p0004-lazy-init-name-hash.sh\nindex 8de5a98cfc..1afc08fe7f 100755\n--- a/t/perf/p0004-lazy-init-name-hash.sh\n+++ b/t/perf/p0004-lazy-init-name-hash.sh\n@@ -7,8 +7,8 @@ test_perf_large_repo\n test_checkout_worktree\n \n test_expect_success 'verify both methods build the same hashmaps' '\n-\ttest-lazy-init-name-hash --dump --single >out.single &&\n-\tif test-lazy-init-name-hash --dump --multi >out.multi\n+\ttest-tool lazy-init-name-hash --dump --single >out.single &&\n+\tif test-tool lazy-init-name-hash --dump --multi >out.multi\n \tthen\n \t\ttest_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&\n \t\tsort <out.single >sorted.single &&\n@@ -46,11 +46,11 @@ test_expect_success 'calibrate' '\n '\n \n test_perf \"single-threaded, $desc\" \"\n-\ttest-lazy-init-name-hash --single --count=$count\n+\ttest-tool lazy-init-name-hash --single --count=$count\n \"\n \n test_perf REPO_BIG_ENOUGH_FOR_MULTI \"multi-threaded, $desc\" \"\n-\ttest-lazy-init-name-hash --multi --count=$count\n+\ttest-tool lazy-init-name-hash --multi --count=$count\n \"\n \n test_done\ndiff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh\nindex bdf5198b7e..8df4aa7c99 100755\n--- a/t/t3008-ls-files-lazy-init-name-hash.sh\n+++ b/t/t3008-ls-files-lazy-init-name-hash.sh\n@@ -21,7 +21,7 @@ test_expect_success 'no buffer overflow in lazy_init_name_hash' '\n \t) |\n \tsed \"s/^/100644 $EMPTY_BLOB\t/\" |\n \tgit update-index --index-info &&\n-\ttest-lazy-init-name-hash -m\n+\ttest-tool lazy-init-name-hash -m\n '\n \n test_done\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342008","messageId":"20180317075421.22032-8-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 07/36] t/helper: merge test-date into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:52Z","receivedAt":"2018-03-17T07:57:28Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               |  2 +-\n t/helper/test-date.c   | 17 +++++++++--------\n t/helper/test-tool.c   |  1 +\n t/helper/test-tool.h   |  1 +\n t/t0006-date.sh        |  8 ++++----\n t/t1300-repo-config.sh |  2 +-\n t/test-lib.sh          |  4 ++--\n 7 files changed, 19 insertions(+), 16 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d09710dc3d..efb1872c52 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -655,10 +655,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n+TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-date\n TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\ndiff --git a/t/helper/test-date.c b/t/helper/test-date.c\nindex ac83687970..96f4631c35 100644\n--- a/t/helper/test-date.c\n+++ b/t/helper/test-date.c\n@@ -1,13 +1,14 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n static const char *usage_msg = \"\\n\"\n-\"  test-date relative [time_t]...\\n\"\n-\"  test-date show:<format> [time_t]...\\n\"\n-\"  test-date parse [date]...\\n\"\n-\"  test-date approxidate [date]...\\n\"\n-\"  test-date timestamp [date]...\\n\"\n-\"  test-date is64bit\\n\"\n-\"  test-date time_t-is64bit\\n\";\n+\"  test-tool date relative [time_t]...\\n\"\n+\"  test-tool date show:<format> [time_t]...\\n\"\n+\"  test-tool date parse [date]...\\n\"\n+\"  test-tool date approxidate [date]...\\n\"\n+\"  test-tool date timestamp [date]...\\n\"\n+\"  test-tool date is64bit\\n\"\n+\"  test-tool date time_t-is64bit\\n\";\n \n static void show_relative_dates(const char **argv, struct timeval *now)\n {\n@@ -81,7 +82,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int test_date(int argc, const char **argv)\n {\n \tstruct timeval now;\n \tconst char *x;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex eef6a8e003..fe130ffbf2 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -10,6 +10,7 @@ static struct test_cmd cmds[] = {\n \t{ \"chmtime\", test_chmtime },\n \t{ \"config\", test_config },\n \t{ \"ctype\", test_ctype },\n+\t{ \"date\", test_date },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 41620666e3..99ca1176dc 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -4,6 +4,7 @@\n int test_chmtime(int argc, const char **argv);\n int test_config(int argc, const char **argv);\n int test_ctype(int argc, const char **argv);\n+int test_date(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 7ac9466d50..64ff86df8e 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -10,7 +10,7 @@ check_relative() {\n \tt=$(($TEST_DATE_NOW - $1))\n \techo \"$t -> $2\" >expect\n \ttest_expect_${3:-success} \"relative date ($2)\" \"\n-\ttest-date relative $t >actual &&\n+\ttest-tool date relative $t >actual &&\n \ttest_i18ncmp expect actual\n \t\"\n }\n@@ -35,7 +35,7 @@ check_show () {\n \tzone=$5\n \ttest_expect_success $prereqs \"show date ($format:$time)\" '\n \t\techo \"$time -> $expect\" >expect &&\n-\t\tTZ=${zone:-$TZ} test-date show:\"$format\" \"$time\" >actual &&\n+\t\tTZ=${zone:-$TZ} test-tool date show:\"$format\" \"$time\" >actual &&\n \t\ttest_cmp expect actual\n \t'\n }\n@@ -71,7 +71,7 @@ check_show iso-local \"$FUTURE\" \"2152-06-19 22:24:56 +0000\" TIME_IS_64BIT,TIME_T_\n check_parse() {\n \techo \"$1 -> $2\" >expect\n \ttest_expect_${4:-success} \"parse date ($1${3:+ TZ=$3})\" \"\n-\tTZ=${3:-$TZ} test-date parse '$1' >actual &&\n+\tTZ=${3:-$TZ} test-tool date parse '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n }\n@@ -92,7 +92,7 @@ check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST5\n check_approxidate() {\n \techo \"$1 -> $2 +0000\" >expect\n \ttest_expect_${3:-success} \"parse approxidate ($1)\" \"\n-\ttest-date approxidate '$1' >actual &&\n+\ttest-tool date approxidate '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n }\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 4f8e6f5fde..8780934478 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -914,7 +914,7 @@ test_expect_success 'get --expiry-date' '\n \tinvalid1 = \"abc\"\n \tEOF\n \tcat >expect <<-EOF &&\n-\t$(test-date timestamp $rel)\n+\t$(test-tool date timestamp $rel)\n \t1275666415\n \t1510441871\n \t1510348087\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7ab8af47a5..483c8d6d7c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1206,5 +1206,5 @@ test_lazy_prereq LONG_IS_64BIT '\n \ttest 8 -le \"$(build_option sizeof-long)\"\n '\n \n-test_lazy_prereq TIME_IS_64BIT 'test-date is64bit'\n-test_lazy_prereq TIME_T_IS_64BIT 'test-date time_t-is64bit'\n+test_lazy_prereq TIME_IS_64BIT 'test-tool date is64bit'\n+test_lazy_prereq TIME_T_IS_64BIT 'test-tool date time_t-is64bit'\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342009","messageId":"20180317075421.22032-7-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH 06/36] t/helper: merge test-ctype into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-17T07:53:51Z","receivedAt":"2018-03-17T07:57:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               | 2 +-\n t/helper/test-ctype.c  | 3 ++-\n t/helper/test-tool.c   | 1 +\n t/helper/test-tool.h   | 1 +\n t/t0070-fundamental.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 227f16ad17..d09710dc3d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -654,10 +654,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n+TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \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-drop-caches\ndiff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c\nindex bb72c47df5..a1b0fb344a 100644\n--- a/t/helper/test-ctype.c\n+++ b/t/helper/test-ctype.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n static int rc;\n@@ -28,7 +29,7 @@ static int is_in(const char *s, int ch)\n #define LOWER \"abcdefghijklmnopqrstuvwxyz\"\n #define UPPER \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n \n-int cmd_main(int argc, const char **argv)\n+int test_ctype(int argc, const char **argv)\n {\n \tTEST_CLASS(isdigit, DIGIT);\n \tTEST_CLASS(isspace, \" \\n\\r\\t\");\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 64d1632d92..eef6a8e003 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -9,6 +9,7 @@ struct test_cmd {\n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", test_chmtime },\n \t{ \"config\", test_config },\n+\t{ \"ctype\", test_ctype },\n \t{ \"lazy-init-name-hash\", test_lazy_init_name_hash },\n \t{ \"sha1\", test_sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 00eef888fa..41620666e3 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -3,6 +3,7 @@\n \n int test_chmtime(int argc, const char **argv);\n int test_config(int argc, const char **argv);\n+int test_ctype(int argc, const char **argv);\n int test_lazy_init_name_hash(int argc, const char **argv);\n int test_sha1(int argc, const char **argv);\n \ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex 991ed2a48d..70d4d98a2e 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -9,7 +9,7 @@ Verify wrappers and compatibility functions.\n . ./test-lib.sh\n \n test_expect_success 'character classes (isspace, isalpha etc.)' '\n-\ttest-ctype\n+\ttest-tool ctype\n '\n \n test_expect_success 'mktemp to nonexistent directory prints filename' '\n-- \n2.16.2.903.gd04caf5039\n\n"},{"id":"342071","messageId":"CAPig+cTSqxLTDoq3xGAmf1xCyCX0jvwyoSL5GApgaNg5PVPGGg@mail.gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-5-pclouds@gmail.com","subject":"Re: [PATCH 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-18T02:11:07Z","receivedAt":"2018-03-18T02:11:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Mar 17, 2018 at 3:53 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n> diff --git a/cache.h b/cache.h\n> @@ -333,7 +333,7 @@ struct index_state {\n> -extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);\n> +extern int lazy_init_name_hash_for_testing(struct index_state *istate, int try_threaded);\n\nI get why you renamed this since the \"main\" function in the test\nprogram wants to be called 'test_lazy_init_name_hash'...\n\n> diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\n> @@ -9,6 +10,9 @@ static int perf;\n> +static int (*init_name_hash)(struct index_state *istate, int try_threaded) =\n> +       lazy_init_name_hash_for_testing;\n> +\n> @@ -33,9 +37,9 @@ static void dump_run(void)\n>         if (single) {\n> -               test_lazy_init_name_hash(&the_index, 0);\n> +               init_name_hash(&the_index, 0);\n\n... but I'm having trouble understanding why this indirection through\n'init_name_hash' is used rather than just calling\nlazy_init_name_hash_for_testing() directly. Am I missing something\nobvious or is 'init_name_hash' just an unneeded artifact of an earlier\niteration before the rename in cache.{c,h}?\n"},{"id":"342072","messageId":"CAPig+cSA16Da2Q=8Q7iUVF4smAyhJMe5qV-tvevePzj8BjEuKw@mail.gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-23-pclouds@gmail.com","subject":"Re: [PATCH 22/36] t/helepr: merge test-read-cache into test-tool","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-18T02:21:58Z","receivedAt":"2018-03-18T02:22:05Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Mar 17, 2018 at 3:54 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n> t/helepr: merge test-read-cache into test-tool\n\ns/helepr/helper/\n\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n"},{"id":"342073","messageId":"CAPig+cQXiVwrUroYqjeST3r4kwnLri=9xSrGAq+ksEeF44=HZA@mail.gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-35-pclouds@gmail.com","subject":"Re: [PATCH 34/36] t/helper: merge test-urlmatch-.. into test-tool","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-18T02:32:20Z","receivedAt":"2018-03-18T02:32:30Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Mar 17, 2018 at 3:54 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n> t/helper: merge test-urlmatch-.. into test-tool\n\nSpelled out fully:\n\n    t/helper: merge test-urlmatch-normalization into test-tool\n\nneeds only 58 columns, so is well within the 70-72 column\nrecommendation for summary line.\n\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n"},{"id":"342080","messageId":"CACsJy8CeXZJashmh+sLykRR4Mm_EwnASMVyB-4ztEcfQXU7MXw@mail.gmail.com","threadId":"48064","inReplyTo":"CAPig+cTSqxLTDoq3xGAmf1xCyCX0jvwyoSL5GApgaNg5PVPGGg@mail.gmail.com","subject":"Re: [PATCH 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-18T08:25:35Z","receivedAt":"2018-03-18T08:26:11Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Mar 18, 2018 at 3:11 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Sat, Mar 17, 2018 at 3:53 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n>> diff --git a/cache.h b/cache.h\n>> @@ -333,7 +333,7 @@ struct index_state {\n>> -extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);\n>> +extern int lazy_init_name_hash_for_testing(struct index_state *istate, int try_threaded);\n>\n> I get why you renamed this since the \"main\" function in the test\n> program wants to be called 'test_lazy_init_name_hash'...\n>\n>> diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\n>> @@ -9,6 +10,9 @@ static int perf;\n>> +static int (*init_name_hash)(struct index_state *istate, int try_threaded) =\n>> +       lazy_init_name_hash_for_testing;\n>> +\n>> @@ -33,9 +37,9 @@ static void dump_run(void)\n>>         if (single) {\n>> -               test_lazy_init_name_hash(&the_index, 0);\n>> +               init_name_hash(&the_index, 0);\n>\n> ... but I'm having trouble understanding why this indirection through\n> 'init_name_hash' is used rather than just calling\n> lazy_init_name_hash_for_testing() directly. Am I missing something\n> obvious or is 'init_name_hash' just an unneeded artifact of an earlier\n> iteration before the rename in cache.{c,h}?\n\nNope. It just feels too long to me and because we're already in the\ntest I don't feel the need to repeat _for_testing everywhere. If it's\nconfusing, I'll remove init_name_hash.\n-- \nDuy\n"},{"id":"342082","messageId":"CAPig+cRGpD1_U5PgO=-1wrsiyWqY4GmE3tWNdgCnuAh7PUjvHg@mail.gmail.com","threadId":"48064","inReplyTo":"CACsJy8CeXZJashmh+sLykRR4Mm_EwnASMVyB-4ztEcfQXU7MXw@mail.gmail.com","subject":"Re: [PATCH 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-18T08:47:20Z","receivedAt":"2018-03-18T08:47:26Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Mar 18, 2018 at 4:25 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Sun, Mar 18, 2018 at 3:11 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>> On Sat, Mar 17, 2018 at 3:53 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n>>> -extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);\n>>> +extern int lazy_init_name_hash_for_testing(struct index_state *istate, int try_threaded);\n>>\n>> I get why you renamed this since the \"main\" function in the test\n>> program wants to be called 'test_lazy_init_name_hash'...\n>>\n>>> diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\n>>> @@ -9,6 +10,9 @@ static int perf;\n>>> +static int (*init_name_hash)(struct index_state *istate, int try_threaded) =\n>>> +       lazy_init_name_hash_for_testing;\n>>> +\n>>> @@ -33,9 +37,9 @@ static void dump_run(void)\n>>>         if (single) {\n>>> -               test_lazy_init_name_hash(&the_index, 0);\n>>> +               init_name_hash(&the_index, 0);\n>>\n>> ... but I'm having trouble understanding why this indirection through\n>> 'init_name_hash' is used rather than just calling\n>> lazy_init_name_hash_for_testing() directly. Am I missing something\n>> obvious or is 'init_name_hash' just an unneeded artifact of an earlier\n>> iteration before the rename in cache.{c,h}?\n>\n> Nope. It just feels too long to me and because we're already in the\n> test I don't feel the need to repeat _for_testing everywhere. If it's\n> confusing, I'll remove init_name_hash.\n\nWithout an explanatory in-code comment, I'd guess that someone coming\nacross this in the future will also stumble over it just like I did in\nthe review.\n\nWhat if, instead, you rename test_lazy_init_name_hash() to\nlazy_init_name_hash_test(), shifting 'test' from the front to the back\nof the name? That way, the name remains the same length at the call\nsites in the test helper, and you don't have to introduce the\nconfusing, otherwise unneeded 'init_name_hash'.\n"},{"id":"342132","messageId":"edbc7234-ee60-6f3e-ae09-94721e4b5faa@jeffhostetler.com","threadId":"48064","inReplyTo":"CAPig+cRGpD1_U5PgO=-1wrsiyWqY4GmE3tWNdgCnuAh7PUjvHg@mail.gmail.com","subject":"Re: [PATCH 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2018-03-19T09:40:30Z","receivedAt":"2018-03-19T09:40:40Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\n\nOn 3/18/2018 4:47 AM, Eric Sunshine wrote:\n> On Sun, Mar 18, 2018 at 4:25 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n>> On Sun, Mar 18, 2018 at 3:11 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>>> On Sat, Mar 17, 2018 at 3:53 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n>>>> -extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);\n>>>> +extern int lazy_init_name_hash_for_testing(struct index_state *istate, int try_threaded);\n>>>\n>>> I get why you renamed this since the \"main\" function in the test\n>>> program wants to be called 'test_lazy_init_name_hash'...\n>>>\n>>>> diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\n>>>> @@ -9,6 +10,9 @@ static int perf;\n>>>> +static int (*init_name_hash)(struct index_state *istate, int try_threaded) =\n>>>> +       lazy_init_name_hash_for_testing;\n>>>> +\n>>>> @@ -33,9 +37,9 @@ static void dump_run(void)\n>>>>          if (single) {\n>>>> -               test_lazy_init_name_hash(&the_index, 0);\n>>>> +               init_name_hash(&the_index, 0);\n>>>\n>>> ... but I'm having trouble understanding why this indirection through\n>>> 'init_name_hash' is used rather than just calling\n>>> lazy_init_name_hash_for_testing() directly. Am I missing something\n>>> obvious or is 'init_name_hash' just an unneeded artifact of an earlier\n>>> iteration before the rename in cache.{c,h}?\n>>\n>> Nope. It just feels too long to me and because we're already in the\n>> test I don't feel the need to repeat _for_testing everywhere. If it's\n>> confusing, I'll remove init_name_hash.\n> \n> Without an explanatory in-code comment, I'd guess that someone coming\n> across this in the future will also stumble over it just like I did in\n> the review.\n\nI agree with Eric, this indirection seems unnecessary and confusing.\nGenerally, when I see function pointers initialized like that, I\nthink that there are plans for additional providers/drivers for that\nfunctionality, but I don't see that here.  And it seems odd.\n\n> \n> What if, instead, you rename test_lazy_init_name_hash() to\n> lazy_init_name_hash_test(), shifting 'test' from the front to the back\n> of the name? That way, the name remains the same length at the call\n> sites in the test helper, and you don't have to introduce the\n> confusing, otherwise unneeded 'init_name_hash'.\n> \n\nI see 2 problems.\n1. The test function in name-hash.c that needs access to private data.\n     I'm not a fan of the \"_for_testing\" suffix, but I'm open.  I might\n     either leave it as is, or make it a \"TEST_\" or \"test__\" prefix (as\n     a guide for people used to languages with namespaces.\n\n2. The new name for cmd_main().  There's no real need why it needs to\n    be \"test_*\", right?   Your cmds[] maps the command line string to a\n    function, but it could be anything.  That is, \"cmd_main()\" could be\n    renamed \"cmd__lazy_init_name_hash()\".  Then you can conceptually\n    reserve the \"cmd__\" prefix throughout t/helper for each test handler.\n\nJust a thought,\nThanks,\nJeff\n\n"},{"id":"342194","messageId":"CACsJy8CbFWvAzvSVZKho1O1D4mi3jphs6cbZ9npSwDWXicMPfQ@mail.gmail.com","threadId":"48064","inReplyTo":"edbc7234-ee60-6f3e-ae09-94721e4b5faa@jeffhostetler.com","subject":"Re: [PATCH 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-19T15:51:16Z","receivedAt":"2018-03-19T15:51:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Mar 19, 2018 at 10:40 AM, Jeff Hostetler <git@jeffhostetler.com> wrote:\n>\n>\n> On 3/18/2018 4:47 AM, Eric Sunshine wrote:\n>>\n>> On Sun, Mar 18, 2018 at 4:25 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n>>>\n>>> On Sun, Mar 18, 2018 at 3:11 AM, Eric Sunshine <sunshine@sunshineco.com>\n>>> wrote:\n>>>>\n>>>> On Sat, Mar 17, 2018 at 3:53 AM, Nguyễn Thái Ngọc Duy\n>>>> <pclouds@gmail.com> wrote:\n>>>>>\n>>>>> -extern int test_lazy_init_name_hash(struct index_state *istate, int\n>>>>> try_threaded);\n>>>>> +extern int lazy_init_name_hash_for_testing(struct index_state *istate,\n>>>>> int try_threaded);\n>>>>\n>>>>\n>>>> I get why you renamed this since the \"main\" function in the test\n>>>> program wants to be called 'test_lazy_init_name_hash'...\n>>>>\n>>>>> diff --git a/t/helper/test-lazy-init-name-hash.c\n>>>>> b/t/helper/test-lazy-init-name-hash.c\n>>>>> @@ -9,6 +10,9 @@ static int perf;\n>>>>> +static int (*init_name_hash)(struct index_state *istate, int\n>>>>> try_threaded) =\n>>>>> +       lazy_init_name_hash_for_testing;\n>>>>> +\n>>>>> @@ -33,9 +37,9 @@ static void dump_run(void)\n>>>>>          if (single) {\n>>>>> -               test_lazy_init_name_hash(&the_index, 0);\n>>>>> +               init_name_hash(&the_index, 0);\n>>>>\n>>>>\n>>>> ... but I'm having trouble understanding why this indirection through\n>>>> 'init_name_hash' is used rather than just calling\n>>>> lazy_init_name_hash_for_testing() directly. Am I missing something\n>>>> obvious or is 'init_name_hash' just an unneeded artifact of an earlier\n>>>> iteration before the rename in cache.{c,h}?\n>>>\n>>>\n>>> Nope. It just feels too long to me and because we're already in the\n>>> test I don't feel the need to repeat _for_testing everywhere. If it's\n>>> confusing, I'll remove init_name_hash.\n>>\n>>\n>> Without an explanatory in-code comment, I'd guess that someone coming\n>> across this in the future will also stumble over it just like I did in\n>> the review.\n>\n>\n> I agree with Eric, this indirection seems unnecessary and confusing.\n> Generally, when I see function pointers initialized like that, I\n> think that there are plans for additional providers/drivers for that\n> functionality, but I don't see that here.  And it seems odd.\n>\n>>\n>> What if, instead, you rename test_lazy_init_name_hash() to\n>> lazy_init_name_hash_test(), shifting 'test' from the front to the back\n>> of the name? That way, the name remains the same length at the call\n>> sites in the test helper, and you don't have to introduce the\n>> confusing, otherwise unneeded 'init_name_hash'.\n>>\n>\n> I see 2 problems.\n> 1. The test function in name-hash.c that needs access to private data.\n>     I'm not a fan of the \"_for_testing\" suffix, but I'm open.  I might\n>     either leave it as is, or make it a \"TEST_\" or \"test__\" prefix (as\n>     a guide for people used to languages with namespaces.\n>\n> 2. The new name for cmd_main().  There's no real need why it needs to\n>    be \"test_*\", right?   Your cmds[] maps the command line string to a\n>    function, but it could be anything.  That is, \"cmd_main()\" could be\n>    renamed \"cmd__lazy_init_name_hash()\".  Then you can conceptually\n>    reserve the \"cmd__\" prefix throughout t/helper for each test handler.\n\ncmd__ prefix solves my problem nicely. I'll wait for a while before\nresending another 30+ patches.\n-- \nDuy\n"},{"id":"342753","messageId":"20180324074308.18934-1-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:25Z","receivedAt":"2018-03-24T07:43:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"v2 fixes a couple of typos in commit messages and use the cmd__ prefix\nfor test commands instead of test_, which avoids a naming conflict\nwith the existing function test_lazy_init_name_hash\n\nNguyễn Thái Ngọc Duy (36):\n  t/helper: add an empty test-tool program\n  t/helper: merge test-chmtime into test-tool\n  t/helper: merge test-sha1 into test-tool\n  t/helper: merge test-lazy-init-name-hash into test-tool\n  t/helper: merge test-config into test-tool\n  t/helper: merge test-ctype into test-tool\n  t/helper: merge test-date into test-tool\n  t/helper: merge (unused) test-delta into test-tool\n  t/helper: merge test-drop-caches into test-tool\n  t/helper: merge test-dump-cache-tree into test-tool\n  t/helper: merge test-dump-split-index into test-tool\n  t/helper: merge test-example-decorate into test-tool\n  t/helper: merge test-genrandom into test-tool\n  t/helper: merge test-hashmap into test-tool\n  t/helper: merge test-index-version into test-tool\n  t/helper: merge (unused) test-match-trees into test-tool\n  t/helper: merge (unused) test-mergesort into test-tool\n  t/helper: merge test-mktemp into test-tool\n  t/helper: merge test-online-cpus into test-tool\n  t/helper: merge test-path-utils into test-tool\n  t/helper: merge test-prio-queue into test-tool\n  t/helper: merge test-read-cache into test-tool\n  t/helper: merge test-ref-store into test-tool\n  t/helper: merge test-regex into test-tool\n  t/helper: merge test-revision-walking into test-tool\n  t/helper: merge test-run-command into test-tool\n  t/helper: merge test-scrap-cache-tree into test-tool\n  t/helper: merge test-sha1-array into test-tool\n  t/helper: merge test-sigchain into test-tool\n  t/helper: merge test-strcmp-offset into test-tool\n  t/helper: merge test-string-list into test-tool\n  t/helper: merge test-submodule-config into test-tool\n  t/helper: merge test-subprocess into test-tool\n  t/helper: merge test-urlmatch-normalization into test-tool\n  t/helper: merge test-wildmatch into test-tool\n  t/helper: merge test-write-cache into test-tool\n\n .../howto/recover-corrupted-object-harder.txt |   2 +-\n Makefile                                      |  79 +++---\n t/helper/test-chmtime.c                       |  15 +-\n t/helper/test-config.c                        |   5 +-\n t/helper/test-ctype.c                         |   3 +-\n t/helper/test-date.c                          |  17 +-\n t/helper/test-delta.c                         |   5 +-\n t/helper/test-drop-caches.c                   |   3 +-\n t/helper/test-dump-cache-tree.c               |   3 +-\n t/helper/test-dump-split-index.c              |   3 +-\n t/helper/test-example-decorate.c              |   3 +-\n t/helper/test-genrandom.c                     |   3 +-\n t/helper/test-hashmap.c                       |   5 +-\n t/helper/test-index-version.c                 |   3 +-\n t/helper/test-lazy-init-name-hash.c           |  13 +-\n t/helper/test-match-trees.c                   |   3 +-\n t/helper/test-mergesort.c                     |   3 +-\n t/helper/test-mktemp.c                        |   3 +-\n t/helper/test-online-cpus.c                   |   3 +-\n t/helper/test-path-utils.c                    |   3 +-\n t/helper/test-prio-queue.c                    |   3 +-\n t/helper/test-read-cache.c                    |   3 +-\n t/helper/test-ref-store.c                     |   3 +-\n t/helper/test-regex.c                         |   7 +-\n t/helper/test-revision-walking.c              |   3 +-\n t/helper/test-run-command.c                   |   3 +-\n t/helper/test-scrap-cache-tree.c              |   3 +-\n t/helper/test-sha1-array.c                    |   3 +-\n t/helper/test-sha1.c                          |   3 +-\n t/helper/test-sha1.sh                         |   4 +-\n t/helper/test-sigchain.c                      |   3 +-\n t/helper/test-strcmp-offset.c                 |   3 +-\n t/helper/test-string-list.c                   |   3 +-\n t/helper/test-submodule-config.c              |   3 +-\n t/helper/test-subprocess.c                    |   3 +-\n t/helper/test-tool.c                          |  62 ++++\n t/helper/test-tool.h                          |  40 +++\n t/helper/test-urlmatch-normalization.c        |   5 +-\n t/helper/test-wildmatch.c                     |   3 +-\n t/helper/test-write-cache.c                   |   3 +-\n t/lib-git-p4.sh                               |   2 +-\n t/lib-git-svn.sh                              |   2 +-\n t/lib-pack.sh                                 |   2 +-\n t/perf/p0002-read-cache.sh                    |   2 +-\n t/perf/p0004-lazy-init-name-hash.sh           |   8 +-\n t/perf/p0007-write-cache.sh                   |   2 +-\n t/perf/p0071-sort.sh                          |   2 +-\n t/perf/p7519-fsmonitor.sh                     |  12 +-\n t/t0005-signals.sh                            |   6 +-\n t/t0006-date.sh                               |   8 +-\n t/t0009-prio-queue.sh                         |   6 +-\n t/t0011-hashmap.sh                            |   4 +-\n t/t0013-sha1dc.sh                             |   2 +-\n t/t0021-conversion.sh                         |   4 +-\n t/t0060-path-utils.sh                         |  60 ++--\n t/t0061-run-command.sh                        |  24 +-\n t/t0062-revision-walking.sh                   |   2 +-\n t/t0063-string-list.sh                        |  48 ++--\n t/t0064-sha1-array.sh                         |  16 +-\n t/t0065-strcmp-offset.sh                      |   2 +-\n t/t0070-fundamental.sh                        |   8 +-\n t/t0090-cache-tree.sh                         |  18 +-\n t/t0110-urlmatch-normalization.sh             | 266 +++++++++---------\n t/t1006-cat-file.sh                           |   2 +-\n t/t1050-large.sh                              |   6 +-\n t/t1300-repo-config.sh                        |   2 +-\n t/t1305-config-include.sh                     |   2 +-\n t/t1308-config-set.sh                         |  22 +-\n t/t1309-early-config.sh                       |  12 +-\n t/t1405-main-ref-store.sh                     |   2 +-\n t/t1406-submodule-ref-store.sh                |   2 +-\n t/t1407-worktree-ref-store.sh                 |   4 +-\n t/t1501-work-tree.sh                          |  10 +-\n t/t1600-index.sh                              |   2 +-\n t/t1700-split-index.sh                        |  64 ++---\n t/t2022-checkout-paths.sh                     |   4 +-\n t/t2104-update-index-skip-worktree.sh         |   6 +-\n t/t3008-ls-files-lazy-init-name-hash.sh       |   4 +-\n t/t3070-wildmatch.sh                          |  14 +-\n t/t3306-notes-prune.sh                        |   2 +-\n t/t3404-rebase-interactive.sh                 |   4 +-\n t/t3418-rebase-continue.sh                    |   4 +-\n t/t3501-revert-cherry-pick.sh                 |   2 +-\n t/t3510-cherry-pick-sequence.sh               |   4 +-\n t/t3600-rm.sh                                 |   2 +-\n t/t3700-add.sh                                |   2 +-\n t/t4011-diff-symlink.sh                       |   2 +-\n t/t4013-diff-various.sh                       |   2 +-\n t/t4035-diff-quiet.sh                         |   2 +-\n t/t4151-am-abort.sh                           |   4 +-\n t/t4200-rerere.sh                             |  22 +-\n t/t5000-tar-tree.sh                           |   4 +-\n t/t5300-pack-object.sh                        |   4 +-\n t/t5301-sliding-window.sh                     |   2 +-\n t/t5302-pack-index.sh                         |  14 +-\n t/t5303-pack-corruption-resilience.sh         |  10 +-\n t/t5304-prune.sh                              |  16 +-\n t/t5310-pack-bitmaps.sh                       |   2 +-\n t/t5313-pack-bounds-checks.sh                 |   4 +-\n t/t5314-pack-cycle-detection.sh               |   2 +-\n t/t5316-pack-delta-depth.sh                   |   2 +-\n t/t5400-send-pack.sh                          |   2 +-\n t/t5516-fetch-push.sh                         |   2 +-\n t/t5546-receive-limits.sh                     |   2 +-\n t/t5547-push-quarantine.sh                    |   2 +-\n t/t5608-clone-2gb.sh                          |   2 +-\n t/t6022-merge-rename.sh                       |  30 +-\n t/t6500-gc.sh                                 |   2 +-\n t/t6501-freshen-objects.sh                    |   4 +-\n t/t7411-submodule-config.sh                   |  18 +-\n t/t7508-status.sh                             |   6 +-\n t/t7701-repack-unpack-unreachable.sh          |   6 +-\n t/t7812-grep-icase-non-ascii.sh               |   2 +-\n t/t9004-example.sh                            |   2 +-\n t/t9100-git-svn-basic.sh                      |   4 +-\n t/t9300-fast-import.sh                        |   2 +-\n t/t9802-git-p4-filetype.sh                    |   2 +-\n t/t9803-git-p4-shell-metachars.sh             |   4 +-\n t/t9813-git-p4-preserve-users.sh              |   6 +-\n t/t9820-git-p4-editor-handling.sh             |   2 +-\n t/test-lib.sh                                 |  10 +-\n 121 files changed, 684 insertions(+), 542 deletions(-)\n create mode 100644 t/helper/test-tool.c\n create mode 100644 t/helper/test-tool.h\n\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342754","messageId":"20180324074308.18934-2-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 1/7] t7700: have closing quote of a test at the beginning of line","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:26Z","receivedAt":"2018-03-24T07:43:34Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The closing quote of a test body by convention is always at the start\nof line.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t7700-repack.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7700-repack.sh b/t/t7700-repack.sh\nindex 6061a04147..38247afbec 100755\n--- a/t/t7700-repack.sh\n+++ b/t/t7700-repack.sh\n@@ -194,7 +194,7 @@ test_expect_success 'objects made unreachable by grafts only are kept' '\n \tgit reflog expire --expire=$test_tick --expire-unreachable=$test_tick --all &&\n \tgit repack -a -d &&\n \tgit cat-file -t $H1\n-\t'\n+'\n \n test_done\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342755","messageId":"20180324074308.18934-3-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:27Z","receivedAt":"2018-03-24T07:43:38Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This will become an umbrella program that absorbs most [1] t/helper\nprograms in. By having a single executable binary we reduce disk usage\n(libgit.a is replicated by every t/helper program) and shorten link\ntime a bit.\n\nRunning \"make --jobs=1; du -sh t/helper\" with ccache fully populated,\nit takes 27 seconds and 277MB at the beginning of this series, 17\nseconds and 42MB at the end.\n\n[1] There are a couple programs that will not become part of\n    test-tool: test-line-buffer and test-svn-fe have extra\n    dependencies and test-fake-ssh's program name has to be a single\n    word for some ssh tests.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile             |  6 +++++-\n t/helper/test-tool.c | 27 +++++++++++++++++++++++++++\n t/helper/test-tool.h |  4 ++++\n 3 files changed, 36 insertions(+), 1 deletion(-)\n create mode 100644 t/helper/test-tool.c\n create mode 100644 t/helper/test-tool.h\n\ndiff --git a/Makefile b/Makefile\nindex a1d8775adb..2376646e98 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -546,6 +546,7 @@ SCRIPT_PERL =\n SCRIPT_PYTHON =\n SCRIPT_SH =\n SCRIPT_LIB =\n+TEST_BUILTINS_OBJS =\n TEST_PROGRAMS_NEED_X =\n \n # Having this variable in your environment would break pipelines because\n@@ -690,6 +691,7 @@ TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n+TEST_PROGRAMS_NEED_X += test-tool\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n TEST_PROGRAMS_NEED_X += test-wildmatch\n \n@@ -2083,7 +2085,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 %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n \t$(XDIFF_OBJS) \\\n \t$(VCSSVN_OBJS) \\\n@@ -2494,6 +2496,8 @@ t/helper/test-svn-fe$X: $(VCSSVN_LIB)\n \n .PRECIOUS: $(TEST_OBJS)\n \n+t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n+\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 \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nnew file mode 100644\nindex 0000000000..c730f718ca\n--- /dev/null\n+++ b/t/helper/test-tool.c\n@@ -0,0 +1,27 @@\n+#include \"git-compat-util.h\"\n+#include \"test-tool.h\"\n+\n+struct test_cmd {\n+\tconst char *name;\n+\tint (*main)(int argc, const char **argv);\n+};\n+\n+static struct test_cmd cmds[] = {\n+};\n+\n+int cmd_main(int argc, const char **argv)\n+{\n+\tint i;\n+\n+\tif (argc < 2)\n+\t\tdie(\"I need a test name!\");\n+\n+\tfor (i = 0; i < ARRAY_SIZE(cmds); i++) {\n+\t\tif (!strcmp(cmds[i].name, argv[1])) {\n+\t\t\targv++;\n+\t\t\targc--;\n+\t\t\treturn cmds[i].main(argc, argv);\n+\t\t}\n+\t}\n+\tdie(\"There is no test named '%s'\", argv[1]);\n+}\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nnew file mode 100644\nindex 0000000000..6ce57ae0cc\n--- /dev/null\n+++ b/t/helper/test-tool.h\n@@ -0,0 +1,4 @@\n+#ifndef __TEST_TOOL_H__\n+#define __TEST_TOOL_H__\n+\n+#endif\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342756","messageId":"20180324074308.18934-4-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 2/7] repack: add --keep-pack option","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:28Z","receivedAt":"2018-03-24T07:43:40Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"We allow to keep existing packs by having companion .keep files. This\nis helpful when a pack is permanently kept. In the next patch, git-gc\njust wants to keep a pack temporarily, for one pack-objects\nrun. git-gc can use --keep-pack for this use case.\n\nA note about why the pack_keep field cannot be reused and\npack_keep_in_core has to be added. This is about the case when\n--keep-pack is specified together with either --keep-unreachable or\n--unpack-unreachable, but --honor-pack-keep is NOT specified.\n\nIn this case, we want to exclude objects from the packs specified on\ncommand line, not from ones with .keep files. If only one bit flag is\nused, we have to clear pack_keep on pack files with the .keep file.\n\nBut we can't make any assumption about unreachable objects in .keep\npacks. If \"pack_keep\" field is false for .keep packs, we could\npotentially pull lots of unreachable objects into the new pack, or\nunpack them loose. The safer approach is ignore all packs with either\n.keep file or --keep-pack.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/git-pack-objects.txt |  9 ++++-\n Documentation/git-repack.txt       |  9 ++++-\n builtin/pack-objects.c             | 64 ++++++++++++++++++++++++------\n builtin/repack.c                   | 21 ++++++++--\n cache.h                            |  1 +\n t/t7700-repack.sh                  | 25 ++++++++++++\n 6 files changed, 111 insertions(+), 18 deletions(-)\n\ndiff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt\nindex 81bc490ac5..403524652a 100644\n--- a/Documentation/git-pack-objects.txt\n+++ b/Documentation/git-pack-objects.txt\n@@ -12,7 +12,7 @@ SYNOPSIS\n 'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied]\n \t[--no-reuse-delta] [--delta-base-offset] [--non-empty]\n \t[--local] [--incremental] [--window=<n>] [--depth=<n>]\n-\t[--revs [--unpacked | --all]]\n+\t[--revs [--unpacked | --all]] [--keep-pack=<pack-name>]\n \t[--stdout [--filter=<filter-spec>] | base-name]\n \t[--shallow] [--keep-true-parents] < object-list\n \n@@ -126,6 +126,13 @@ base-name::\n \thas a .keep file to be ignored, even if it would have\n \totherwise been packed.\n \n+--keep-pack=<pack-name>::\n+\tThis flag causes an object already in the given pack to be\n+\tignored, even if it would have otherwise been\n+\tpacked. `<pack-name>` is the the pack file name without\n+\tleading directory (e.g. `pack-123.pack`). The option could be\n+\tspecified multiple times to keep multiple packs.\n+\n --incremental::\n \tThis flag causes an object already in a pack to be ignored\n \teven if it would have otherwise been packed.\ndiff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt\nindex ae750e9e11..ce497d9d12 100644\n--- a/Documentation/git-repack.txt\n+++ b/Documentation/git-repack.txt\n@@ -9,7 +9,7 @@ git-repack - Pack unpacked objects in a repository\n SYNOPSIS\n --------\n [verse]\n-'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>] [--threads=<n>]\n+'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>] [--threads=<n>] [--keep-pack=<pack-name>]\n \n DESCRIPTION\n -----------\n@@ -133,6 +133,13 @@ other objects in that pack they already have locally.\n \twith `-b` or `repack.writeBitmaps`, as it ensures that the\n \tbitmapped packfile has the necessary objects.\n \n+--keep-pack=<pack-name>::\n+\tExclude the given pack from repacking. This is the equivalent\n+\tof having `.keep` file on the pack. `<pack-name>` is the the\n+\tpack file name without leading directory (e.g. `pack-123.pack`).\n+\tThe option could be specified multiple times to keep multiple\n+\tpacks.\n+\n --unpack-unreachable=<when>::\n \tWhen loosening unreachable objects, do not bother loosening any\n \tobjects older than `<when>`. This can be used to optimize out\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex a197926eaa..7ec70131a9 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -28,6 +28,7 @@\n #include \"argv-array.h\"\n #include \"list.h\"\n #include \"packfile.h\"\n+#include \"dir.h\"\n \n static const char *pack_usage[] = {\n \tN_(\"git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]\"),\n@@ -53,7 +54,8 @@ static int pack_loose_unreachable;\n static int local;\n static int have_non_local_packs;\n static int incremental;\n-static int ignore_packed_keep;\n+static int ignore_packed_keep_on_disk;\n+static int ignore_packed_keep_in_core;\n static int allow_ofs_delta;\n static struct pack_idx_option pack_idx_opts;\n static const char *base_name;\n@@ -982,13 +984,16 @@ static int want_found_object(int exclude, struct packed_git *p)\n \t * Otherwise, we signal \"-1\" at the end to tell the caller that we do\n \t * not know either way, and it needs to check more packs.\n \t */\n-\tif (!ignore_packed_keep &&\n+\tif (!ignore_packed_keep_on_disk &&\n+\t    !ignore_packed_keep_in_core &&\n \t    (!local || !have_non_local_packs))\n \t\treturn 1;\n \n \tif (local && !p->pack_local)\n \t\treturn 0;\n-\tif (ignore_packed_keep && p->pack_local && p->pack_keep)\n+\tif (p->pack_local &&\n+\t    ((ignore_packed_keep_on_disk && p->pack_keep) ||\n+\t     (ignore_packed_keep_in_core && p->pack_keep_in_core)))\n \t\treturn 0;\n \n \t/* we don't know yet; keep looking for more packs */\n@@ -2677,7 +2682,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs)\n \t\tstruct object_id oid;\n \t\tstruct object *o;\n \n-\t\tif (!p->pack_local || p->pack_keep)\n+\t\tif (!p->pack_local || p->pack_keep || p->pack_keep_in_core)\n \t\t\tcontinue;\n \t\tif (open_pack_index(p))\n \t\t\tdie(\"cannot open pack index\");\n@@ -2739,7 +2744,8 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)\n \tp = (last_found != (void *)1) ? last_found : packed_git;\n \n \twhile (p) {\n-\t\tif ((!p->pack_local || p->pack_keep) &&\n+\t\tif ((!p->pack_local || p->pack_keep ||\n+\t\t\t\tp->pack_keep_in_core) &&\n \t\t\tfind_pack_entry_one(oid->hash, p)) {\n \t\t\tlast_found = p;\n \t\t\treturn 1;\n@@ -2782,7 +2788,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs)\n \tstruct object_id oid;\n \n \tfor (p = packed_git; p; p = p->next) {\n-\t\tif (!p->pack_local || p->pack_keep)\n+\t\tif (!p->pack_local || p->pack_keep || p->pack_keep_in_core)\n \t\t\tcontinue;\n \n \t\tif (open_pack_index(p))\n@@ -2808,7 +2814,8 @@ static int pack_options_allow_reuse(void)\n {\n \treturn pack_to_stdout &&\n \t       allow_ofs_delta &&\n-\t       !ignore_packed_keep &&\n+\t       !ignore_packed_keep_on_disk &&\n+\t       !ignore_packed_keep_in_core &&\n \t       (!local || !have_non_local_packs) &&\n \t       !incremental;\n }\n@@ -2917,6 +2924,33 @@ static void get_object_list(int ac, const char **av)\n \toid_array_clear(&recent_objects);\n }\n \n+static void add_extra_kept_packs(const struct string_list *names)\n+{\n+\tstruct packed_git *p;\n+\n+\tif (!names->nr)\n+\t\treturn;\n+\n+\tprepare_packed_git();\n+\tfor (p = packed_git; p; p = p->next) {\n+\t\tconst char *name = basename(p->pack_name);\n+\t\tint i;\n+\n+\t\tif (!p->pack_local)\n+\t\t\tcontinue;\n+\n+\t\tfor (i = 0; i < names->nr; i++)\n+\t\t\tif (!fspathcmp(name, names->items[i].string))\n+\t\t\t\tbreak;\n+\n+\t\tif (i < names->nr) {\n+\t\t\tp->pack_keep_in_core = 1;\n+\t\t\tignore_packed_keep_in_core = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\t}\n+}\n+\n static int option_parse_index_version(const struct option *opt,\n \t\t\t\t      const char *arg, int unset)\n {\n@@ -2956,6 +2990,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tstruct argv_array rp = ARGV_ARRAY_INIT;\n \tint rev_list_unpacked = 0, rev_list_all = 0, rev_list_reflog = 0;\n \tint rev_list_index = 0;\n+\tstruct string_list keep_pack_list = STRING_LIST_INIT_NODUP;\n \tstruct option pack_objects_options[] = {\n \t\tOPT_SET_INT('q', \"quiet\", &progress,\n \t\t\t    N_(\"do not show progress meter\"), 0),\n@@ -3020,8 +3055,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\t\t N_(\"create thin packs\")),\n \t\tOPT_BOOL(0, \"shallow\", &shallow,\n \t\t\t N_(\"create packs suitable for shallow fetches\")),\n-\t\tOPT_BOOL(0, \"honor-pack-keep\", &ignore_packed_keep,\n+\t\tOPT_BOOL(0, \"honor-pack-keep\", &ignore_packed_keep_on_disk,\n \t\t\t N_(\"ignore packs that have companion .keep file\")),\n+\t\tOPT_STRING_LIST(0, \"keep-pack\", &keep_pack_list, N_(\"name\"),\n+\t\t\t\tN_(\"ignore this pack\")),\n \t\tOPT_INTEGER(0, \"compression\", &pack_compression_level,\n \t\t\t    N_(\"pack compression level\")),\n \t\tOPT_SET_INT(0, \"keep-true-parents\", &grafts_replace_parents,\n@@ -3150,19 +3187,20 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\tprogress = 2;\n \n \tprepare_packed_git();\n-\tif (ignore_packed_keep) {\n+\tadd_extra_kept_packs(&keep_pack_list);\n+\tif (ignore_packed_keep_on_disk) {\n \t\tstruct packed_git *p;\n \t\tfor (p = packed_git; p; p = p->next)\n \t\t\tif (p->pack_local && p->pack_keep)\n \t\t\t\tbreak;\n \t\tif (!p) /* no keep-able packs found */\n-\t\t\tignore_packed_keep = 0;\n+\t\t\tignore_packed_keep_on_disk = 0;\n \t}\n \tif (local) {\n \t\t/*\n-\t\t * unlike ignore_packed_keep above, we do not want to\n-\t\t * unset \"local\" based on looking at packs, as it\n-\t\t * also covers non-local objects\n+\t\t * unlike ignore_packed_keep_on_disk above, we do not\n+\t\t * want to unset \"local\" based on looking at packs, as\n+\t\t * it also covers non-local objects\n \t\t */\n \t\tstruct packed_git *p;\n \t\tfor (p = packed_git; p; p = p->next) {\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex 7bdb40142f..6c636e159e 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -86,7 +86,8 @@ static void remove_pack_on_signal(int signo)\n  * have a corresponding .keep or .promisor file. These packs are not to\n  * be kept if we are going to pack everything into one file.\n  */\n-static void get_non_kept_pack_filenames(struct string_list *fname_list)\n+static void get_non_kept_pack_filenames(struct string_list *fname_list,\n+\t\t\t\t\tconst struct string_list *extra_keep)\n {\n \tDIR *dir;\n \tstruct dirent *e;\n@@ -97,6 +98,14 @@ static void get_non_kept_pack_filenames(struct string_list *fname_list)\n \n \twhile ((e = readdir(dir)) != NULL) {\n \t\tsize_t len;\n+\t\tint i;\n+\n+\t\tfor (i = 0; i < extra_keep->nr; i++)\n+\t\t\tif (!fspathcmp(e->d_name, extra_keep->items[i].string))\n+\t\t\t\tbreak;\n+\t\tif (extra_keep->nr > 0 && i < extra_keep->nr)\n+\t\t\tcontinue;\n+\n \t\tif (!strip_suffix(e->d_name, \".pack\", &len))\n \t\t\tcontinue;\n \n@@ -148,7 +157,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \tstruct string_list rollback = STRING_LIST_INIT_NODUP;\n \tstruct string_list existing_packs = STRING_LIST_INIT_DUP;\n \tstruct strbuf line = STRBUF_INIT;\n-\tint ext, ret, failed;\n+\tint i, ext, ret, failed;\n \tFILE *out;\n \n \t/* variables to be filled by option parsing */\n@@ -160,6 +169,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \tconst char *depth = NULL;\n \tconst char *threads = NULL;\n \tconst char *max_pack_size = NULL;\n+\tstruct string_list keep_pack_list = STRING_LIST_INIT_NODUP;\n \tint no_reuse_delta = 0, no_reuse_object = 0;\n \tint no_update_server_info = 0;\n \tint quiet = 0;\n@@ -200,6 +210,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \t\t\t\tN_(\"maximum size of each packfile\")),\n \t\tOPT_BOOL(0, \"pack-kept-objects\", &pack_kept_objects,\n \t\t\t\tN_(\"repack objects in packs marked with .keep\")),\n+\t\tOPT_STRING_LIST(0, \"keep-pack\", &keep_pack_list, N_(\"name\"),\n+\t\t\t\tN_(\"do not repack this pack\")),\n \t\tOPT_END()\n \t};\n \n@@ -230,6 +242,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \targv_array_push(&cmd.args, \"--keep-true-parents\");\n \tif (!pack_kept_objects)\n \t\targv_array_push(&cmd.args, \"--honor-pack-keep\");\n+\tfor (i = 0; i < keep_pack_list.nr; i++)\n+\t\targv_array_pushf(&cmd.args, \"--keep-pack=%s\",\n+\t\t\t\t keep_pack_list.items[i].string);\n \targv_array_push(&cmd.args, \"--non-empty\");\n \targv_array_push(&cmd.args, \"--all\");\n \targv_array_push(&cmd.args, \"--reflog\");\n@@ -254,7 +269,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \t\targv_array_push(&cmd.args, \"--write-bitmap-index\");\n \n \tif (pack_everything & ALL_INTO_ONE) {\n-\t\tget_non_kept_pack_filenames(&existing_packs);\n+\t\tget_non_kept_pack_filenames(&existing_packs, &keep_pack_list);\n \n \t\tif (existing_packs.nr && delete_redundant) {\n \t\t\tif (unpack_unreachable) {\ndiff --git a/cache.h b/cache.h\nindex d06932ed0b..ba168e3571 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1635,6 +1635,7 @@ extern struct packed_git {\n \tint pack_fd;\n \tunsigned pack_local:1,\n \t\t pack_keep:1,\n+\t\t pack_keep_in_core:1,\n \t\t freshened:1,\n \t\t do_not_close:1,\n \t\t pack_promisor:1;\ndiff --git a/t/t7700-repack.sh b/t/t7700-repack.sh\nindex 38247afbec..6162e2a8e6 100755\n--- a/t/t7700-repack.sh\n+++ b/t/t7700-repack.sh\n@@ -4,6 +4,12 @@ test_description='git repack works correctly'\n \n . ./test-lib.sh\n \n+commit_and_pack() {\n+\ttest_commit \"$@\" >/dev/null &&\n+\tSHA1=$(git pack-objects --all --unpacked --incremental .git/objects/pack/pack </dev/null) &&\n+\techo pack-${SHA1}.pack\n+}\n+\n test_expect_success 'objects in packs marked .keep are not repacked' '\n \techo content1 > file1 &&\n \techo content2 > file2 &&\n@@ -196,5 +202,24 @@ test_expect_success 'objects made unreachable by grafts only are kept' '\n \tgit cat-file -t $H1\n '\n \n+test_expect_success 'repack --keep-pack' '\n+\ttest_create_repo keep-pack &&\n+\t(\n+\t\tcd keep-pack &&\n+\t\tP1=$(commit_and_pack 1) &&\n+\t\tP2=$(commit_and_pack 2) &&\n+\t\tP3=$(commit_and_pack 3) &&\n+\t\tP4=$(commit_and_pack 4) &&\n+\t\tls .git/objects/pack/*.pack >old-counts &&\n+\t\ttest_line_count = 4 old-counts &&\n+\t\tgit repack -a -d --keep-pack $P1 --keep-pack $P4 &&\n+\t\tls .git/objects/pack/*.pack >new-counts &&\n+\t\tgrep -q $P1 new-counts &&\n+\t\tgrep -q $P4 new-counts &&\n+\t\ttest_line_count = 3 new-counts &&\n+\t\tgit fsck\n+\t)\n+'\n+\n test_done\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342757","messageId":"20180324074308.18934-7-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 03/36] t/helper: merge test-sha1 into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:31Z","receivedAt":"2018-03-24T07:43:43Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/howto/recover-corrupted-object-harder.txt | 2 +-\n Makefile                                                | 4 ++--\n t/helper/test-sha1.c                                    | 3 ++-\n t/helper/test-sha1.sh                                   | 4 ++--\n t/helper/test-tool.c                                    | 1 +\n t/helper/test-tool.h                                    | 1 +\n t/lib-pack.sh                                           | 2 +-\n t/t0013-sha1dc.sh                                       | 2 +-\n 8 files changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/howto/recover-corrupted-object-harder.txt b/Documentation/howto/recover-corrupted-object-harder.txt\nindex 9c4cd0915f..8994e2559e 100644\n--- a/Documentation/howto/recover-corrupted-object-harder.txt\n+++ b/Documentation/howto/recover-corrupted-object-harder.txt\n@@ -80,7 +80,7 @@ valid pack like:\n     # now add our object data\n     cat object >>tmp.pack\n     # and then append the pack trailer\n-    /path/to/git.git/test-sha1 -b <tmp.pack >trailer\n+    /path/to/git.git/t/helper/test-tool sha1 -b <tmp.pack >trailer\n     cat trailer >>tmp.pack\n ------------\n \ndiff --git a/Makefile b/Makefile\nindex 416a8e39c1..3c0d0474af 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,6 +653,7 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n TEST_PROGRAMS_NEED_X += test-config\n@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n-TEST_PROGRAMS_NEED_X += test-sha1\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n@@ -2502,7 +2502,7 @@ t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\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:: t/helper/test-sha1$X\n+check-sha1:: t/helper/test-tool$X\n \tt/helper/test-sha1.sh\n \n SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\ndiff --git a/t/helper/test-sha1.c b/t/helper/test-sha1.c\nindex a1c13f54ec..1ba0675c75 100644\n--- a/t/helper/test-sha1.c\n+++ b/t/helper/test-sha1.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int ac, const char **av)\n+int cmd__sha1(int ac, const char **av)\n {\n \tgit_SHA_CTX ctx;\n \tunsigned char sha1[20];\ndiff --git a/t/helper/test-sha1.sh b/t/helper/test-sha1.sh\nindex 750b95a0a1..84594885c7 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 t/helper/test-tool 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} | ./t/helper/test-tool sha1 $cnt\n \t)\n \tif test \"$expect\" = \"$actual\"\n \tthen\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 63ec15cb56..7a9bb9f140 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n+\t{ \"sha1\", cmd__sha1 },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 3a35e70e79..a05b8bd14c 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,5 +2,6 @@\n #define __TEST_TOOL_H__\n \n int cmd__chmtime(int argc, const char **argv);\n+int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/lib-pack.sh b/t/lib-pack.sh\nindex 7509846571..501078249d 100644\n--- a/t/lib-pack.sh\n+++ b/t/lib-pack.sh\n@@ -85,7 +85,7 @@ pack_obj () {\n \n # Compute and append pack trailer to \"$1\"\n pack_trailer () {\n-\ttest-sha1 -b <\"$1\" >trailer.tmp &&\n+\ttest-tool sha1 -b <\"$1\" >trailer.tmp &&\n \tcat trailer.tmp >>\"$1\" &&\n \trm -f trailer.tmp\n }\ndiff --git a/t/t0013-sha1dc.sh b/t/t0013-sha1dc.sh\nindex 6d655cb161..419f31a8f7 100755\n--- a/t/t0013-sha1dc.sh\n+++ b/t/t0013-sha1dc.sh\n@@ -11,7 +11,7 @@ then\n fi\n \n test_expect_success 'test-sha1 detects shattered pdf' '\n-\ttest_must_fail test-sha1 <\"$TEST_DATA/shattered-1.pdf\" 2>err &&\n+\ttest_must_fail test-tool sha1 <\"$TEST_DATA/shattered-1.pdf\" 2>err &&\n \ttest_i18ngrep collision err &&\n \tgrep 38762cf7f55934b34d179ae6a4c80cadccbb7f0a err\n '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342758","messageId":"20180324074308.18934-11-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 05/36] t/helper: merge test-config into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:35Z","receivedAt":"2018-03-24T07:43:48Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  |  2 +-\n t/helper/test-config.c    |  5 +++--\n t/helper/test-tool.c      |  1 +\n t/helper/test-tool.h      |  1 +\n t/t1305-config-include.sh |  2 +-\n t/t1308-config-set.sh     | 22 +++++++++++-----------\n t/t1309-early-config.sh   | 12 ++++++------\n 7 files changed, 24 insertions(+), 21 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 31287cedf2..227f16ad17 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,11 +653,11 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n-TEST_PROGRAMS_NEED_X += test-config\n TEST_PROGRAMS_NEED_X += test-date\n TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\ndiff --git a/t/helper/test-config.c b/t/helper/test-config.c\nindex 1a7b8bd3d6..214003d5b2 100644\n--- a/t/helper/test-config.c\n+++ b/t/helper/test-config.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"config.h\"\n #include \"string-list.h\"\n@@ -32,7 +33,7 @@\n  * Examples:\n  *\n  * To print the value with highest priority for key \"foo.bAr Baz.rock\":\n- * \ttest-config get_value \"foo.bAr Baz.rock\"\n+ * \ttest-tool config get_value \"foo.bAr Baz.rock\"\n  *\n  */\n \n@@ -77,7 +78,7 @@ static int early_config_cb(const char *var, const char *value, void *vdata)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__config(int argc, const char **argv)\n {\n \tint i, val;\n \tconst char *v;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex afc7a518d6..e8d6c6b9eb 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n+\t{ \"config\", cmd__config },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 1dc4673c3a..3084f458a0 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,6 +2,7 @@\n #define __TEST_TOOL_H__\n \n int cmd__chmtime(int argc, const char **argv);\n+int cmd__config(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh\nindex d9d2f545a4..f035ee40a3 100755\n--- a/t/t1305-config-include.sh\n+++ b/t/t1305-config-include.sh\n@@ -224,7 +224,7 @@ test_expect_success 'conditional include, early config reading' '\n \t\techo \"[includeIf \\\"gitdir:foo/\\\"]path=bar6\" >>.git/config &&\n \t\techo \"[test]six=6\" >.git/bar6 &&\n \t\techo 6 >expect &&\n-\t\ttest-config read_early_config test.six >actual &&\n+\t\ttest-tool config read_early_config test.six >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh\nindex bafed5c9b8..3e00d1af01 100755\n--- a/t/t1308-config-set.sh\n+++ b/t/t1308-config-set.sh\n@@ -18,7 +18,7 @@ check_config () {\n \tthen\n \t\tprintf \"%s\\n\" \"$@\"\n \tfi >expect &&\n-\ttest_expect_code $expect_code test-config \"$op\" \"$key\" >actual &&\n+\ttest_expect_code $expect_code test-tool config \"$op\" \"$key\" >actual &&\n \ttest_cmp expect actual\n }\n \n@@ -125,7 +125,7 @@ test_expect_success 'find string value for a key' '\n '\n \n test_expect_success 'check line error when NULL string is queried' '\n-\ttest_expect_code 128 test-config get_string case.foo 2>result &&\n+\ttest_expect_code 128 test-tool config get_string case.foo 2>result &&\n \ttest_i18ngrep \"fatal: .*case\\.foo.*\\.git/config.*line 7\" result\n '\n \n@@ -155,13 +155,13 @@ test_expect_success 'find value from a configset' '\n \t\tbaz = ball\n \tEOF\n \techo silk >expect &&\n-\ttest-config configset_get_value my.new config2 .git/config >actual &&\n+\ttest-tool config configset_get_value my.new config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'find value with highest priority from a configset' '\n \techo hask >expect &&\n-\ttest-config configset_get_value case.baz config2 .git/config >actual &&\n+\ttest-tool config configset_get_value case.baz config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -173,20 +173,20 @@ test_expect_success 'find value_list for a key from a configset' '\n \tlama\n \tball\n \tEOF\n-\ttest-config configset_get_value case.baz config2 .git/config >actual &&\n+\ttest-tool config configset_get_value case.baz config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'proper error on non-existent files' '\n \techo \"Error (-1) reading configuration file non-existent-file.\" >expect &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar non-existent-file 2>actual &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar non-existent-file 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'proper error on directory \"files\"' '\n \techo \"Error (-1) reading configuration file a-directory.\" >expect &&\n \tmkdir a-directory &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar a-directory 2>output &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar a-directory 2>output &&\n \tgrep \"^warning:\" output &&\n \tgrep \"^Error\" output >actual &&\n \ttest_cmp expect actual\n@@ -196,7 +196,7 @@ test_expect_success POSIXPERM,SANITY 'proper error on non-accessible files' '\n \tchmod -r .git/config &&\n \ttest_when_finished \"chmod +r .git/config\" &&\n \techo \"Error (-1) reading configuration file .git/config.\" >expect &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar .git/config 2>output &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar .git/config 2>output &&\n \tgrep \"^warning:\" output &&\n \tgrep \"^Error\" output >actual &&\n \ttest_cmp expect actual\n@@ -207,14 +207,14 @@ test_expect_success 'proper error on error in default config files' '\n \ttest_when_finished \"mv .git/config.old .git/config\" &&\n \techo \"[\" >>.git/config &&\n \techo \"fatal: bad config line 34 in file .git/config\" >expect &&\n-\ttest_expect_code 128 test-config get_value foo.bar 2>actual &&\n+\ttest_expect_code 128 test-tool config get_value foo.bar 2>actual &&\n \ttest_i18ncmp expect actual\n '\n \n test_expect_success 'proper error on error in custom config files' '\n \techo \"[\" >>syntax-error &&\n \techo \"fatal: bad config line 1 in file syntax-error\" >expect &&\n-\ttest_expect_code 128 test-config configset_get_value foo.bar syntax-error 2>actual &&\n+\ttest_expect_code 128 test-tool config configset_get_value foo.bar syntax-error 2>actual &&\n \ttest_i18ncmp expect actual\n '\n \n@@ -267,7 +267,7 @@ test_expect_success 'iteration shows correct origins' '\n \tname=\n \tscope=cmdline\n \tEOF\n-\tGIT_CONFIG_PARAMETERS=$cmdline_config test-config iterate >actual &&\n+\tGIT_CONFIG_PARAMETERS=$cmdline_config test-tool config iterate >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh\nindex 3dda215e8e..413642aa56 100755\n--- a/t/t1309-early-config.sh\n+++ b/t/t1309-early-config.sh\n@@ -6,7 +6,7 @@ test_description='Test read_early_config()'\n \n test_expect_success 'read early config' '\n \ttest_config early.config correct &&\n-\ttest-config read_early_config early.config >output &&\n+\ttest-tool config read_early_config early.config >output &&\n \ttest correct = \"$(cat output)\"\n '\n \n@@ -15,7 +15,7 @@ test_expect_success 'in a sub-directory' '\n \tmkdir -p sub &&\n \t(\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest sub = \"$(cat output)\"\n '\n@@ -27,7 +27,7 @@ test_expect_success 'ceiling' '\n \t\tGIT_CEILING_DIRECTORIES=\"$PWD\" &&\n \t\texport GIT_CEILING_DIRECTORIES &&\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest -z \"$(cat output)\"\n '\n@@ -42,7 +42,7 @@ test_expect_success 'ceiling #2' '\n \t\tGIT_CEILING_DIRECTORIES=\"$PWD\" &&\n \t\texport GIT_CEILING_DIRECTORIES XDG_CONFIG_HOME &&\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest xdg = \"$(cat output)\"\n '\n@@ -54,7 +54,7 @@ test_expect_success 'read config file in right order' '\n \t(\n \t\tcd foo &&\n \t\techo \"[test]source = repo\" >>.git/config &&\n-\t\tGIT_CONFIG_PARAMETERS=$cmdline_config test-config \\\n+\t\tGIT_CONFIG_PARAMETERS=$cmdline_config test-tool config \\\n \t\t\tread_early_config test.source >actual &&\n \t\tcat >expected <<-\\EOF &&\n \t\thome\n@@ -71,7 +71,7 @@ test_with_config () {\n \t(\n \t\tcd throwaway &&\n \t\techo \"$*\" >.git/config &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t)\n }\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342759","messageId":"20180324074308.18934-8-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 4/7] gc: add gc.bigPackThreshold config","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:32Z","receivedAt":"2018-03-24T07:43:50Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The --keep-largest-pack option is not very convenient to use because\nyou need to tell gc to do this explicitly (and probably on just a few\nlarge repos).\n\nAdd a config key that enables this mode when packs larger than a limit\nare found. Note that there's a slight behavior difference compared to\n--keep-largest-pack: all packs larger than the threshold are kept, not\njust the largest one.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/config.txt |  8 ++++++++\n Documentation/git-gc.txt |  6 ++++--\n builtin/gc.c             | 26 ++++++++++++++++++++------\n 3 files changed, 32 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex ce9102cea8..d63db3f12c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1558,6 +1558,14 @@ gc.autoDetach::\n \tMake `git gc --auto` return immediately and run in background\n \tif the system supports it. Default is true.\n \n+gc.bigPackThreshold::\n+\tIf non-zero, all packs larger than this limit are kept when\n+\t`git gc` is run. This is very similar to `--keep-base-pack`\n+\texcept that all packs that meet the threshold are kept, not\n+\tjust the base pack. Defaults to zero. Common unit suffixes of\n+\t'k', 'm', or 'g' are supported.\n+\n+\n gc.logExpiry::\n \tIf the file gc.log exists, then `git gc --auto` won't run\n \tunless that file is more than 'gc.logExpiry' old.  Default is\ndiff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt\nindex bf81b8de30..0adf381b52 100644\n--- a/Documentation/git-gc.txt\n+++ b/Documentation/git-gc.txt\n@@ -55,7 +55,8 @@ all loose objects are combined into a single pack using\n disables automatic packing of loose objects.\n +\n If the number of packs exceeds the value of `gc.autoPackLimit`,\n-then existing packs (except those marked with a `.keep` file)\n+then existing packs (except those marked with a `.keep` file\n+or over `gc.bigPackThreshold` limit)\n are consolidated into a single pack by using the `-A` option of\n 'git repack'. Setting `gc.autoPackLimit` to 0 disables\n automatic consolidation of packs.\n@@ -80,7 +81,8 @@ automatic consolidation of packs.\n \n --keep-largest-pack::\n \tAll packs except the largest pack and those marked with a\n-\t`.keep` files are consolidated into a single pack.\n+\t`.keep` files are consolidated into a single pack. When this\n+\toption is used, `gc.bigPackThreshold` is ignored.\n \n Configuration\n -------------\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 9a09cf53b0..53a0500898 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -39,6 +39,7 @@ static timestamp_t gc_log_expire_time;\n static const char *gc_log_expire = \"1.day.ago\";\n static const char *prune_expire = \"2.weeks.ago\";\n static const char *prune_worktrees_expire = \"3.months.ago\";\n+static unsigned long big_pack_threshold;\n \n static struct argv_array pack_refs_cmd = ARGV_ARRAY_INIT;\n static struct argv_array reflog = ARGV_ARRAY_INIT;\n@@ -126,6 +127,8 @@ static void gc_config(void)\n \tgit_config_get_expiry(\"gc.worktreepruneexpire\", &prune_worktrees_expire);\n \tgit_config_get_expiry(\"gc.logexpiry\", &gc_log_expire);\n \n+\tgit_config_get_ulong(\"gc.bigpackthreshold\", &big_pack_threshold);\n+\n \tgit_config(git_default_config, NULL);\n }\n \n@@ -164,7 +167,7 @@ static int too_many_loose_objects(void)\n \treturn needed;\n }\n \n-static void find_base_packs(struct string_list *packs)\n+static void find_base_packs(struct string_list *packs, unsigned long limit)\n {\n \tstruct packed_git *p, *base = NULL;\n \n@@ -173,7 +176,10 @@ static void find_base_packs(struct string_list *packs)\n \tfor (p = packed_git; p; p = p->next) {\n \t\tif (!p->pack_local)\n \t\t\tcontinue;\n-\t\tif (!base || base->pack_size < p->pack_size) {\n+\t\tif (limit) {\n+\t\t\tif (p->pack_size >= limit)\n+\t\t\t\tstring_list_append(packs, p->pack_name);\n+\t\t} else if (!base || base->pack_size < p->pack_size) {\n \t\t\tbase = p;\n \t\t}\n \t}\n@@ -245,9 +251,15 @@ static int need_to_gc(void)\n \t * we run \"repack -A -d -l\".  Otherwise we tell the caller\n \t * there is no need.\n \t */\n-\tif (too_many_packs())\n-\t\tadd_repack_all_option(NULL);\n-\telse if (too_many_loose_objects())\n+\tif (too_many_packs()) {\n+\t\tstruct string_list keep_pack = STRING_LIST_INIT_NODUP;\n+\n+\t\tif (big_pack_threshold)\n+\t\t\tfind_base_packs(&keep_pack, big_pack_threshold);\n+\n+\t\tadd_repack_all_option(&keep_pack);\n+\t\tstring_list_clear(&keep_pack, 0);\n+\t} else if (too_many_loose_objects())\n \t\tadd_repack_incremental_option();\n \telse\n \t\treturn 0;\n@@ -462,7 +474,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \n \t\tif (keep_base_pack != -1) {\n \t\t\tif (keep_base_pack)\n-\t\t\t\tfind_base_packs(&keep_pack);\n+\t\t\t\tfind_base_packs(&keep_pack, 0);\n+\t\t} else if (big_pack_threshold) {\n+\t\t\tfind_base_packs(&keep_pack, big_pack_threshold);\n \t\t}\n \n \t\tadd_repack_all_option(&keep_pack);\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342760","messageId":"20180324074308.18934-13-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 06/36] t/helper: merge test-ctype into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:37Z","receivedAt":"2018-03-24T07:43:51Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               | 2 +-\n t/helper/test-ctype.c  | 3 ++-\n t/helper/test-tool.c   | 1 +\n t/helper/test-tool.h   | 1 +\n t/t0070-fundamental.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 227f16ad17..d09710dc3d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -654,10 +654,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n+TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \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-drop-caches\ndiff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c\nindex bb72c47df5..92c4c2313e 100644\n--- a/t/helper/test-ctype.c\n+++ b/t/helper/test-ctype.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n static int rc;\n@@ -28,7 +29,7 @@ static int is_in(const char *s, int ch)\n #define LOWER \"abcdefghijklmnopqrstuvwxyz\"\n #define UPPER \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__ctype(int argc, const char **argv)\n {\n \tTEST_CLASS(isdigit, DIGIT);\n \tTEST_CLASS(isspace, \" \\n\\r\\t\");\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex e8d6c6b9eb..d600a31935 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -9,6 +9,7 @@ struct test_cmd {\n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n \t{ \"config\", cmd__config },\n+\t{ \"ctype\", cmd__ctype },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 3084f458a0..41805ecd1c 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -3,6 +3,7 @@\n \n int cmd__chmtime(int argc, const char **argv);\n int cmd__config(int argc, const char **argv);\n+int cmd__ctype(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex 991ed2a48d..70d4d98a2e 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -9,7 +9,7 @@ Verify wrappers and compatibility functions.\n . ./test-lib.sh\n \n test_expect_success 'character classes (isspace, isalpha etc.)' '\n-\ttest-ctype\n+\ttest-tool ctype\n '\n \n test_expect_success 'mktemp to nonexistent directory prints filename' '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342761","messageId":"20180324074308.18934-9-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:33Z","receivedAt":"2018-03-24T07:43:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                                |  2 +-\n t/helper/test-lazy-init-name-hash.c     | 13 +++++++------\n t/helper/test-tool.c                    |  1 +\n t/helper/test-tool.h                    |  1 +\n t/perf/p0004-lazy-init-name-hash.sh     |  8 ++++----\n t/t3008-ls-files-lazy-init-name-hash.sh |  2 +-\n 6 files changed, 15 insertions(+), 12 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3c0d0474af..31287cedf2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,6 +653,7 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n@@ -669,7 +670,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n-TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\ndiff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\nindex 297fb01d61..b99a37080d 100644\n--- a/t/helper/test-lazy-init-name-hash.c\n+++ b/t/helper/test-lazy-init-name-hash.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"parse-options.h\"\n \n@@ -184,14 +185,14 @@ static void analyze_run(void)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__lazy_init_name_hash(int argc, const char **argv)\n {\n \tconst char *usage[] = {\n-\t\t\"test-lazy-init-name-hash -d (-s | -m)\",\n-\t\t\"test-lazy-init-name-hash -p [-c c]\",\n-\t\t\"test-lazy-init-name-hash -a a [--step s] [-c c]\",\n-\t\t\"test-lazy-init-name-hash (-s | -m) [-c c]\",\n-\t\t\"test-lazy-init-name-hash -s -m [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -d (-s | -m)\",\n+\t\t\"test-tool lazy-init-name-hash -p [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -a a [--step s] [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash (-s | -m) [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -s -m [-c c]\",\n \t\tNULL\n \t};\n \tstruct option options[] = {\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 7a9bb9f140..afc7a518d6 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n+\t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex a05b8bd14c..1dc4673c3a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,6 +2,7 @@\n #define __TEST_TOOL_H__\n \n int cmd__chmtime(int argc, const char **argv);\n+int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0004-lazy-init-name-hash.sh b/t/perf/p0004-lazy-init-name-hash.sh\nindex 8de5a98cfc..1afc08fe7f 100755\n--- a/t/perf/p0004-lazy-init-name-hash.sh\n+++ b/t/perf/p0004-lazy-init-name-hash.sh\n@@ -7,8 +7,8 @@ test_perf_large_repo\n test_checkout_worktree\n \n test_expect_success 'verify both methods build the same hashmaps' '\n-\ttest-lazy-init-name-hash --dump --single >out.single &&\n-\tif test-lazy-init-name-hash --dump --multi >out.multi\n+\ttest-tool lazy-init-name-hash --dump --single >out.single &&\n+\tif test-tool lazy-init-name-hash --dump --multi >out.multi\n \tthen\n \t\ttest_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&\n \t\tsort <out.single >sorted.single &&\n@@ -46,11 +46,11 @@ test_expect_success 'calibrate' '\n '\n \n test_perf \"single-threaded, $desc\" \"\n-\ttest-lazy-init-name-hash --single --count=$count\n+\ttest-tool lazy-init-name-hash --single --count=$count\n \"\n \n test_perf REPO_BIG_ENOUGH_FOR_MULTI \"multi-threaded, $desc\" \"\n-\ttest-lazy-init-name-hash --multi --count=$count\n+\ttest-tool lazy-init-name-hash --multi --count=$count\n \"\n \n test_done\ndiff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh\nindex bdf5198b7e..8df4aa7c99 100755\n--- a/t/t3008-ls-files-lazy-init-name-hash.sh\n+++ b/t/t3008-ls-files-lazy-init-name-hash.sh\n@@ -21,7 +21,7 @@ test_expect_success 'no buffer overflow in lazy_init_name_hash' '\n \t) |\n \tsed \"s/^/100644 $EMPTY_BLOB\t/\" |\n \tgit update-index --index-info &&\n-\ttest-lazy-init-name-hash -m\n+\ttest-tool lazy-init-name-hash -m\n '\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342762","messageId":"20180324074308.18934-15-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 07/36] t/helper: merge test-date into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:39Z","receivedAt":"2018-03-24T07:43:57Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               |  2 +-\n t/helper/test-date.c   | 17 +++++++++--------\n t/helper/test-tool.c   |  1 +\n t/helper/test-tool.h   |  1 +\n t/t0006-date.sh        |  8 ++++----\n t/t1300-repo-config.sh |  2 +-\n t/test-lib.sh          |  4 ++--\n 7 files changed, 19 insertions(+), 16 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d09710dc3d..efb1872c52 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -655,10 +655,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n+TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-date\n TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\ndiff --git a/t/helper/test-date.c b/t/helper/test-date.c\nindex ac83687970..a0837371ab 100644\n--- a/t/helper/test-date.c\n+++ b/t/helper/test-date.c\n@@ -1,13 +1,14 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n static const char *usage_msg = \"\\n\"\n-\"  test-date relative [time_t]...\\n\"\n-\"  test-date show:<format> [time_t]...\\n\"\n-\"  test-date parse [date]...\\n\"\n-\"  test-date approxidate [date]...\\n\"\n-\"  test-date timestamp [date]...\\n\"\n-\"  test-date is64bit\\n\"\n-\"  test-date time_t-is64bit\\n\";\n+\"  test-tool date relative [time_t]...\\n\"\n+\"  test-tool date show:<format> [time_t]...\\n\"\n+\"  test-tool date parse [date]...\\n\"\n+\"  test-tool date approxidate [date]...\\n\"\n+\"  test-tool date timestamp [date]...\\n\"\n+\"  test-tool date is64bit\\n\"\n+\"  test-tool date time_t-is64bit\\n\";\n \n static void show_relative_dates(const char **argv, struct timeval *now)\n {\n@@ -81,7 +82,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__date(int argc, const char **argv)\n {\n \tstruct timeval now;\n \tconst char *x;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex d600a31935..e92f93ac3b 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -10,6 +10,7 @@ static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n \t{ \"config\", cmd__config },\n \t{ \"ctype\", cmd__ctype },\n+\t{ \"date\", cmd__date },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 41805ecd1c..31c20bb656 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -4,6 +4,7 @@\n int cmd__chmtime(int argc, const char **argv);\n int cmd__config(int argc, const char **argv);\n int cmd__ctype(int argc, const char **argv);\n+int cmd__date(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 7ac9466d50..64ff86df8e 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -10,7 +10,7 @@ check_relative() {\n \tt=$(($TEST_DATE_NOW - $1))\n \techo \"$t -> $2\" >expect\n \ttest_expect_${3:-success} \"relative date ($2)\" \"\n-\ttest-date relative $t >actual &&\n+\ttest-tool date relative $t >actual &&\n \ttest_i18ncmp expect actual\n \t\"\n }\n@@ -35,7 +35,7 @@ check_show () {\n \tzone=$5\n \ttest_expect_success $prereqs \"show date ($format:$time)\" '\n \t\techo \"$time -> $expect\" >expect &&\n-\t\tTZ=${zone:-$TZ} test-date show:\"$format\" \"$time\" >actual &&\n+\t\tTZ=${zone:-$TZ} test-tool date show:\"$format\" \"$time\" >actual &&\n \t\ttest_cmp expect actual\n \t'\n }\n@@ -71,7 +71,7 @@ check_show iso-local \"$FUTURE\" \"2152-06-19 22:24:56 +0000\" TIME_IS_64BIT,TIME_T_\n check_parse() {\n \techo \"$1 -> $2\" >expect\n \ttest_expect_${4:-success} \"parse date ($1${3:+ TZ=$3})\" \"\n-\tTZ=${3:-$TZ} test-date parse '$1' >actual &&\n+\tTZ=${3:-$TZ} test-tool date parse '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n }\n@@ -92,7 +92,7 @@ check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST5\n check_approxidate() {\n \techo \"$1 -> $2 +0000\" >expect\n \ttest_expect_${3:-success} \"parse approxidate ($1)\" \"\n-\ttest-date approxidate '$1' >actual &&\n+\ttest-tool date approxidate '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n }\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 4f8e6f5fde..8780934478 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -914,7 +914,7 @@ test_expect_success 'get --expiry-date' '\n \tinvalid1 = \"abc\"\n \tEOF\n \tcat >expect <<-EOF &&\n-\t$(test-date timestamp $rel)\n+\t$(test-tool date timestamp $rel)\n \t1275666415\n \t1510441871\n \t1510348087\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7ab8af47a5..483c8d6d7c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1206,5 +1206,5 @@ test_lazy_prereq LONG_IS_64BIT '\n \ttest 8 -le \"$(build_option sizeof-long)\"\n '\n \n-test_lazy_prereq TIME_IS_64BIT 'test-date is64bit'\n-test_lazy_prereq TIME_T_IS_64BIT 'test-date time_t-is64bit'\n+test_lazy_prereq TIME_IS_64BIT 'test-tool date is64bit'\n+test_lazy_prereq TIME_T_IS_64BIT 'test-tool date time_t-is64bit'\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342763","messageId":"20180324074308.18934-10-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 5/7] gc: handle a corner case in gc.bigPackThreshold","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:34Z","receivedAt":"2018-03-24T07:44:00Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This config allows us to keep <N> packs back if their size is larger\nthan a limit. But if this N >= gc.autoPackLimit, we may have a\nproblem. We are supposed to reduce the number of packs after a\nthreshold because it affects performance.\n\nWe could tell the user that they have incompatible gc.bigPackThreshold\nand gc.autoPackLimit, but it's kinda hard when 'git gc --auto' runs in\nbackground. Instead let's fall back to the next best stategy: try to\nreduce the number of packs anyway, but keep the base pack out. This\nreduces the number of packs to two and hopefully won't take up too\nmuch resources to repack (the assumption still is the base pack takes\nmost resources to handle).\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/config.txt | 6 +++++-\n builtin/gc.c             | 8 +++++++-\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex d63db3f12c..cf862d3edf 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1564,7 +1564,11 @@ gc.bigPackThreshold::\n \texcept that all packs that meet the threshold are kept, not\n \tjust the base pack. Defaults to zero. Common unit suffixes of\n \t'k', 'm', or 'g' are supported.\n-\n++\n+Note that if the number of kept packs is more than gc.autoPackLimit,\n+this configuration variable is ignored, all packs except the base pack\n+will be repacked. After this the number of packs should go below\n+gc.autoPackLimit and gc.bigPackThreshold should be respected again.\n \n gc.logExpiry::\n \tIf the file gc.log exists, then `git gc --auto` won't run\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 53a0500898..74d3aaa270 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -254,8 +254,14 @@ static int need_to_gc(void)\n \tif (too_many_packs()) {\n \t\tstruct string_list keep_pack = STRING_LIST_INIT_NODUP;\n \n-\t\tif (big_pack_threshold)\n+\t\tif (big_pack_threshold) {\n \t\t\tfind_base_packs(&keep_pack, big_pack_threshold);\n+\t\t\tif (keep_pack.nr >= gc_auto_pack_limit) {\n+\t\t\t\tbig_pack_threshold = 0;\n+\t\t\t\tstring_list_clear(&keep_pack, 0);\n+\t\t\t\tfind_base_packs(&keep_pack, 0);\n+\t\t\t}\n+\t\t}\n \n \t\tadd_repack_all_option(&keep_pack);\n \t\tstring_list_clear(&keep_pack, 0);\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342764","messageId":"20180324074308.18934-12-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 6/7] gc --auto: exclude base pack if not enough mem to \"repack -ad\"","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:36Z","receivedAt":"2018-03-24T07:44:02Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"pack-objects could be a big memory hog especially on large repos,\neverybody knows that. The suggestion to stick a .keep file on the\ngiant base pack to avoid this problem is also known for a long time.\n\nRecent patches add an option to do just this, but it has to be either\nconfigured or activated manually. This patch lets `git gc --auto`\nactivate this mode automatically when it thinks `repack -ad` will use\na lot of memory and start affecting the system due to swapping or\nflushing OS cache.\n\ngc --auto decides to do this based on an estimation of pack-objects\nmemory usage, which is quite accurate at least for the heap part, and\nwhether that fits in half of system memory (the assumption here is for\ndesktop environment where there are many other applications running).\n\nThis mechanism only kicks in if gc.bigBasePackThreshold is not configured.\nIf it is, it is assumed that the user already knows what they want.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/git-gc.txt |  9 +++-\n builtin/gc.c             | 98 +++++++++++++++++++++++++++++++++++++++-\n builtin/pack-objects.c   |  2 +-\n config.mak.uname         |  1 +\n git-compat-util.h        |  4 ++\n pack-objects.h           |  2 +\n t/t6500-gc.sh            |  7 +++\n 7 files changed, 119 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt\nindex 0adf381b52..7549094900 100644\n--- a/Documentation/git-gc.txt\n+++ b/Documentation/git-gc.txt\n@@ -58,8 +58,13 @@ If the number of packs exceeds the value of `gc.autoPackLimit`,\n then existing packs (except those marked with a `.keep` file\n or over `gc.bigPackThreshold` limit)\n are consolidated into a single pack by using the `-A` option of\n-'git repack'. Setting `gc.autoPackLimit` to 0 disables\n-automatic consolidation of packs.\n+'git repack'.\n+If the amount of memory is estimated not enough for `git repack` to\n+run smoothly and `gc.bigPackThreshold` is not set, the largest\n+pack will also be excluded (this is the equivalent of running `git gc`\n+with `--keep-base-pack`).\n+Setting `gc.autoPackLimit` to 0 disables automatic consolidation of\n+packs.\n \n --prune=<date>::\n \tPrune loose objects older than date (default is 2 weeks ago,\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 74d3aaa270..d0b04e369e 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -20,6 +20,10 @@\n #include \"argv-array.h\"\n #include \"commit.h\"\n #include \"packfile.h\"\n+#include \"pack.h\"\n+#include \"pack-objects.h\"\n+#include \"blob.h\"\n+#include \"tree.h\"\n \n #define FAILED_RUN \"failed to run %s\"\n \n@@ -40,6 +44,7 @@ static const char *gc_log_expire = \"1.day.ago\";\n static const char *prune_expire = \"2.weeks.ago\";\n static const char *prune_worktrees_expire = \"3.months.ago\";\n static unsigned long big_pack_threshold;\n+static unsigned long max_delta_cache_size = DEFAULT_DELTA_CACHE_SIZE;\n \n static struct argv_array pack_refs_cmd = ARGV_ARRAY_INIT;\n static struct argv_array reflog = ARGV_ARRAY_INIT;\n@@ -128,6 +133,7 @@ static void gc_config(void)\n \tgit_config_get_expiry(\"gc.logexpiry\", &gc_log_expire);\n \n \tgit_config_get_ulong(\"gc.bigpackthreshold\", &big_pack_threshold);\n+\tgit_config_get_ulong(\"pack.deltacachesize\", &max_delta_cache_size);\n \n \tgit_config(git_default_config, NULL);\n }\n@@ -167,7 +173,8 @@ static int too_many_loose_objects(void)\n \treturn needed;\n }\n \n-static void find_base_packs(struct string_list *packs, unsigned long limit)\n+static struct packed_git *find_base_packs(struct string_list *packs,\n+\t\t\t\t\t  unsigned long limit)\n {\n \tstruct packed_git *p, *base = NULL;\n \n@@ -186,6 +193,8 @@ static void find_base_packs(struct string_list *packs, unsigned long limit)\n \n \tif (base)\n \t\tstring_list_append(packs, base->pack_name);\n+\n+\treturn base;\n }\n \n static int too_many_packs(void)\n@@ -211,6 +220,79 @@ static int too_many_packs(void)\n \treturn gc_auto_pack_limit < cnt;\n }\n \n+static uint64_t total_ram(void)\n+{\n+#if defined(HAVE_SYSINFO)\n+\tstruct sysinfo si;\n+\n+\tif (!sysinfo(&si))\n+\t\treturn si.totalram;\n+#elif defined(HAVE_BSD_SYSCTL) && (defined(HW_MEMSIZE) || defined(HW_PHYSMEM))\n+\tint64_t physical_memory;\n+\tint mib[2];\n+\tsize_t length;\n+\n+\tmib[0] = CTL_HW;\n+# if defined(HW_MEMSIZE)\n+\tmib[1] = HW_MEMSIZE;\n+# else\n+\tmib[1] = HW_PHYSMEM;\n+# endif\n+\tlength = sizeof(int64_t);\n+\tif (!sysctl(mib, 2, &physical_memory, &length, NULL, 0))\n+\t\treturn physical_memory;\n+#elif defined(GIT_WINDOWS_NATIVE)\n+\tMEMORYSTATUSEX memInfo;\n+\n+\tmemInfo.dwLength = sizeof(MEMORYSTATUSEX);\n+\tif (GlobalMemoryStatusEx(&memInfo))\n+\t\treturn memInfo.ullTotalPhys;\n+#endif\n+\treturn 0;\n+}\n+\n+static uint64_t estimate_repack_memory(struct packed_git *pack)\n+{\n+\tunsigned long nr_objects = approximate_object_count();\n+\tsize_t os_cache, heap;\n+\n+\tif (!pack || !nr_objects)\n+\t\treturn 0;\n+\n+\t/*\n+\t * First we have to scan through at least one pack.\n+\t * Assume enough room in OS file cache to keep the entire pack\n+\t * or we may accidentally evict data of other processes from\n+\t * the cache.\n+\t */\n+\tos_cache = pack->pack_size + pack->index_size;\n+\t/* then pack-objects needs lots more for book keeping */\n+\theap = sizeof(struct object_entry) * nr_objects;\n+\t/*\n+\t * internal rev-list --all --objects takes up some memory too,\n+\t * let's say half of it is for blobs\n+\t */\n+\theap += sizeof(struct blob) * nr_objects / 2;\n+\t/*\n+\t * and the other half is for trees (commits and tags are\n+\t * usually insignificant)\n+\t */\n+\theap += sizeof(struct tree) * nr_objects / 2;\n+\t/* and then obj_hash[], underestimated in fact */\n+\theap += sizeof(struct object *) * nr_objects;\n+\t/* revindex is used also */\n+\theap += sizeof(struct revindex_entry) * nr_objects;\n+\t/*\n+\t * read_sha1_file() (either at delta calculation phase, or\n+\t * writing phase) also fills up the delta base cache\n+\t */\n+\theap += delta_base_cache_limit;\n+\t/* and of course pack-objects has its own delta cache */\n+\theap += max_delta_cache_size;\n+\n+\treturn os_cache + heap;\n+}\n+\n static int keep_one_pack(struct string_list_item *item, void *data)\n {\n \targv_array_pushf(&repack, \"--keep-pack=%s\", basename(item->string));\n@@ -261,6 +343,20 @@ static int need_to_gc(void)\n \t\t\t\tstring_list_clear(&keep_pack, 0);\n \t\t\t\tfind_base_packs(&keep_pack, 0);\n \t\t\t}\n+\t\t} else {\n+\t\t\tstruct packed_git *p = find_base_packs(&keep_pack, 0);\n+\t\t\tuint64_t mem_have, mem_want;\n+\n+\t\t\tmem_have = total_ram();\n+\t\t\tmem_want = estimate_repack_memory(p);\n+\n+\t\t\t/*\n+\t\t\t * Only allow 1/2 of memory for pack-objects, leave\n+\t\t\t * the rest for the OS and other processes in the\n+\t\t\t * system.\n+\t\t\t */\n+\t\t\tif (!mem_have || mem_want < mem_have / 2)\n+\t\t\t\tstring_list_clear(&keep_pack, 0);\n \t\t}\n \n \t\tadd_repack_all_option(&keep_pack);\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 7ec70131a9..8b2f8b72bf 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -80,7 +80,7 @@ static uint16_t write_bitmap_options;\n static int exclude_promisor_objects;\n \n static unsigned long delta_cache_size = 0;\n-static unsigned long max_delta_cache_size = 256 * 1024 * 1024;\n+static unsigned long max_delta_cache_size = DEFAULT_DELTA_CACHE_SIZE;\n static unsigned long cache_max_small_delta_size = 1000;\n \n static unsigned long window_memory_limit = 0;\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 6a1d0de0cc..ae9cbccec1 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -37,6 +37,7 @@ ifeq ($(uname_S),Linux)\n \tHAVE_GETDELIM = YesPlease\n \tSANE_TEXT_GREP=-a\n \tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n+\tBASIC_CFLAGS += -DHAVE_SYSINFO\n endif\n ifeq ($(uname_S),GNU/kFreeBSD)\n \tHAVE_ALLOCA_H = YesPlease\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 07e383257b..e373af48b8 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -284,6 +284,10 @@ extern char *gitdirname(char *);\n #include <openssl/err.h>\n #endif\n \n+#ifdef HAVE_SYSINFO\n+# include <sys/sysinfo.h>\n+#endif\n+\n /* On most systems <netdb.h> would have given us this, but\n  * not on some systems (e.g. z/OS).\n  */\ndiff --git a/pack-objects.h b/pack-objects.h\nindex 03f1191659..af4f46c026 100644\n--- a/pack-objects.h\n+++ b/pack-objects.h\n@@ -1,6 +1,8 @@\n #ifndef PACK_OBJECTS_H\n #define PACK_OBJECTS_H\n \n+#define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024)\n+\n struct object_entry {\n \tstruct pack_idx_entry idx;\n \tunsigned long size;\t/* uncompressed size */\ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex a95969af2a..100f287b97 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -5,6 +5,13 @@ test_description='basic git gc tests\n \n . ./test-lib.sh\n \n+test_expect_success 'setup' '\n+\t# do not let the amount of physical memory affects gc\n+\t# behavior, make sure we always pack everything to one pack by\n+\t# default\n+\tgit config gc.bigPackThreshold 2g\n+'\n+\n test_expect_success 'gc empty repository' '\n \tgit gc\n '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342765","messageId":"20180324074308.18934-14-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 7/7] pack-objects: show some progress when counting kept objects","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:38Z","receivedAt":"2018-03-24T07:44:05Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"We only show progress when there are new objects to be packed. But\nwhen --keep-pack is specified on the base pack, we will exclude most\nof objects. This makes 'pack-objects' stay silent for a long time\nwhile the counting phase is going.\n\nLet's show some progress whenever we visit an object instead. The old\n\"Counting objects\" is renamed to \"Enumerating objects\" and a new\nprogress \"Counting objects\" line is added.\n\nThis new \"Counting objects\" line should progress pretty quick when the\nsystem is beefy. But when the system is under pressure, the reading\nobject header done in this phase could be slow and showing progress is\nan improvement over staying silent in the current code.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/pack-objects.c | 18 ++++++++++++------\n 1 file changed, 12 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 8b2f8b72bf..1379b4cb92 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -44,7 +44,7 @@ static const char *pack_usage[] = {\n static struct packing_data to_pack;\n \n static struct pack_idx_entry **written_list;\n-static uint32_t nr_result, nr_written;\n+static uint32_t nr_result, nr_written, nr_seen;\n \n static int non_empty;\n static int reuse_delta = 1, reuse_object = 1;\n@@ -1096,6 +1096,8 @@ static int add_object_entry(const struct object_id *oid, enum object_type type,\n \toff_t found_offset = 0;\n \tuint32_t index_pos;\n \n+\tdisplay_progress(progress_state, ++nr_seen);\n+\n \tif (have_duplicate_entry(oid, exclude, &index_pos))\n \t\treturn 0;\n \n@@ -1111,8 +1113,6 @@ static int add_object_entry(const struct object_id *oid, enum object_type type,\n \tcreate_object_entry(oid, type, pack_name_hash(name),\n \t\t\t    exclude, name && no_try_delta(name),\n \t\t\t    index_pos, found_pack, found_offset);\n-\n-\tdisplay_progress(progress_state, nr_result);\n \treturn 1;\n }\n \n@@ -1123,6 +1123,8 @@ static int add_object_entry_from_bitmap(const struct object_id *oid,\n {\n \tuint32_t index_pos;\n \n+\tdisplay_progress(progress_state, ++nr_seen);\n+\n \tif (have_duplicate_entry(oid, 0, &index_pos))\n \t\treturn 0;\n \n@@ -1130,8 +1132,6 @@ static int add_object_entry_from_bitmap(const struct object_id *oid,\n \t\treturn 0;\n \n \tcreate_object_entry(oid, type, name_hash, 0, 0, index_pos, pack, offset);\n-\n-\tdisplay_progress(progress_state, nr_result);\n \treturn 1;\n }\n \n@@ -1717,6 +1717,10 @@ static void get_object_details(void)\n \tuint32_t i;\n \tstruct object_entry **sorted_by_offset;\n \n+\tif (progress)\n+\t\tprogress_state = start_progress(_(\"Counting objects\"),\n+\t\t\t\t\t\tto_pack.nr_objects);\n+\n \tsorted_by_offset = xcalloc(to_pack.nr_objects, sizeof(struct object_entry *));\n \tfor (i = 0; i < to_pack.nr_objects; i++)\n \t\tsorted_by_offset[i] = to_pack.objects + i;\n@@ -1727,7 +1731,9 @@ static void get_object_details(void)\n \t\tcheck_object(entry);\n \t\tif (big_file_threshold < entry->size)\n \t\t\tentry->no_try_delta = 1;\n+\t\tdisplay_progress(progress_state, i + 1);\n \t}\n+\tstop_progress(&progress_state);\n \n \t/*\n \t * This must happen in a second pass, since we rely on the delta\n@@ -3212,7 +3218,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (progress)\n-\t\tprogress_state = start_progress(_(\"Counting objects\"), 0);\n+\t\tprogress_state = start_progress(_(\"Enumerating objects\"), 0);\n \tif (!use_internal_rev_list)\n \t\tread_object_list_from_stdin();\n \telse {\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342766","messageId":"20180324074308.18934-6-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v4 3/7] gc: add --keep-largest-pack option","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:30Z","receivedAt":"2018-03-24T07:44:10Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This adds a new repack mode that combines everything into a secondary\npack, leaving the largest pack alone.\n\nThis could help reduce memory pressure. On linux-2.6.git, valgrind\nmassif reports 1.6GB heap in \"pack all\" case, and 535MB in \"pack\nall except the base pack\" case. We save roughly 1GB memory by\nexcluding the base pack.\n\nThis should also lower I/O because we don't have to rewrite a giant\npack every time (e.g. for linux-2.6.git that's a 1.4GB pack file)..\n\nPS. The use of string_list here seems overkill, but we'll need it in\nthe next patch...\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/git-gc.txt |  6 ++++-\n builtin/gc.c             | 47 ++++++++++++++++++++++++++++++++++++----\n t/t6500-gc.sh            | 25 +++++++++++++++++++++\n 3 files changed, 73 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt\nindex 571b5a7e3c..bf81b8de30 100644\n--- a/Documentation/git-gc.txt\n+++ b/Documentation/git-gc.txt\n@@ -9,7 +9,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository\n SYNOPSIS\n --------\n [verse]\n-'git gc' [--aggressive] [--auto] [--quiet] [--prune=<date> | --no-prune] [--force]\n+'git gc' [--aggressive] [--auto] [--quiet] [--prune=<date> | --no-prune] [--force] [--keep-largest-pack]\n \n DESCRIPTION\n -----------\n@@ -78,6 +78,10 @@ automatic consolidation of packs.\n \tForce `git gc` to run even if there may be another `git gc`\n \tinstance running on this repository.\n \n+--keep-largest-pack::\n+\tAll packs except the largest pack and those marked with a\n+\t`.keep` files are consolidated into a single pack.\n+\n Configuration\n -------------\n \ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 77fa720bd0..9a09cf53b0 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -164,6 +164,24 @@ static int too_many_loose_objects(void)\n \treturn needed;\n }\n \n+static void find_base_packs(struct string_list *packs)\n+{\n+\tstruct packed_git *p, *base = NULL;\n+\n+\tprepare_packed_git();\n+\n+\tfor (p = packed_git; p; p = p->next) {\n+\t\tif (!p->pack_local)\n+\t\t\tcontinue;\n+\t\tif (!base || base->pack_size < p->pack_size) {\n+\t\t\tbase = p;\n+\t\t}\n+\t}\n+\n+\tif (base)\n+\t\tstring_list_append(packs, base->pack_name);\n+}\n+\n static int too_many_packs(void)\n {\n \tstruct packed_git *p;\n@@ -187,7 +205,13 @@ static int too_many_packs(void)\n \treturn gc_auto_pack_limit < cnt;\n }\n \n-static void add_repack_all_option(void)\n+static int keep_one_pack(struct string_list_item *item, void *data)\n+{\n+\targv_array_pushf(&repack, \"--keep-pack=%s\", basename(item->string));\n+\treturn 0;\n+}\n+\n+static void add_repack_all_option(struct string_list *keep_pack)\n {\n \tif (prune_expire && !strcmp(prune_expire, \"now\"))\n \t\targv_array_push(&repack, \"-a\");\n@@ -196,6 +220,9 @@ static void add_repack_all_option(void)\n \t\tif (prune_expire)\n \t\t\targv_array_pushf(&repack, \"--unpack-unreachable=%s\", prune_expire);\n \t}\n+\n+\tif (keep_pack)\n+\t\tfor_each_string_list(keep_pack, keep_one_pack, NULL);\n }\n \n static void add_repack_incremental_option(void)\n@@ -219,7 +246,7 @@ static int need_to_gc(void)\n \t * there is no need.\n \t */\n \tif (too_many_packs())\n-\t\tadd_repack_all_option();\n+\t\tadd_repack_all_option(NULL);\n \telse if (too_many_loose_objects())\n \t\tadd_repack_incremental_option();\n \telse\n@@ -353,6 +380,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \tconst char *name;\n \tpid_t pid;\n \tint daemonized = 0;\n+\tint keep_base_pack = -1;\n \n \tstruct option builtin_gc_options[] = {\n \t\tOPT__QUIET(&quiet, N_(\"suppress progress reporting\")),\n@@ -362,6 +390,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\tOPT_BOOL(0, \"aggressive\", &aggressive, N_(\"be more thorough (increased runtime)\")),\n \t\tOPT_BOOL(0, \"auto\", &auto_gc, N_(\"enable auto-gc mode\")),\n \t\tOPT_BOOL(0, \"force\", &force, N_(\"force running gc even if there may be another gc running\")),\n+\t\tOPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n+\t\t\t N_(\"repack all other packs except the largest pack\")),\n \t\tOPT_END()\n \t};\n \n@@ -427,8 +457,17 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\t */\n \t\t\tdaemonized = !daemonize();\n \t\t}\n-\t} else\n-\t\tadd_repack_all_option();\n+\t} else {\n+\t\tstruct string_list keep_pack = STRING_LIST_INIT_NODUP;\n+\n+\t\tif (keep_base_pack != -1) {\n+\t\t\tif (keep_base_pack)\n+\t\t\t\tfind_base_packs(&keep_pack);\n+\t\t}\n+\n+\t\tadd_repack_all_option(&keep_pack);\n+\t\tstring_list_clear(&keep_pack, 0);\n+\t}\n \n \tname = lock_repo_for_gc(force, &pid);\n \tif (name) {\ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 41b0be575d..a95969af2a 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -43,6 +43,31 @@ test_expect_success 'gc is not aborted due to a stale symref' '\n \t)\n '\n \n+test_expect_success 'gc --keep-largest-pack' '\n+\ttest_create_repo keep-pack &&\n+\t(\n+\t\tcd keep-pack &&\n+\t\ttest_commit one &&\n+\t\ttest_commit two &&\n+\t\ttest_commit three &&\n+\t\tgit gc &&\n+\t\t( cd .git/objects/pack && ls *.pack ) >pack-list &&\n+\t\ttest_line_count = 1 pack-list &&\n+\t\tBASE_PACK=.git/objects/pack/pack-*.pack &&\n+\t\ttest_commit four &&\n+\t\tgit repack -d &&\n+\t\ttest_commit five &&\n+\t\tgit repack -d &&\n+\t\t( cd .git/objects/pack && ls *.pack ) >pack-list &&\n+\t\ttest_line_count = 3 pack-list &&\n+\t\tgit gc --keep-largest-pack &&\n+\t\t( cd .git/objects/pack && ls *.pack ) >pack-list &&\n+\t\ttest_line_count = 2 pack-list &&\n+\t\ttest_path_is_file $BASE_PACK &&\n+\t\tgit fsck\n+\t)\n+'\n+\n test_expect_success 'auto gc with too many loose objects does not attempt to create bitmaps' '\n \ttest_config gc.auto 3 &&\n \ttest_config gc.autodetach false &&\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342767","messageId":"20180324074308.18934-5-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-1-pclouds@gmail.com","subject":"[PATCH v2 02/36] t/helper: merge test-chmtime into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:42:29Z","receivedAt":"2018-03-24T07:44:12Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                             |  3 ++-\n t/helper/test-chmtime.c              | 15 +++++++-------\n t/helper/test-tool.c                 |  1 +\n t/helper/test-tool.h                 |  2 ++\n t/lib-git-svn.sh                     |  2 +-\n t/t1700-split-index.sh               | 12 +++++------\n t/t2022-checkout-paths.sh            |  4 ++--\n t/t3306-notes-prune.sh               |  2 +-\n t/t3404-rebase-interactive.sh        |  4 ++--\n t/t3418-rebase-continue.sh           |  4 ++--\n t/t3501-revert-cherry-pick.sh        |  2 +-\n t/t3510-cherry-pick-sequence.sh      |  4 ++--\n t/t3600-rm.sh                        |  2 +-\n t/t3700-add.sh                       |  2 +-\n t/t4011-diff-symlink.sh              |  2 +-\n t/t4013-diff-various.sh              |  2 +-\n t/t4035-diff-quiet.sh                |  2 +-\n t/t4151-am-abort.sh                  |  4 ++--\n t/t4200-rerere.sh                    | 22 ++++++++++----------\n t/t5000-tar-tree.sh                  |  2 +-\n t/t5304-prune.sh                     | 16 +++++++--------\n t/t5400-send-pack.sh                 |  2 +-\n t/t5516-fetch-push.sh                |  2 +-\n t/t6022-merge-rename.sh              | 30 ++++++++++++++--------------\n t/t6500-gc.sh                        |  2 +-\n t/t6501-freshen-objects.sh           |  4 ++--\n t/t7508-status.sh                    |  6 +++---\n t/t7701-repack-unpack-unreachable.sh |  6 +++---\n t/t9100-git-svn-basic.sh             |  4 ++--\n t/t9803-git-p4-shell-metachars.sh    |  4 ++--\n t/t9813-git-p4-preserve-users.sh     |  6 +++---\n t/t9820-git-p4-editor-handling.sh    |  2 +-\n t/test-lib.sh                        |  6 +++---\n 33 files changed, 94 insertions(+), 89 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2376646e98..416a8e39c1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -652,7 +652,8 @@ X =\n \n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n-TEST_PROGRAMS_NEED_X += test-chmtime\n+TEST_BUILTINS_OBJS += test-chmtime.o\n+\n TEST_PROGRAMS_NEED_X += test-ctype\n TEST_PROGRAMS_NEED_X += test-config\n TEST_PROGRAMS_NEED_X += test-date\ndiff --git a/t/helper/test-chmtime.c b/t/helper/test-chmtime.c\nindex e760256406..1790ceab51 100644\n--- a/t/helper/test-chmtime.c\n+++ b/t/helper/test-chmtime.c\n@@ -5,28 +5,29 @@\n  *\n  * The mtime can be changed to an absolute value:\n  *\n- *\ttest-chmtime =<seconds> file...\n+ *\ttest-tool chmtime =<seconds> file...\n  *\n  * Relative to the current time as returned by time(3):\n  *\n- *\ttest-chmtime =+<seconds> (or =-<seconds>) file...\n+ *\ttest-tool chmtime =+<seconds> (or =-<seconds>) file...\n  *\n  * Or relative to the current mtime of the file:\n  *\n- *\ttest-chmtime <seconds> file...\n- *\ttest-chmtime +<seconds> (or -<seconds>) file...\n+ *\ttest-tool chmtime <seconds> file...\n+ *\ttest-tool chmtime +<seconds> (or -<seconds>) file...\n  *\n  * Examples:\n  *\n  * To just print the mtime use --verbose and set the file mtime offset to 0:\n  *\n- *\ttest-chmtime -v +0 file\n+ *\ttest-tool chmtime -v +0 file\n  *\n  * To set the mtime to current time:\n  *\n- *\ttest-chmtime =+0 file\n+ *\ttest-tool chmtime =+0 file\n  *\n  */\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include <utime.h>\n \n@@ -56,7 +57,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)\n \treturn 1;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__chmtime(int argc, const char **argv)\n {\n \tstatic int verbose;\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c730f718ca..63ec15cb56 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -7,6 +7,7 @@ struct test_cmd {\n };\n \n static struct test_cmd cmds[] = {\n+\t{ \"chmtime\", cmd__chmtime },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 6ce57ae0cc..3a35e70e79 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -1,4 +1,6 @@\n #ifndef __TEST_TOOL_H__\n #define __TEST_TOOL_H__\n \n+int cmd__chmtime(int argc, const char **argv);\n+\n #endif\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 4c1f81f167..a8130f9119 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -49,7 +49,7 @@ rawsvnrepo=\"$svnrepo\"\n svnrepo=\"file://$svnrepo\"\n \n poke() {\n-\ttest-chmtime +1 \"$1\"\n+\ttest-tool chmtime +1 \"$1\"\n }\n \n # We need this, because we should pass empty configuration directory to\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex a66936fe9b..4b5d443280 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -332,12 +332,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '\n \tgit update-index --add ten &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_under_2_weeks_ago=$((5-14*86400)) &&\n-\ttest-chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&\n \t: >eleven &&\n \tgit update-index --add eleven &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_over_2_weeks_ago=$((-1-14*86400)) &&\n-\ttest-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n \t: >twelve &&\n \tgit update-index --add twelve &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\n@@ -345,12 +345,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '\n \n test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '\n \tgit config splitIndex.sharedIndexExpire \"16.days.ago\" &&\n-\ttest-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n \t: >thirteen &&\n \tgit update-index --add thirteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_over_16_days_ago=$((-1-16*86400)) &&\n-\ttest-chmtime =$just_over_16_days_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_16_days_ago .git/sharedindex.* &&\n \t: >fourteen &&\n \tgit update-index --add fourteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\n@@ -359,13 +359,13 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '\n test_expect_success 'check splitIndex.sharedIndexExpire set to \"never\" and \"now\"' '\n \tgit config splitIndex.sharedIndexExpire never &&\n \tjust_10_years_ago=$((-365*10*86400)) &&\n-\ttest-chmtime =$just_10_years_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_10_years_ago .git/sharedindex.* &&\n \t: >fifteen &&\n \tgit update-index --add fifteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tgit config splitIndex.sharedIndexExpire now &&\n \tjust_1_second_ago=-1 &&\n-\ttest-chmtime =$just_1_second_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_1_second_ago .git/sharedindex.* &&\n \t: >sixteen &&\n \tgit update-index --add sixteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\ndiff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh\nindex f46d0499bc..e74d58b9e1 100755\n--- a/t/t2022-checkout-paths.sh\n+++ b/t/t2022-checkout-paths.sh\n@@ -68,13 +68,13 @@ test_expect_success 'do not touch files that are already up-to-date' '\n \tgit add file1 file2 &&\n \tgit commit -m base &&\n \techo modified >file1 &&\n-\ttest-chmtime =1000000000 file2 &&\n+\ttest-tool chmtime =1000000000 file2 &&\n \tgit update-index -q --refresh &&\n \tgit checkout HEAD -- file1 file2 &&\n \techo one >expect &&\n \ttest_cmp expect file1 &&\n \techo \"1000000000\tfile2\" >expect &&\n-\ttest-chmtime -v +0 file2 >actual &&\n+\ttest-tool chmtime -v +0 file2 >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh\nindex 86bf909ee3..61748088eb 100755\n--- a/t/t3306-notes-prune.sh\n+++ b/t/t3306-notes-prune.sh\n@@ -22,7 +22,7 @@ test_expect_success 'setup: create a few commits with notes' '\n \tgit commit -m 3rd &&\n \tCOMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&\n \ttest -f $COMMIT_FILE &&\n-\ttest-chmtime =+0 $COMMIT_FILE &&\n+\ttest-tool chmtime =+0 $COMMIT_FILE &&\n \tgit notes add -m \"Note #3\"\n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 3b905406df..961ac9d6b8 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -711,13 +711,13 @@ test_expect_success 'rebase -i continue with unstaged submodule' '\n test_expect_success 'avoid unnecessary reset' '\n \tgit checkout master &&\n \tgit reset --hard &&\n-\ttest-chmtime =123456789 file3 &&\n+\ttest-tool chmtime =123456789 file3 &&\n \tgit update-index --refresh &&\n \tHEAD=$(git rev-parse HEAD) &&\n \tset_fake_editor &&\n \tgit rebase -i HEAD~4 &&\n \ttest $HEAD = $(git rev-parse HEAD) &&\n-\tMTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&\n+\tMTIME=$(test-tool chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&\n \ttest 123456789 = $MTIME\n '\n \ndiff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh\nindex 7c91a85f43..9214d0bb51 100755\n--- a/t/t3418-rebase-continue.sh\n+++ b/t/t3418-rebase-continue.sh\n@@ -24,7 +24,7 @@ test_expect_success 'interactive rebase --continue works with touched file' '\n \tgit checkout master &&\n \n \tFAKE_LINES=\"edit 1\" git rebase -i HEAD^ &&\n-\ttest-chmtime =-60 F1 &&\n+\ttest-tool chmtime =-60 F1 &&\n \tgit rebase --continue\n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'non-interactive rebase --continue works with touched file'\n \ttest_must_fail git rebase --onto master master topic &&\n \techo \"Resolved\" >F2 &&\n \tgit add F2 &&\n-\ttest-chmtime =-60 F1 &&\n+\ttest-tool chmtime =-60 F1 &&\n \tgit rebase --continue\n '\n \ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 783bdbf59d..ccbc118514 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -86,7 +86,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '\n \t(\n \t\tcd copy &&\n \t\tgit checkout initial &&\n-\t\ttest-chmtime +40 oops &&\n+\t\ttest-tool chmtime +40 oops &&\n \t\tgit cherry-pick added\n \t)\n '\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 0acf4b1461..9f93445f1e 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -247,9 +247,9 @@ test_expect_success '--abort after last commit in sequence' '\n test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '\n \tpristine_detach initial &&\n \ttest_expect_code 1 git cherry-pick base..anotherpick &&\n-\ttest-chmtime -v +0 .git/sequencer >expect &&\n+\ttest-tool chmtime -v +0 .git/sequencer >expect &&\n \ttest_expect_code 128 git cherry-pick unrelatedpick &&\n-\ttest-chmtime -v +0 .git/sequencer >actual &&\n+\ttest-tool chmtime -v +0 .git/sequencer >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 46f15169f5..b8fbdefcdc 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -232,7 +232,7 @@ test_expect_success 'Call \"rm\" from outside the work tree' '\n test_expect_success 'refresh index before checking if it is up-to-date' '\n \n \tgit reset --hard &&\n-\ttest-chmtime -86400 frotz/nitfol &&\n+\ttest-tool chmtime -86400 frotz/nitfol &&\n \tgit rm frotz/nitfol &&\n \ttest ! -f frotz/nitfol\n \ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 2748805642..07af05d7ae 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -187,7 +187,7 @@ test_expect_success 'git add --refresh with pathspec' '\n \techo >foo && echo >bar && echo >baz &&\n \tgit add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo &&\n \techo \"100644 $H 3\tfoo\" | git update-index --index-info &&\n-\ttest-chmtime -60 bar baz &&\n+\ttest-tool chmtime -60 bar baz &&\n \t>expect &&\n \tgit add --refresh bar >actual &&\n \ttest_cmp expect actual &&\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 13e7f621ab..cf0f3a1ee7 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -73,7 +73,7 @@ test_expect_success 'diff identical, but newly created symlink and file' '\n \t>expected &&\n \trm -f frotz nitfol &&\n \techo xyzzy >nitfol &&\n-\ttest-chmtime +10 nitfol &&\n+\ttest-tool chmtime +10 nitfol &&\n \tif test_have_prereq SYMLINKS\n \tthen\n \t\tln -s xyzzy frotz\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 3f9a24fd56..f8d853595b 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -76,7 +76,7 @@ test_expect_success setup '\n \n \tmkdir dir3 &&\n \tcp dir/sub dir3/sub &&\n-\ttest-chmtime +1 dir3/sub &&\n+\ttest-tool chmtime +1 dir3/sub &&\n \n \tgit config log.showroot false &&\n \tgit commit --amend &&\ndiff --git a/t/t4035-diff-quiet.sh b/t/t4035-diff-quiet.sh\nindex 2f1737fcef..0352bf81a9 100755\n--- a/t/t4035-diff-quiet.sh\n+++ b/t/t4035-diff-quiet.sh\n@@ -147,7 +147,7 @@ test_expect_success 'git diff --ignore-all-space, both files outside repo' '\n '\n \n test_expect_success 'git diff --quiet ignores stat-change only entries' '\n-\ttest-chmtime +10 a &&\n+\ttest-tool chmtime +10 a &&\n \techo modified >>b &&\n \ttest_expect_code 1 git diff --quiet\n '\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex 16432781d2..9d8d3c72e7 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -171,7 +171,7 @@ test_expect_success 'am --skip leaves index stat info alone' '\n \tgit checkout -f --orphan skip-stat-info &&\n \tgit reset &&\n \ttest_commit skip-should-be-untouched &&\n-\ttest-chmtime =0 skip-should-be-untouched.t &&\n+\ttest-tool chmtime =0 skip-should-be-untouched.t &&\n \tgit update-index --refresh &&\n \tgit diff-files --exit-code --quiet &&\n \ttest_must_fail git am 0001-*.patch &&\n@@ -183,7 +183,7 @@ test_expect_success 'am --abort leaves index stat info alone' '\n \tgit checkout -f --orphan abort-stat-info &&\n \tgit reset &&\n \ttest_commit abort-should-be-untouched &&\n-\ttest-chmtime =0 abort-should-be-untouched.t &&\n+\ttest-tool chmtime =0 abort-should-be-untouched.t &&\n \tgit update-index --refresh &&\n \tgit diff-files --exit-code --quiet &&\n \ttest_must_fail git am 0001-*.patch &&\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex d97d2bebc9..deafaa3e07 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -166,7 +166,7 @@ test_expect_success 'first postimage wins' '\n \tgit commit -q -a -m \"prefer first over second\" &&\n \ttest -f $rr/postimage &&\n \n-\toldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) &&\n+\toldmtimepost=$(test-tool chmtime -v -60 $rr/postimage | cut -f 1) &&\n \n \tgit checkout -b third master &&\n \tgit show second^:a1 | sed \"s/To die: t/To die! T/\" >a1 &&\n@@ -179,7 +179,7 @@ test_expect_success 'first postimage wins' '\n '\n \n test_expect_success 'rerere updates postimage timestamp' '\n-\tnewmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) &&\n+\tnewmtimepost=$(test-tool chmtime -v +0 $rr/postimage | cut -f 1) &&\n \ttest $oldmtimepost -lt $newmtimepost\n '\n \n@@ -220,9 +220,9 @@ test_expect_success 'set up for garbage collection tests' '\n \talmost_60_days_ago=$((60-60*86400)) &&\n \tjust_over_60_days_ago=$((-1-60*86400)) &&\n \n-\ttest-chmtime =$just_over_60_days_ago $rr/preimage &&\n-\ttest-chmtime =$almost_60_days_ago $rr/postimage &&\n-\ttest-chmtime =$almost_15_days_ago $rr2/preimage\n+\ttest-tool chmtime =$just_over_60_days_ago $rr/preimage &&\n+\ttest-tool chmtime =$almost_60_days_ago $rr/postimage &&\n+\ttest-tool chmtime =$almost_15_days_ago $rr2/preimage\n '\n \n test_expect_success 'gc preserves young or recently used records' '\n@@ -232,8 +232,8 @@ test_expect_success 'gc preserves young or recently used records' '\n '\n \n test_expect_success 'old records rest in peace' '\n-\ttest-chmtime =$just_over_60_days_ago $rr/postimage &&\n-\ttest-chmtime =$just_over_15_days_ago $rr2/preimage &&\n+\ttest-tool chmtime =$just_over_60_days_ago $rr/postimage &&\n+\ttest-tool chmtime =$just_over_15_days_ago $rr2/preimage &&\n \tgit rerere gc &&\n \t! test -f $rr/preimage &&\n \t! test -f $rr2/preimage\n@@ -249,8 +249,8 @@ rerere_gc_custom_expiry_test () {\n \t\t>\"$rr/postimage\" &&\n \n \t\ttwo_days_ago=$((-2*86400)) &&\n-\t\ttest-chmtime =$two_days_ago \"$rr/preimage\" &&\n-\t\ttest-chmtime =$two_days_ago \"$rr/postimage\" &&\n+\t\ttest-tool chmtime =$two_days_ago \"$rr/preimage\" &&\n+\t\ttest-tool chmtime =$two_days_ago \"$rr/postimage\" &&\n \n \t\tfind .git/rr-cache -type f | sort >original &&\n \n@@ -512,7 +512,7 @@ test_expect_success 'multiple identical conflicts' '\n \tcount_pre_post 2 0 &&\n \n \t# Pretend that the conflicts were made quite some time ago\n-\tfind .git/rr-cache/ -type f | xargs test-chmtime -172800 &&\n+\tfind .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&\n \n \t# Unresolved entries have not expired yet\n \tgit -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&\n@@ -568,7 +568,7 @@ test_expect_success 'multiple identical conflicts' '\n \tgit rerere &&\n \n \t# Pretend that the resolutions are old again\n-\tfind .git/rr-cache/ -type f | xargs test-chmtime -172800 &&\n+\tfind .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&\n \n \t# Resolved entries have not expired yet\n \tgit -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex fe2d4f15a7..266d052efb 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -192,7 +192,7 @@ test_expect_success \\\n     'validate file modification time' \\\n     'mkdir extract &&\n      \"$TAR\" xf b.tar -C extract a/a &&\n-     test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&\n+     test-tool chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&\n      echo \"1117231200\" >expected.mtime &&\n      test_cmp expected.mtime b.mtime'\n \ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 6694c19a1e..f0f6e2a5f3 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -15,7 +15,7 @@ add_blob() {\n \tBLOB_FILE=.git/objects/$(echo $BLOB | sed \"s/^../&\\//\") &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =+0 $BLOB_FILE\n+\ttest-tool chmtime =+0 $BLOB_FILE\n }\n \n test_expect_success setup '\n@@ -33,7 +33,7 @@ test_expect_success 'prune stale packs' '\n \torig_pack=$(echo .git/objects/pack/*.pack) &&\n \t: > .git/objects/tmp_1.pack &&\n \t: > .git/objects/tmp_2.pack &&\n-\ttest-chmtime =-86501 .git/objects/tmp_1.pack &&\n+\ttest-tool chmtime =-86501 .git/objects/tmp_1.pack &&\n \tgit prune --expire 1.day &&\n \ttest_path_is_file $orig_pack &&\n \ttest_path_is_file .git/objects/tmp_2.pack &&\n@@ -47,7 +47,7 @@ test_expect_success 'prune --expire' '\n \tgit prune --expire=1.hour.ago &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =-86500 $BLOB_FILE &&\n+\ttest-tool chmtime =-86500 $BLOB_FILE &&\n \tgit prune --expire 1.day &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n@@ -57,11 +57,11 @@ test_expect_success 'prune --expire' '\n test_expect_success 'gc: implicit prune --expire' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((2*$week-30)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&\n \tgit gc &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =-$((2*$week+1)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&\n \tgit gc &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n@@ -141,7 +141,7 @@ test_expect_success 'prune: do not prune heads listed as an argument' '\n test_expect_success 'gc --no-prune' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((5001*$day)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc --no-prune &&\n \tverbose test 1 = $(git count-objects | sed \"s/ .*//\") &&\n@@ -163,7 +163,7 @@ test_expect_success 'gc respects gc.pruneExpire' '\n test_expect_success 'gc --prune=<date>' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((5001*$day)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit gc --prune=5002.days.ago &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=5000.days.ago &&\n@@ -205,7 +205,7 @@ test_expect_success 'prune --expire=never' '\n \n test_expect_success 'gc: prune old objects after local clone' '\n \tadd_blob &&\n-\ttest-chmtime =-$((2*$week+1)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&\n \tgit clone --no-hardlinks . aclone &&\n \t(\n \t\tcd aclone &&\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex d375d7110d..911eae1bf7 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -180,7 +180,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n \t    # And create a file that follows the temporary object naming\n \t    # convention for the auto-gc to remove\n \t    : >.git/objects/tmp_test_object &&\n-\t    test-chmtime =-1209601 .git/objects/tmp_test_object\n+\t    test-tool chmtime =-1209601 .git/objects/tmp_test_object\n \t) &&\n \t(\n \t    cd parent &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 177897ea0b..82239138d5 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -1418,7 +1418,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '\n \t\tcd testrepo &&\n \t\tgit reset --hard HEAD^ &&\n \t\ttest $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&\n-\t\ttest-chmtime +100 path1\n+\t\ttest-tool chmtime +100 path1\n \t) &&\n \tgit push testrepo master &&\n \t(\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex c01f721f13..a1fad6980b 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -635,10 +635,10 @@ test_expect_success 'setup avoid unnecessary update, normal rename' '\n \n test_expect_success 'avoid unnecessary update, normal rename' '\n \tgit checkout -q avoid-unnecessary-update-1^0 &&\n-\ttest-chmtime =1000000000 rename &&\n-\ttest-chmtime -v +0 rename >expect &&\n+\ttest-tool chmtime =1000000000 rename &&\n+\ttest-tool chmtime -v +0 rename >expect &&\n \tgit merge merge-branch-1 &&\n-\ttest-chmtime -v +0 rename >actual &&\n+\ttest-tool chmtime -v +0 rename >actual &&\n \ttest_cmp expect actual # \"rename\" should have stayed intact\n '\n \n@@ -668,10 +668,10 @@ test_expect_success 'setup to test avoiding unnecessary update, with D/F conflic\n \n test_expect_success 'avoid unnecessary update, with D/F conflict' '\n \tgit checkout -q avoid-unnecessary-update-2^0 &&\n-\ttest-chmtime =1000000000 df &&\n-\ttest-chmtime -v +0 df >expect &&\n+\ttest-tool chmtime =1000000000 df &&\n+\ttest-tool chmtime -v +0 df >expect &&\n \tgit merge merge-branch-2 &&\n-\ttest-chmtime -v +0 df >actual &&\n+\ttest-tool chmtime -v +0 df >actual &&\n \ttest_cmp expect actual # \"df\" should have stayed intact\n '\n \n@@ -700,10 +700,10 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '\n \n test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 df &&\n-\ttest-chmtime -v +0 df >expect &&\n+\ttest-tool chmtime =1000000000 df &&\n+\ttest-tool chmtime -v +0 df >expect &&\n \tgit merge side &&\n-\ttest-chmtime -v +0 df >actual &&\n+\ttest-tool chmtime -v +0 df >actual &&\n \ttest_cmp expect actual # \"df\" should have stayed intact\n '\n \n@@ -730,10 +730,10 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '\n \n test_expect_success 'avoid unnecessary update, modify/delete' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 file &&\n-\ttest-chmtime -v +0 file >expect &&\n+\ttest-tool chmtime =1000000000 file &&\n+\ttest-tool chmtime -v +0 file >expect &&\n \ttest_must_fail git merge side &&\n-\ttest-chmtime -v +0 file >actual &&\n+\ttest-tool chmtime -v +0 file >actual &&\n \ttest_cmp expect actual # \"file\" should have stayed intact\n '\n \n@@ -759,10 +759,10 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '\n \n test_expect_success 'avoid unnecessary update, rename/add-dest' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 newfile &&\n-\ttest-chmtime -v +0 newfile >expect &&\n+\ttest-tool chmtime =1000000000 newfile &&\n+\ttest-tool chmtime -v +0 newfile >expect &&\n \tgit merge side &&\n-\ttest-chmtime -v +0 newfile >actual &&\n+\ttest-tool chmtime -v +0 newfile >actual &&\n \ttest_cmp expect actual # \"file\" should have stayed intact\n '\n \ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 41b0be575d..d5255dd576 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -87,7 +87,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re\n \ttest_must_fail git gc --auto 2>err &&\n \ttest_i18ngrep \"^error:\" err &&\n \ttest_config gc.logexpiry 5.days &&\n-\ttest-chmtime =-345600 .git/gc.log &&\n+\ttest-tool chmtime =-345600 .git/gc.log &&\n \ttest_must_fail git gc --auto &&\n \ttest_config gc.logexpiry 2.days &&\n \trun_and_wait_for_auto_gc &&\ndiff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh\nindex 394b169ead..765cced60b 100755\n--- a/t/t6501-freshen-objects.sh\n+++ b/t/t6501-freshen-objects.sh\n@@ -73,7 +73,7 @@ for repack in '' true; do\n \n \ttest_expect_success \"simulate time passing ($title)\" '\n \t\tfind .git/objects -type f |\n-\t\txargs test-chmtime -v -86400\n+\t\txargs test-tool chmtime -v -86400\n \t'\n \n \ttest_expect_success \"start writing new commit with old blob ($title)\" '\n@@ -104,7 +104,7 @@ for repack in '' true; do\n \ttest_expect_success \"abandon objects again ($title)\" '\n \t\tgit reset --hard HEAD^ &&\n \t\tfind .git/objects -type f |\n-\t\txargs test-chmtime -v -86400\n+\t\txargs test-tool chmtime -v -86400\n \t'\n \n \ttest_expect_success \"start writing new commit with same tree ($title)\" '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 50052e2872..7afadb175a 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1672,12 +1672,12 @@ test_expect_success '\"Initial commit\" should not be noted in commit template' '\n '\n \n test_expect_success '--no-optional-locks prevents index update' '\n-\ttest-chmtime =1234567890 .git/index &&\n+\ttest-tool chmtime =1234567890 .git/index &&\n \tgit --no-optional-locks status &&\n-\ttest-chmtime -v +0 .git/index >out &&\n+\ttest-tool chmtime -v +0 .git/index >out &&\n \tgrep ^1234567890 out &&\n \tgit status &&\n-\ttest-chmtime -v +0 .git/index >out &&\n+\ttest-tool chmtime -v +0 .git/index >out &&\n \t! grep ^1234567890 out\n '\n \ndiff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh\nindex 987573c41f..8a586ab021 100755\n--- a/t/t7701-repack-unpack-unreachable.sh\n+++ b/t/t7701-repack-unpack-unreachable.sh\n@@ -90,7 +90,7 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '\n \ttmppack=\".git/objects/pack/tmp_pack\" &&\n \tln \"$packfile\" \"$tmppack\" &&\n \tgit repack -A -l -d &&\n-\ttest-chmtime -v +0 \"$tmppack\" \"$fsha1path\" \"$csha1path\" \"$tsha1path\" \\\n+\ttest-tool chmtime -v +0 \"$tmppack\" \"$fsha1path\" \"$csha1path\" \"$tsha1path\" \\\n \t\t> mtimes &&\n \tcompare_mtimes < mtimes\n '\n@@ -103,7 +103,7 @@ test_expect_success 'do not bother loosening old objects' '\n \tgit prune-packed &&\n \tgit cat-file -p $obj1 &&\n \tgit cat-file -p $obj2 &&\n-\ttest-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&\n+\ttest-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&\n \tgit repack -A -d --unpack-unreachable=1.hour.ago &&\n \tgit cat-file -p $obj1 &&\n \ttest_must_fail git cat-file -p $obj2\n@@ -117,7 +117,7 @@ test_expect_success 'keep packed objects found only in index' '\n \tgit reset HEAD^ &&\n \tgit reflog expire --expire=now --all &&\n \tgit add file &&\n-\ttest-chmtime =-86400 .git/objects/pack/* &&\n+\ttest-tool chmtime =-86400 .git/objects/pack/* &&\n \tgit gc --prune=1.hour.ago &&\n \tgit cat-file blob :file\n '\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 8a8ba65a2a..c937330a5f 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -288,12 +288,12 @@ test_expect_success 'able to dcommit to a subdirectory' '\n \n test_expect_success 'dcommit should not fail with a touched file' '\n \ttest_commit \"commit-new-file-foo2\" foo2 &&\n-\ttest-chmtime =-60 foo &&\n+\ttest-tool chmtime =-60 foo &&\n \tgit svn dcommit\n '\n \n test_expect_success 'rebase should not fail with a touched file' '\n-\ttest-chmtime =-60 foo &&\n+\ttest-tool chmtime =-60 foo &&\n \tgit svn rebase\n '\n \ndiff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh\nindex d950c7d665..d5c3675100 100755\n--- a/t/t9803-git-p4-shell-metachars.sh\n+++ b/t/t9803-git-p4-shell-metachars.sh\n@@ -28,7 +28,7 @@ test_expect_success 'shell metachars in filenames' '\n \t\techo f2 >\"file with spaces\" &&\n \t\tgit add \"file with spaces\" &&\n \t\tgit commit -m \"add files\" &&\n-\t\tP4EDITOR=\"test-chmtime +5\" git p4 submit\n+\t\tP4EDITOR=\"test-tool chmtime +5\" git p4 submit\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\n@@ -47,7 +47,7 @@ test_expect_success 'deleting with shell metachars' '\n \t\tgit rm foo\\$bar &&\n \t\tgit rm file\\ with\\ spaces &&\n \t\tgit commit -m \"remove files\" &&\n-\t\tP4EDITOR=\"test-chmtime +5\" git p4 submit\n+\t\tP4EDITOR=\"test-tool chmtime +5\" git p4 submit\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\ndiff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh\nindex bda222aa02..783c6ad165 100755\n--- a/t/t9813-git-p4-preserve-users.sh\n+++ b/t/t9813-git-p4-preserve-users.sh\n@@ -53,7 +53,7 @@ test_expect_success 'preserve users' '\n \t\tgit commit --author \"Alice <alice@example.com>\" -m \"a change by alice\" file1 &&\n \t\tgit commit --author \"Bob <bob@example.com>\" -m \"a change by bob\" file2 &&\n \t\tgit config git-p4.skipSubmitEditCheck true &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=alice P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=alice P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\tgit p4 commit --preserve-user &&\n \t\tp4_check_commit_author file1 alice &&\n@@ -71,7 +71,7 @@ test_expect_success 'refuse to preserve users without perms' '\n \t\tgit config git-p4.skipSubmitEditCheck true &&\n \t\techo \"username-noperms: a change by alice\" >>file1 &&\n \t\tgit commit --author \"Alice <alice@example.com>\" -m \"perms: a change by alice\" file1 &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=bob P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=bob P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\ttest_must_fail git p4 commit --preserve-user &&\n \t\t! git diff --exit-code HEAD..p4/master\n@@ -89,7 +89,7 @@ test_expect_success 'preserve user where author is unknown to p4' '\n \t\tgit commit --author \"Bob <bob@example.com>\" -m \"preserve: a change by bob\" file1 &&\n \t\techo \"username-unknown: a change by charlie\" >>file1 &&\n \t\tgit commit --author \"Charlie <charlie@example.com>\" -m \"preserve: a change by charlie\" file1 &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=alice P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=alice P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\ttest_must_fail git p4 commit --preserve-user &&\n \t\t! git diff --exit-code HEAD..p4/master &&\ndiff --git a/t/t9820-git-p4-editor-handling.sh b/t/t9820-git-p4-editor-handling.sh\nindex 6dc6df032e..3c22f74bd4 100755\n--- a/t/t9820-git-p4-editor-handling.sh\n+++ b/t/t9820-git-p4-editor-handling.sh\n@@ -26,7 +26,7 @@ test_expect_success 'EDITOR with options' '\n \t\tcd \"$git\" &&\n \t\techo change >file1 &&\n \t\tgit commit -m \"change\" file1 &&\n-\t\tP4EDITOR=\": >\\\"$git/touched\\\" && test-chmtime +5\" git p4 submit &&\n+\t\tP4EDITOR=\": >\\\"$git/touched\\\" && test-tool chmtime +5\" git p4 submit &&\n \t\ttest_path_is_file \"$git/touched\"\n \t)\n '\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7740d511d2..7ab8af47a5 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -963,10 +963,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\"/t/helper/test-tool\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 'You need to build test-tool:'\n+\techo >&2 'Run \"make t/helper/test-tool\" in the source (toplevel) directory'\n \texit 1\n fi\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342768","messageId":"20180324074505.19100-1-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180317075421.22032-1-pclouds@gmail.com","subject":"[PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:29Z","receivedAt":"2018-03-24T07:45:37Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"v2 fixes a couple of typos in commit messages and use the cmd__ prefix\nfor test commands instead of test_, which avoids a naming conflict\nwith the existing function test_lazy_init_name_hash\n\n[the previous v2 send out was aborted because I messed it up with some\nother patches]\n\nNguyễn Thái Ngọc Duy (36):\n  t/helper: add an empty test-tool program\n  t/helper: merge test-chmtime into test-tool\n  t/helper: merge test-sha1 into test-tool\n  t/helper: merge test-lazy-init-name-hash into test-tool\n  t/helper: merge test-config into test-tool\n  t/helper: merge test-ctype into test-tool\n  t/helper: merge test-date into test-tool\n  t/helper: merge (unused) test-delta into test-tool\n  t/helper: merge test-drop-caches into test-tool\n  t/helper: merge test-dump-cache-tree into test-tool\n  t/helper: merge test-dump-split-index into test-tool\n  t/helper: merge test-example-decorate into test-tool\n  t/helper: merge test-genrandom into test-tool\n  t/helper: merge test-hashmap into test-tool\n  t/helper: merge test-index-version into test-tool\n  t/helper: merge (unused) test-match-trees into test-tool\n  t/helper: merge (unused) test-mergesort into test-tool\n  t/helper: merge test-mktemp into test-tool\n  t/helper: merge test-online-cpus into test-tool\n  t/helper: merge test-path-utils into test-tool\n  t/helper: merge test-prio-queue into test-tool\n  t/helper: merge test-read-cache into test-tool\n  t/helper: merge test-ref-store into test-tool\n  t/helper: merge test-regex into test-tool\n  t/helper: merge test-revision-walking into test-tool\n  t/helper: merge test-run-command into test-tool\n  t/helper: merge test-scrap-cache-tree into test-tool\n  t/helper: merge test-sha1-array into test-tool\n  t/helper: merge test-sigchain into test-tool\n  t/helper: merge test-strcmp-offset into test-tool\n  t/helper: merge test-string-list into test-tool\n  t/helper: merge test-submodule-config into test-tool\n  t/helper: merge test-subprocess into test-tool\n  t/helper: merge test-urlmatch-normalization into test-tool\n  t/helper: merge test-wildmatch into test-tool\n  t/helper: merge test-write-cache into test-tool\n\n .../howto/recover-corrupted-object-harder.txt |   2 +-\n Makefile                                      |  79 +++---\n t/helper/test-chmtime.c                       |  15 +-\n t/helper/test-config.c                        |   5 +-\n t/helper/test-ctype.c                         |   3 +-\n t/helper/test-date.c                          |  17 +-\n t/helper/test-delta.c                         |   5 +-\n t/helper/test-drop-caches.c                   |   3 +-\n t/helper/test-dump-cache-tree.c               |   3 +-\n t/helper/test-dump-split-index.c              |   3 +-\n t/helper/test-example-decorate.c              |   3 +-\n t/helper/test-genrandom.c                     |   3 +-\n t/helper/test-hashmap.c                       |   5 +-\n t/helper/test-index-version.c                 |   3 +-\n t/helper/test-lazy-init-name-hash.c           |  13 +-\n t/helper/test-match-trees.c                   |   3 +-\n t/helper/test-mergesort.c                     |   3 +-\n t/helper/test-mktemp.c                        |   3 +-\n t/helper/test-online-cpus.c                   |   3 +-\n t/helper/test-path-utils.c                    |   3 +-\n t/helper/test-prio-queue.c                    |   3 +-\n t/helper/test-read-cache.c                    |   3 +-\n t/helper/test-ref-store.c                     |   3 +-\n t/helper/test-regex.c                         |   7 +-\n t/helper/test-revision-walking.c              |   3 +-\n t/helper/test-run-command.c                   |   3 +-\n t/helper/test-scrap-cache-tree.c              |   3 +-\n t/helper/test-sha1-array.c                    |   3 +-\n t/helper/test-sha1.c                          |   3 +-\n t/helper/test-sha1.sh                         |   4 +-\n t/helper/test-sigchain.c                      |   3 +-\n t/helper/test-strcmp-offset.c                 |   3 +-\n t/helper/test-string-list.c                   |   3 +-\n t/helper/test-submodule-config.c              |   3 +-\n t/helper/test-subprocess.c                    |   3 +-\n t/helper/test-tool.c                          |  62 ++++\n t/helper/test-tool.h                          |  40 +++\n t/helper/test-urlmatch-normalization.c        |   5 +-\n t/helper/test-wildmatch.c                     |   3 +-\n t/helper/test-write-cache.c                   |   3 +-\n t/lib-git-p4.sh                               |   2 +-\n t/lib-git-svn.sh                              |   2 +-\n t/lib-pack.sh                                 |   2 +-\n t/perf/p0002-read-cache.sh                    |   2 +-\n t/perf/p0004-lazy-init-name-hash.sh           |   8 +-\n t/perf/p0007-write-cache.sh                   |   2 +-\n t/perf/p0071-sort.sh                          |   2 +-\n t/perf/p7519-fsmonitor.sh                     |  12 +-\n t/t0005-signals.sh                            |   6 +-\n t/t0006-date.sh                               |   8 +-\n t/t0009-prio-queue.sh                         |   6 +-\n t/t0011-hashmap.sh                            |   4 +-\n t/t0013-sha1dc.sh                             |   2 +-\n t/t0021-conversion.sh                         |   4 +-\n t/t0060-path-utils.sh                         |  60 ++--\n t/t0061-run-command.sh                        |  24 +-\n t/t0062-revision-walking.sh                   |   2 +-\n t/t0063-string-list.sh                        |  48 ++--\n t/t0064-sha1-array.sh                         |  16 +-\n t/t0065-strcmp-offset.sh                      |   2 +-\n t/t0070-fundamental.sh                        |   8 +-\n t/t0090-cache-tree.sh                         |  18 +-\n t/t0110-urlmatch-normalization.sh             | 266 +++++++++---------\n t/t1006-cat-file.sh                           |   2 +-\n t/t1050-large.sh                              |   6 +-\n t/t1300-repo-config.sh                        |   2 +-\n t/t1305-config-include.sh                     |   2 +-\n t/t1308-config-set.sh                         |  22 +-\n t/t1309-early-config.sh                       |  12 +-\n t/t1405-main-ref-store.sh                     |   2 +-\n t/t1406-submodule-ref-store.sh                |   2 +-\n t/t1407-worktree-ref-store.sh                 |   4 +-\n t/t1501-work-tree.sh                          |  10 +-\n t/t1600-index.sh                              |   2 +-\n t/t1700-split-index.sh                        |  64 ++---\n t/t2022-checkout-paths.sh                     |   4 +-\n t/t2104-update-index-skip-worktree.sh         |   6 +-\n t/t3008-ls-files-lazy-init-name-hash.sh       |   4 +-\n t/t3070-wildmatch.sh                          |  14 +-\n t/t3306-notes-prune.sh                        |   2 +-\n t/t3404-rebase-interactive.sh                 |   4 +-\n t/t3418-rebase-continue.sh                    |   4 +-\n t/t3501-revert-cherry-pick.sh                 |   2 +-\n t/t3510-cherry-pick-sequence.sh               |   4 +-\n t/t3600-rm.sh                                 |   2 +-\n t/t3700-add.sh                                |   2 +-\n t/t4011-diff-symlink.sh                       |   2 +-\n t/t4013-diff-various.sh                       |   2 +-\n t/t4035-diff-quiet.sh                         |   2 +-\n t/t4151-am-abort.sh                           |   4 +-\n t/t4200-rerere.sh                             |  22 +-\n t/t5000-tar-tree.sh                           |   4 +-\n t/t5300-pack-object.sh                        |   4 +-\n t/t5301-sliding-window.sh                     |   2 +-\n t/t5302-pack-index.sh                         |  14 +-\n t/t5303-pack-corruption-resilience.sh         |  10 +-\n t/t5304-prune.sh                              |  16 +-\n t/t5310-pack-bitmaps.sh                       |   2 +-\n t/t5313-pack-bounds-checks.sh                 |   4 +-\n t/t5314-pack-cycle-detection.sh               |   2 +-\n t/t5316-pack-delta-depth.sh                   |   2 +-\n t/t5400-send-pack.sh                          |   2 +-\n t/t5516-fetch-push.sh                         |   2 +-\n t/t5546-receive-limits.sh                     |   2 +-\n t/t5547-push-quarantine.sh                    |   2 +-\n t/t5608-clone-2gb.sh                          |   2 +-\n t/t6022-merge-rename.sh                       |  30 +-\n t/t6500-gc.sh                                 |   2 +-\n t/t6501-freshen-objects.sh                    |   4 +-\n t/t7411-submodule-config.sh                   |  18 +-\n t/t7508-status.sh                             |   6 +-\n t/t7701-repack-unpack-unreachable.sh          |   6 +-\n t/t7812-grep-icase-non-ascii.sh               |   2 +-\n t/t9004-example.sh                            |   2 +-\n t/t9100-git-svn-basic.sh                      |   4 +-\n t/t9300-fast-import.sh                        |   2 +-\n t/t9802-git-p4-filetype.sh                    |   2 +-\n t/t9803-git-p4-shell-metachars.sh             |   4 +-\n t/t9813-git-p4-preserve-users.sh              |   6 +-\n t/t9820-git-p4-editor-handling.sh             |   2 +-\n t/test-lib.sh                                 |  10 +-\n 121 files changed, 684 insertions(+), 542 deletions(-)\n create mode 100644 t/helper/test-tool.c\n create mode 100644 t/helper/test-tool.h\n\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342769","messageId":"20180324074505.19100-2-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:30Z","receivedAt":"2018-03-24T07:45:39Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This will become an umbrella program that absorbs most [1] t/helper\nprograms in. By having a single executable binary we reduce disk usage\n(libgit.a is replicated by every t/helper program) and shorten link\ntime a bit.\n\nRunning \"make --jobs=1; du -sh t/helper\" with ccache fully populated,\nit takes 27 seconds and 277MB at the beginning of this series, 17\nseconds and 42MB at the end.\n\n[1] There are a couple programs that will not become part of\n    test-tool: test-line-buffer and test-svn-fe have extra\n    dependencies and test-fake-ssh's program name has to be a single\n    word for some ssh tests.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile             |  6 +++++-\n t/helper/test-tool.c | 27 +++++++++++++++++++++++++++\n t/helper/test-tool.h |  4 ++++\n 3 files changed, 36 insertions(+), 1 deletion(-)\n create mode 100644 t/helper/test-tool.c\n create mode 100644 t/helper/test-tool.h\n\ndiff --git a/Makefile b/Makefile\nindex a1d8775adb..2376646e98 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -546,6 +546,7 @@ SCRIPT_PERL =\n SCRIPT_PYTHON =\n SCRIPT_SH =\n SCRIPT_LIB =\n+TEST_BUILTINS_OBJS =\n TEST_PROGRAMS_NEED_X =\n \n # Having this variable in your environment would break pipelines because\n@@ -690,6 +691,7 @@ TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n+TEST_PROGRAMS_NEED_X += test-tool\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n TEST_PROGRAMS_NEED_X += test-wildmatch\n \n@@ -2083,7 +2085,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 %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n \t$(XDIFF_OBJS) \\\n \t$(VCSSVN_OBJS) \\\n@@ -2494,6 +2496,8 @@ t/helper/test-svn-fe$X: $(VCSSVN_LIB)\n \n .PRECIOUS: $(TEST_OBJS)\n \n+t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n+\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 \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nnew file mode 100644\nindex 0000000000..c730f718ca\n--- /dev/null\n+++ b/t/helper/test-tool.c\n@@ -0,0 +1,27 @@\n+#include \"git-compat-util.h\"\n+#include \"test-tool.h\"\n+\n+struct test_cmd {\n+\tconst char *name;\n+\tint (*main)(int argc, const char **argv);\n+};\n+\n+static struct test_cmd cmds[] = {\n+};\n+\n+int cmd_main(int argc, const char **argv)\n+{\n+\tint i;\n+\n+\tif (argc < 2)\n+\t\tdie(\"I need a test name!\");\n+\n+\tfor (i = 0; i < ARRAY_SIZE(cmds); i++) {\n+\t\tif (!strcmp(cmds[i].name, argv[1])) {\n+\t\t\targv++;\n+\t\t\targc--;\n+\t\t\treturn cmds[i].main(argc, argv);\n+\t\t}\n+\t}\n+\tdie(\"There is no test named '%s'\", argv[1]);\n+}\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nnew file mode 100644\nindex 0000000000..6ce57ae0cc\n--- /dev/null\n+++ b/t/helper/test-tool.h\n@@ -0,0 +1,4 @@\n+#ifndef __TEST_TOOL_H__\n+#define __TEST_TOOL_H__\n+\n+#endif\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342770","messageId":"20180324074505.19100-3-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 02/36] t/helper: merge test-chmtime into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:31Z","receivedAt":"2018-03-24T07:45:44Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                             |  3 ++-\n t/helper/test-chmtime.c              | 15 +++++++-------\n t/helper/test-tool.c                 |  1 +\n t/helper/test-tool.h                 |  2 ++\n t/lib-git-svn.sh                     |  2 +-\n t/t1700-split-index.sh               | 12 +++++------\n t/t2022-checkout-paths.sh            |  4 ++--\n t/t3306-notes-prune.sh               |  2 +-\n t/t3404-rebase-interactive.sh        |  4 ++--\n t/t3418-rebase-continue.sh           |  4 ++--\n t/t3501-revert-cherry-pick.sh        |  2 +-\n t/t3510-cherry-pick-sequence.sh      |  4 ++--\n t/t3600-rm.sh                        |  2 +-\n t/t3700-add.sh                       |  2 +-\n t/t4011-diff-symlink.sh              |  2 +-\n t/t4013-diff-various.sh              |  2 +-\n t/t4035-diff-quiet.sh                |  2 +-\n t/t4151-am-abort.sh                  |  4 ++--\n t/t4200-rerere.sh                    | 22 ++++++++++----------\n t/t5000-tar-tree.sh                  |  2 +-\n t/t5304-prune.sh                     | 16 +++++++--------\n t/t5400-send-pack.sh                 |  2 +-\n t/t5516-fetch-push.sh                |  2 +-\n t/t6022-merge-rename.sh              | 30 ++++++++++++++--------------\n t/t6500-gc.sh                        |  2 +-\n t/t6501-freshen-objects.sh           |  4 ++--\n t/t7508-status.sh                    |  6 +++---\n t/t7701-repack-unpack-unreachable.sh |  6 +++---\n t/t9100-git-svn-basic.sh             |  4 ++--\n t/t9803-git-p4-shell-metachars.sh    |  4 ++--\n t/t9813-git-p4-preserve-users.sh     |  6 +++---\n t/t9820-git-p4-editor-handling.sh    |  2 +-\n t/test-lib.sh                        |  6 +++---\n 33 files changed, 94 insertions(+), 89 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2376646e98..416a8e39c1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -652,7 +652,8 @@ X =\n \n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n-TEST_PROGRAMS_NEED_X += test-chmtime\n+TEST_BUILTINS_OBJS += test-chmtime.o\n+\n TEST_PROGRAMS_NEED_X += test-ctype\n TEST_PROGRAMS_NEED_X += test-config\n TEST_PROGRAMS_NEED_X += test-date\ndiff --git a/t/helper/test-chmtime.c b/t/helper/test-chmtime.c\nindex e760256406..1790ceab51 100644\n--- a/t/helper/test-chmtime.c\n+++ b/t/helper/test-chmtime.c\n@@ -5,28 +5,29 @@\n  *\n  * The mtime can be changed to an absolute value:\n  *\n- *\ttest-chmtime =<seconds> file...\n+ *\ttest-tool chmtime =<seconds> file...\n  *\n  * Relative to the current time as returned by time(3):\n  *\n- *\ttest-chmtime =+<seconds> (or =-<seconds>) file...\n+ *\ttest-tool chmtime =+<seconds> (or =-<seconds>) file...\n  *\n  * Or relative to the current mtime of the file:\n  *\n- *\ttest-chmtime <seconds> file...\n- *\ttest-chmtime +<seconds> (or -<seconds>) file...\n+ *\ttest-tool chmtime <seconds> file...\n+ *\ttest-tool chmtime +<seconds> (or -<seconds>) file...\n  *\n  * Examples:\n  *\n  * To just print the mtime use --verbose and set the file mtime offset to 0:\n  *\n- *\ttest-chmtime -v +0 file\n+ *\ttest-tool chmtime -v +0 file\n  *\n  * To set the mtime to current time:\n  *\n- *\ttest-chmtime =+0 file\n+ *\ttest-tool chmtime =+0 file\n  *\n  */\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include <utime.h>\n \n@@ -56,7 +57,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)\n \treturn 1;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__chmtime(int argc, const char **argv)\n {\n \tstatic int verbose;\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c730f718ca..63ec15cb56 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -7,6 +7,7 @@ struct test_cmd {\n };\n \n static struct test_cmd cmds[] = {\n+\t{ \"chmtime\", cmd__chmtime },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 6ce57ae0cc..3a35e70e79 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -1,4 +1,6 @@\n #ifndef __TEST_TOOL_H__\n #define __TEST_TOOL_H__\n \n+int cmd__chmtime(int argc, const char **argv);\n+\n #endif\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 4c1f81f167..a8130f9119 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -49,7 +49,7 @@ rawsvnrepo=\"$svnrepo\"\n svnrepo=\"file://$svnrepo\"\n \n poke() {\n-\ttest-chmtime +1 \"$1\"\n+\ttest-tool chmtime +1 \"$1\"\n }\n \n # We need this, because we should pass empty configuration directory to\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex a66936fe9b..4b5d443280 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -332,12 +332,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '\n \tgit update-index --add ten &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_under_2_weeks_ago=$((5-14*86400)) &&\n-\ttest-chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&\n \t: >eleven &&\n \tgit update-index --add eleven &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_over_2_weeks_ago=$((-1-14*86400)) &&\n-\ttest-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n \t: >twelve &&\n \tgit update-index --add twelve &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\n@@ -345,12 +345,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '\n \n test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '\n \tgit config splitIndex.sharedIndexExpire \"16.days.ago\" &&\n-\ttest-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&\n \t: >thirteen &&\n \tgit update-index --add thirteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tjust_over_16_days_ago=$((-1-16*86400)) &&\n-\ttest-chmtime =$just_over_16_days_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_over_16_days_ago .git/sharedindex.* &&\n \t: >fourteen &&\n \tgit update-index --add fourteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\n@@ -359,13 +359,13 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '\n test_expect_success 'check splitIndex.sharedIndexExpire set to \"never\" and \"now\"' '\n \tgit config splitIndex.sharedIndexExpire never &&\n \tjust_10_years_ago=$((-365*10*86400)) &&\n-\ttest-chmtime =$just_10_years_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_10_years_ago .git/sharedindex.* &&\n \t: >fifteen &&\n \tgit update-index --add fifteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -gt 2 &&\n \tgit config splitIndex.sharedIndexExpire now &&\n \tjust_1_second_ago=-1 &&\n-\ttest-chmtime =$just_1_second_ago .git/sharedindex.* &&\n+\ttest-tool chmtime =$just_1_second_ago .git/sharedindex.* &&\n \t: >sixteen &&\n \tgit update-index --add sixteen &&\n \ttest $(ls .git/sharedindex.* | wc -l) -le 2\ndiff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh\nindex f46d0499bc..e74d58b9e1 100755\n--- a/t/t2022-checkout-paths.sh\n+++ b/t/t2022-checkout-paths.sh\n@@ -68,13 +68,13 @@ test_expect_success 'do not touch files that are already up-to-date' '\n \tgit add file1 file2 &&\n \tgit commit -m base &&\n \techo modified >file1 &&\n-\ttest-chmtime =1000000000 file2 &&\n+\ttest-tool chmtime =1000000000 file2 &&\n \tgit update-index -q --refresh &&\n \tgit checkout HEAD -- file1 file2 &&\n \techo one >expect &&\n \ttest_cmp expect file1 &&\n \techo \"1000000000\tfile2\" >expect &&\n-\ttest-chmtime -v +0 file2 >actual &&\n+\ttest-tool chmtime -v +0 file2 >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh\nindex 86bf909ee3..61748088eb 100755\n--- a/t/t3306-notes-prune.sh\n+++ b/t/t3306-notes-prune.sh\n@@ -22,7 +22,7 @@ test_expect_success 'setup: create a few commits with notes' '\n \tgit commit -m 3rd &&\n \tCOMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&\n \ttest -f $COMMIT_FILE &&\n-\ttest-chmtime =+0 $COMMIT_FILE &&\n+\ttest-tool chmtime =+0 $COMMIT_FILE &&\n \tgit notes add -m \"Note #3\"\n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 3b905406df..961ac9d6b8 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -711,13 +711,13 @@ test_expect_success 'rebase -i continue with unstaged submodule' '\n test_expect_success 'avoid unnecessary reset' '\n \tgit checkout master &&\n \tgit reset --hard &&\n-\ttest-chmtime =123456789 file3 &&\n+\ttest-tool chmtime =123456789 file3 &&\n \tgit update-index --refresh &&\n \tHEAD=$(git rev-parse HEAD) &&\n \tset_fake_editor &&\n \tgit rebase -i HEAD~4 &&\n \ttest $HEAD = $(git rev-parse HEAD) &&\n-\tMTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&\n+\tMTIME=$(test-tool chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&\n \ttest 123456789 = $MTIME\n '\n \ndiff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh\nindex 7c91a85f43..9214d0bb51 100755\n--- a/t/t3418-rebase-continue.sh\n+++ b/t/t3418-rebase-continue.sh\n@@ -24,7 +24,7 @@ test_expect_success 'interactive rebase --continue works with touched file' '\n \tgit checkout master &&\n \n \tFAKE_LINES=\"edit 1\" git rebase -i HEAD^ &&\n-\ttest-chmtime =-60 F1 &&\n+\ttest-tool chmtime =-60 F1 &&\n \tgit rebase --continue\n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'non-interactive rebase --continue works with touched file'\n \ttest_must_fail git rebase --onto master master topic &&\n \techo \"Resolved\" >F2 &&\n \tgit add F2 &&\n-\ttest-chmtime =-60 F1 &&\n+\ttest-tool chmtime =-60 F1 &&\n \tgit rebase --continue\n '\n \ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 783bdbf59d..ccbc118514 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -86,7 +86,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '\n \t(\n \t\tcd copy &&\n \t\tgit checkout initial &&\n-\t\ttest-chmtime +40 oops &&\n+\t\ttest-tool chmtime +40 oops &&\n \t\tgit cherry-pick added\n \t)\n '\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 0acf4b1461..9f93445f1e 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -247,9 +247,9 @@ test_expect_success '--abort after last commit in sequence' '\n test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '\n \tpristine_detach initial &&\n \ttest_expect_code 1 git cherry-pick base..anotherpick &&\n-\ttest-chmtime -v +0 .git/sequencer >expect &&\n+\ttest-tool chmtime -v +0 .git/sequencer >expect &&\n \ttest_expect_code 128 git cherry-pick unrelatedpick &&\n-\ttest-chmtime -v +0 .git/sequencer >actual &&\n+\ttest-tool chmtime -v +0 .git/sequencer >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 46f15169f5..b8fbdefcdc 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -232,7 +232,7 @@ test_expect_success 'Call \"rm\" from outside the work tree' '\n test_expect_success 'refresh index before checking if it is up-to-date' '\n \n \tgit reset --hard &&\n-\ttest-chmtime -86400 frotz/nitfol &&\n+\ttest-tool chmtime -86400 frotz/nitfol &&\n \tgit rm frotz/nitfol &&\n \ttest ! -f frotz/nitfol\n \ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 2748805642..07af05d7ae 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -187,7 +187,7 @@ test_expect_success 'git add --refresh with pathspec' '\n \techo >foo && echo >bar && echo >baz &&\n \tgit add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo &&\n \techo \"100644 $H 3\tfoo\" | git update-index --index-info &&\n-\ttest-chmtime -60 bar baz &&\n+\ttest-tool chmtime -60 bar baz &&\n \t>expect &&\n \tgit add --refresh bar >actual &&\n \ttest_cmp expect actual &&\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 13e7f621ab..cf0f3a1ee7 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -73,7 +73,7 @@ test_expect_success 'diff identical, but newly created symlink and file' '\n \t>expected &&\n \trm -f frotz nitfol &&\n \techo xyzzy >nitfol &&\n-\ttest-chmtime +10 nitfol &&\n+\ttest-tool chmtime +10 nitfol &&\n \tif test_have_prereq SYMLINKS\n \tthen\n \t\tln -s xyzzy frotz\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 3f9a24fd56..f8d853595b 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -76,7 +76,7 @@ test_expect_success setup '\n \n \tmkdir dir3 &&\n \tcp dir/sub dir3/sub &&\n-\ttest-chmtime +1 dir3/sub &&\n+\ttest-tool chmtime +1 dir3/sub &&\n \n \tgit config log.showroot false &&\n \tgit commit --amend &&\ndiff --git a/t/t4035-diff-quiet.sh b/t/t4035-diff-quiet.sh\nindex 2f1737fcef..0352bf81a9 100755\n--- a/t/t4035-diff-quiet.sh\n+++ b/t/t4035-diff-quiet.sh\n@@ -147,7 +147,7 @@ test_expect_success 'git diff --ignore-all-space, both files outside repo' '\n '\n \n test_expect_success 'git diff --quiet ignores stat-change only entries' '\n-\ttest-chmtime +10 a &&\n+\ttest-tool chmtime +10 a &&\n \techo modified >>b &&\n \ttest_expect_code 1 git diff --quiet\n '\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex 16432781d2..9d8d3c72e7 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -171,7 +171,7 @@ test_expect_success 'am --skip leaves index stat info alone' '\n \tgit checkout -f --orphan skip-stat-info &&\n \tgit reset &&\n \ttest_commit skip-should-be-untouched &&\n-\ttest-chmtime =0 skip-should-be-untouched.t &&\n+\ttest-tool chmtime =0 skip-should-be-untouched.t &&\n \tgit update-index --refresh &&\n \tgit diff-files --exit-code --quiet &&\n \ttest_must_fail git am 0001-*.patch &&\n@@ -183,7 +183,7 @@ test_expect_success 'am --abort leaves index stat info alone' '\n \tgit checkout -f --orphan abort-stat-info &&\n \tgit reset &&\n \ttest_commit abort-should-be-untouched &&\n-\ttest-chmtime =0 abort-should-be-untouched.t &&\n+\ttest-tool chmtime =0 abort-should-be-untouched.t &&\n \tgit update-index --refresh &&\n \tgit diff-files --exit-code --quiet &&\n \ttest_must_fail git am 0001-*.patch &&\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex d97d2bebc9..deafaa3e07 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -166,7 +166,7 @@ test_expect_success 'first postimage wins' '\n \tgit commit -q -a -m \"prefer first over second\" &&\n \ttest -f $rr/postimage &&\n \n-\toldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) &&\n+\toldmtimepost=$(test-tool chmtime -v -60 $rr/postimage | cut -f 1) &&\n \n \tgit checkout -b third master &&\n \tgit show second^:a1 | sed \"s/To die: t/To die! T/\" >a1 &&\n@@ -179,7 +179,7 @@ test_expect_success 'first postimage wins' '\n '\n \n test_expect_success 'rerere updates postimage timestamp' '\n-\tnewmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) &&\n+\tnewmtimepost=$(test-tool chmtime -v +0 $rr/postimage | cut -f 1) &&\n \ttest $oldmtimepost -lt $newmtimepost\n '\n \n@@ -220,9 +220,9 @@ test_expect_success 'set up for garbage collection tests' '\n \talmost_60_days_ago=$((60-60*86400)) &&\n \tjust_over_60_days_ago=$((-1-60*86400)) &&\n \n-\ttest-chmtime =$just_over_60_days_ago $rr/preimage &&\n-\ttest-chmtime =$almost_60_days_ago $rr/postimage &&\n-\ttest-chmtime =$almost_15_days_ago $rr2/preimage\n+\ttest-tool chmtime =$just_over_60_days_ago $rr/preimage &&\n+\ttest-tool chmtime =$almost_60_days_ago $rr/postimage &&\n+\ttest-tool chmtime =$almost_15_days_ago $rr2/preimage\n '\n \n test_expect_success 'gc preserves young or recently used records' '\n@@ -232,8 +232,8 @@ test_expect_success 'gc preserves young or recently used records' '\n '\n \n test_expect_success 'old records rest in peace' '\n-\ttest-chmtime =$just_over_60_days_ago $rr/postimage &&\n-\ttest-chmtime =$just_over_15_days_ago $rr2/preimage &&\n+\ttest-tool chmtime =$just_over_60_days_ago $rr/postimage &&\n+\ttest-tool chmtime =$just_over_15_days_ago $rr2/preimage &&\n \tgit rerere gc &&\n \t! test -f $rr/preimage &&\n \t! test -f $rr2/preimage\n@@ -249,8 +249,8 @@ rerere_gc_custom_expiry_test () {\n \t\t>\"$rr/postimage\" &&\n \n \t\ttwo_days_ago=$((-2*86400)) &&\n-\t\ttest-chmtime =$two_days_ago \"$rr/preimage\" &&\n-\t\ttest-chmtime =$two_days_ago \"$rr/postimage\" &&\n+\t\ttest-tool chmtime =$two_days_ago \"$rr/preimage\" &&\n+\t\ttest-tool chmtime =$two_days_ago \"$rr/postimage\" &&\n \n \t\tfind .git/rr-cache -type f | sort >original &&\n \n@@ -512,7 +512,7 @@ test_expect_success 'multiple identical conflicts' '\n \tcount_pre_post 2 0 &&\n \n \t# Pretend that the conflicts were made quite some time ago\n-\tfind .git/rr-cache/ -type f | xargs test-chmtime -172800 &&\n+\tfind .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&\n \n \t# Unresolved entries have not expired yet\n \tgit -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&\n@@ -568,7 +568,7 @@ test_expect_success 'multiple identical conflicts' '\n \tgit rerere &&\n \n \t# Pretend that the resolutions are old again\n-\tfind .git/rr-cache/ -type f | xargs test-chmtime -172800 &&\n+\tfind .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&\n \n \t# Resolved entries have not expired yet\n \tgit -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex fe2d4f15a7..266d052efb 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -192,7 +192,7 @@ test_expect_success \\\n     'validate file modification time' \\\n     'mkdir extract &&\n      \"$TAR\" xf b.tar -C extract a/a &&\n-     test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&\n+     test-tool chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&\n      echo \"1117231200\" >expected.mtime &&\n      test_cmp expected.mtime b.mtime'\n \ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 6694c19a1e..f0f6e2a5f3 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -15,7 +15,7 @@ add_blob() {\n \tBLOB_FILE=.git/objects/$(echo $BLOB | sed \"s/^../&\\//\") &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =+0 $BLOB_FILE\n+\ttest-tool chmtime =+0 $BLOB_FILE\n }\n \n test_expect_success setup '\n@@ -33,7 +33,7 @@ test_expect_success 'prune stale packs' '\n \torig_pack=$(echo .git/objects/pack/*.pack) &&\n \t: > .git/objects/tmp_1.pack &&\n \t: > .git/objects/tmp_2.pack &&\n-\ttest-chmtime =-86501 .git/objects/tmp_1.pack &&\n+\ttest-tool chmtime =-86501 .git/objects/tmp_1.pack &&\n \tgit prune --expire 1.day &&\n \ttest_path_is_file $orig_pack &&\n \ttest_path_is_file .git/objects/tmp_2.pack &&\n@@ -47,7 +47,7 @@ test_expect_success 'prune --expire' '\n \tgit prune --expire=1.hour.ago &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =-86500 $BLOB_FILE &&\n+\ttest-tool chmtime =-86500 $BLOB_FILE &&\n \tgit prune --expire 1.day &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n@@ -57,11 +57,11 @@ test_expect_success 'prune --expire' '\n test_expect_success 'gc: implicit prune --expire' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((2*$week-30)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&\n \tgit gc &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE &&\n-\ttest-chmtime =-$((2*$week+1)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&\n \tgit gc &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n@@ -141,7 +141,7 @@ test_expect_success 'prune: do not prune heads listed as an argument' '\n test_expect_success 'gc --no-prune' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((5001*$day)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc --no-prune &&\n \tverbose test 1 = $(git count-objects | sed \"s/ .*//\") &&\n@@ -163,7 +163,7 @@ test_expect_success 'gc respects gc.pruneExpire' '\n test_expect_success 'gc --prune=<date>' '\n \n \tadd_blob &&\n-\ttest-chmtime =-$((5001*$day)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit gc --prune=5002.days.ago &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=5000.days.ago &&\n@@ -205,7 +205,7 @@ test_expect_success 'prune --expire=never' '\n \n test_expect_success 'gc: prune old objects after local clone' '\n \tadd_blob &&\n-\ttest-chmtime =-$((2*$week+1)) $BLOB_FILE &&\n+\ttest-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&\n \tgit clone --no-hardlinks . aclone &&\n \t(\n \t\tcd aclone &&\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex d375d7110d..911eae1bf7 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -180,7 +180,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n \t    # And create a file that follows the temporary object naming\n \t    # convention for the auto-gc to remove\n \t    : >.git/objects/tmp_test_object &&\n-\t    test-chmtime =-1209601 .git/objects/tmp_test_object\n+\t    test-tool chmtime =-1209601 .git/objects/tmp_test_object\n \t) &&\n \t(\n \t    cd parent &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 177897ea0b..82239138d5 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -1418,7 +1418,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '\n \t\tcd testrepo &&\n \t\tgit reset --hard HEAD^ &&\n \t\ttest $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&\n-\t\ttest-chmtime +100 path1\n+\t\ttest-tool chmtime +100 path1\n \t) &&\n \tgit push testrepo master &&\n \t(\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex c01f721f13..a1fad6980b 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -635,10 +635,10 @@ test_expect_success 'setup avoid unnecessary update, normal rename' '\n \n test_expect_success 'avoid unnecessary update, normal rename' '\n \tgit checkout -q avoid-unnecessary-update-1^0 &&\n-\ttest-chmtime =1000000000 rename &&\n-\ttest-chmtime -v +0 rename >expect &&\n+\ttest-tool chmtime =1000000000 rename &&\n+\ttest-tool chmtime -v +0 rename >expect &&\n \tgit merge merge-branch-1 &&\n-\ttest-chmtime -v +0 rename >actual &&\n+\ttest-tool chmtime -v +0 rename >actual &&\n \ttest_cmp expect actual # \"rename\" should have stayed intact\n '\n \n@@ -668,10 +668,10 @@ test_expect_success 'setup to test avoiding unnecessary update, with D/F conflic\n \n test_expect_success 'avoid unnecessary update, with D/F conflict' '\n \tgit checkout -q avoid-unnecessary-update-2^0 &&\n-\ttest-chmtime =1000000000 df &&\n-\ttest-chmtime -v +0 df >expect &&\n+\ttest-tool chmtime =1000000000 df &&\n+\ttest-tool chmtime -v +0 df >expect &&\n \tgit merge merge-branch-2 &&\n-\ttest-chmtime -v +0 df >actual &&\n+\ttest-tool chmtime -v +0 df >actual &&\n \ttest_cmp expect actual # \"df\" should have stayed intact\n '\n \n@@ -700,10 +700,10 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '\n \n test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 df &&\n-\ttest-chmtime -v +0 df >expect &&\n+\ttest-tool chmtime =1000000000 df &&\n+\ttest-tool chmtime -v +0 df >expect &&\n \tgit merge side &&\n-\ttest-chmtime -v +0 df >actual &&\n+\ttest-tool chmtime -v +0 df >actual &&\n \ttest_cmp expect actual # \"df\" should have stayed intact\n '\n \n@@ -730,10 +730,10 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '\n \n test_expect_success 'avoid unnecessary update, modify/delete' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 file &&\n-\ttest-chmtime -v +0 file >expect &&\n+\ttest-tool chmtime =1000000000 file &&\n+\ttest-tool chmtime -v +0 file >expect &&\n \ttest_must_fail git merge side &&\n-\ttest-chmtime -v +0 file >actual &&\n+\ttest-tool chmtime -v +0 file >actual &&\n \ttest_cmp expect actual # \"file\" should have stayed intact\n '\n \n@@ -759,10 +759,10 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '\n \n test_expect_success 'avoid unnecessary update, rename/add-dest' '\n \tgit checkout -q master^0 &&\n-\ttest-chmtime =1000000000 newfile &&\n-\ttest-chmtime -v +0 newfile >expect &&\n+\ttest-tool chmtime =1000000000 newfile &&\n+\ttest-tool chmtime -v +0 newfile >expect &&\n \tgit merge side &&\n-\ttest-chmtime -v +0 newfile >actual &&\n+\ttest-tool chmtime -v +0 newfile >actual &&\n \ttest_cmp expect actual # \"file\" should have stayed intact\n '\n \ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 41b0be575d..d5255dd576 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -87,7 +87,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re\n \ttest_must_fail git gc --auto 2>err &&\n \ttest_i18ngrep \"^error:\" err &&\n \ttest_config gc.logexpiry 5.days &&\n-\ttest-chmtime =-345600 .git/gc.log &&\n+\ttest-tool chmtime =-345600 .git/gc.log &&\n \ttest_must_fail git gc --auto &&\n \ttest_config gc.logexpiry 2.days &&\n \trun_and_wait_for_auto_gc &&\ndiff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh\nindex 394b169ead..765cced60b 100755\n--- a/t/t6501-freshen-objects.sh\n+++ b/t/t6501-freshen-objects.sh\n@@ -73,7 +73,7 @@ for repack in '' true; do\n \n \ttest_expect_success \"simulate time passing ($title)\" '\n \t\tfind .git/objects -type f |\n-\t\txargs test-chmtime -v -86400\n+\t\txargs test-tool chmtime -v -86400\n \t'\n \n \ttest_expect_success \"start writing new commit with old blob ($title)\" '\n@@ -104,7 +104,7 @@ for repack in '' true; do\n \ttest_expect_success \"abandon objects again ($title)\" '\n \t\tgit reset --hard HEAD^ &&\n \t\tfind .git/objects -type f |\n-\t\txargs test-chmtime -v -86400\n+\t\txargs test-tool chmtime -v -86400\n \t'\n \n \ttest_expect_success \"start writing new commit with same tree ($title)\" '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 50052e2872..7afadb175a 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1672,12 +1672,12 @@ test_expect_success '\"Initial commit\" should not be noted in commit template' '\n '\n \n test_expect_success '--no-optional-locks prevents index update' '\n-\ttest-chmtime =1234567890 .git/index &&\n+\ttest-tool chmtime =1234567890 .git/index &&\n \tgit --no-optional-locks status &&\n-\ttest-chmtime -v +0 .git/index >out &&\n+\ttest-tool chmtime -v +0 .git/index >out &&\n \tgrep ^1234567890 out &&\n \tgit status &&\n-\ttest-chmtime -v +0 .git/index >out &&\n+\ttest-tool chmtime -v +0 .git/index >out &&\n \t! grep ^1234567890 out\n '\n \ndiff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh\nindex 987573c41f..8a586ab021 100755\n--- a/t/t7701-repack-unpack-unreachable.sh\n+++ b/t/t7701-repack-unpack-unreachable.sh\n@@ -90,7 +90,7 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '\n \ttmppack=\".git/objects/pack/tmp_pack\" &&\n \tln \"$packfile\" \"$tmppack\" &&\n \tgit repack -A -l -d &&\n-\ttest-chmtime -v +0 \"$tmppack\" \"$fsha1path\" \"$csha1path\" \"$tsha1path\" \\\n+\ttest-tool chmtime -v +0 \"$tmppack\" \"$fsha1path\" \"$csha1path\" \"$tsha1path\" \\\n \t\t> mtimes &&\n \tcompare_mtimes < mtimes\n '\n@@ -103,7 +103,7 @@ test_expect_success 'do not bother loosening old objects' '\n \tgit prune-packed &&\n \tgit cat-file -p $obj1 &&\n \tgit cat-file -p $obj2 &&\n-\ttest-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&\n+\ttest-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&\n \tgit repack -A -d --unpack-unreachable=1.hour.ago &&\n \tgit cat-file -p $obj1 &&\n \ttest_must_fail git cat-file -p $obj2\n@@ -117,7 +117,7 @@ test_expect_success 'keep packed objects found only in index' '\n \tgit reset HEAD^ &&\n \tgit reflog expire --expire=now --all &&\n \tgit add file &&\n-\ttest-chmtime =-86400 .git/objects/pack/* &&\n+\ttest-tool chmtime =-86400 .git/objects/pack/* &&\n \tgit gc --prune=1.hour.ago &&\n \tgit cat-file blob :file\n '\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 8a8ba65a2a..c937330a5f 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -288,12 +288,12 @@ test_expect_success 'able to dcommit to a subdirectory' '\n \n test_expect_success 'dcommit should not fail with a touched file' '\n \ttest_commit \"commit-new-file-foo2\" foo2 &&\n-\ttest-chmtime =-60 foo &&\n+\ttest-tool chmtime =-60 foo &&\n \tgit svn dcommit\n '\n \n test_expect_success 'rebase should not fail with a touched file' '\n-\ttest-chmtime =-60 foo &&\n+\ttest-tool chmtime =-60 foo &&\n \tgit svn rebase\n '\n \ndiff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh\nindex d950c7d665..d5c3675100 100755\n--- a/t/t9803-git-p4-shell-metachars.sh\n+++ b/t/t9803-git-p4-shell-metachars.sh\n@@ -28,7 +28,7 @@ test_expect_success 'shell metachars in filenames' '\n \t\techo f2 >\"file with spaces\" &&\n \t\tgit add \"file with spaces\" &&\n \t\tgit commit -m \"add files\" &&\n-\t\tP4EDITOR=\"test-chmtime +5\" git p4 submit\n+\t\tP4EDITOR=\"test-tool chmtime +5\" git p4 submit\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\n@@ -47,7 +47,7 @@ test_expect_success 'deleting with shell metachars' '\n \t\tgit rm foo\\$bar &&\n \t\tgit rm file\\ with\\ spaces &&\n \t\tgit commit -m \"remove files\" &&\n-\t\tP4EDITOR=\"test-chmtime +5\" git p4 submit\n+\t\tP4EDITOR=\"test-tool chmtime +5\" git p4 submit\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\ndiff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh\nindex bda222aa02..783c6ad165 100755\n--- a/t/t9813-git-p4-preserve-users.sh\n+++ b/t/t9813-git-p4-preserve-users.sh\n@@ -53,7 +53,7 @@ test_expect_success 'preserve users' '\n \t\tgit commit --author \"Alice <alice@example.com>\" -m \"a change by alice\" file1 &&\n \t\tgit commit --author \"Bob <bob@example.com>\" -m \"a change by bob\" file2 &&\n \t\tgit config git-p4.skipSubmitEditCheck true &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=alice P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=alice P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\tgit p4 commit --preserve-user &&\n \t\tp4_check_commit_author file1 alice &&\n@@ -71,7 +71,7 @@ test_expect_success 'refuse to preserve users without perms' '\n \t\tgit config git-p4.skipSubmitEditCheck true &&\n \t\techo \"username-noperms: a change by alice\" >>file1 &&\n \t\tgit commit --author \"Alice <alice@example.com>\" -m \"perms: a change by alice\" file1 &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=bob P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=bob P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\ttest_must_fail git p4 commit --preserve-user &&\n \t\t! git diff --exit-code HEAD..p4/master\n@@ -89,7 +89,7 @@ test_expect_success 'preserve user where author is unknown to p4' '\n \t\tgit commit --author \"Bob <bob@example.com>\" -m \"preserve: a change by bob\" file1 &&\n \t\techo \"username-unknown: a change by charlie\" >>file1 &&\n \t\tgit commit --author \"Charlie <charlie@example.com>\" -m \"preserve: a change by charlie\" file1 &&\n-\t\tP4EDITOR=\"test-chmtime +5\" P4USER=alice P4PASSWD=secret &&\n+\t\tP4EDITOR=\"test-tool chmtime +5\" P4USER=alice P4PASSWD=secret &&\n \t\texport P4EDITOR P4USER P4PASSWD &&\n \t\ttest_must_fail git p4 commit --preserve-user &&\n \t\t! git diff --exit-code HEAD..p4/master &&\ndiff --git a/t/t9820-git-p4-editor-handling.sh b/t/t9820-git-p4-editor-handling.sh\nindex 6dc6df032e..3c22f74bd4 100755\n--- a/t/t9820-git-p4-editor-handling.sh\n+++ b/t/t9820-git-p4-editor-handling.sh\n@@ -26,7 +26,7 @@ test_expect_success 'EDITOR with options' '\n \t\tcd \"$git\" &&\n \t\techo change >file1 &&\n \t\tgit commit -m \"change\" file1 &&\n-\t\tP4EDITOR=\": >\\\"$git/touched\\\" && test-chmtime +5\" git p4 submit &&\n+\t\tP4EDITOR=\": >\\\"$git/touched\\\" && test-tool chmtime +5\" git p4 submit &&\n \t\ttest_path_is_file \"$git/touched\"\n \t)\n '\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7740d511d2..7ab8af47a5 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -963,10 +963,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\"/t/helper/test-tool\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 'You need to build test-tool:'\n+\techo >&2 'Run \"make t/helper/test-tool\" in the source (toplevel) directory'\n \texit 1\n fi\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342771","messageId":"20180324074505.19100-7-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 06/36] t/helper: merge test-ctype into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:35Z","receivedAt":"2018-03-24T07:45:45Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               | 2 +-\n t/helper/test-ctype.c  | 3 ++-\n t/helper/test-tool.c   | 1 +\n t/helper/test-tool.h   | 1 +\n t/t0070-fundamental.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 227f16ad17..d09710dc3d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -654,10 +654,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n+TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \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-drop-caches\ndiff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c\nindex bb72c47df5..92c4c2313e 100644\n--- a/t/helper/test-ctype.c\n+++ b/t/helper/test-ctype.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n static int rc;\n@@ -28,7 +29,7 @@ static int is_in(const char *s, int ch)\n #define LOWER \"abcdefghijklmnopqrstuvwxyz\"\n #define UPPER \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__ctype(int argc, const char **argv)\n {\n \tTEST_CLASS(isdigit, DIGIT);\n \tTEST_CLASS(isspace, \" \\n\\r\\t\");\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex e8d6c6b9eb..d600a31935 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -9,6 +9,7 @@ struct test_cmd {\n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n \t{ \"config\", cmd__config },\n+\t{ \"ctype\", cmd__ctype },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 3084f458a0..41805ecd1c 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -3,6 +3,7 @@\n \n int cmd__chmtime(int argc, const char **argv);\n int cmd__config(int argc, const char **argv);\n+int cmd__ctype(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex 991ed2a48d..70d4d98a2e 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -9,7 +9,7 @@ Verify wrappers and compatibility functions.\n . ./test-lib.sh\n \n test_expect_success 'character classes (isspace, isalpha etc.)' '\n-\ttest-ctype\n+\ttest-tool ctype\n '\n \n test_expect_success 'mktemp to nonexistent directory prints filename' '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342772","messageId":"20180324074505.19100-9-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 08/36] t/helper: merge (unused) test-delta into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:37Z","receivedAt":"2018-03-24T07:45:49Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile              | 2 +-\n t/helper/test-delta.c | 5 +++--\n t/helper/test-tool.c  | 1 +\n t/helper/test-tool.h  | 1 +\n 4 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex efb1872c52..327d63217a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -656,10 +656,10 @@ TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-date.o\n+TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\ndiff --git a/t/helper/test-delta.c b/t/helper/test-delta.c\nindex 591730adc4..34c7259248 100644\n--- a/t/helper/test-delta.c\n+++ b/t/helper/test-delta.c\n@@ -8,14 +8,15 @@\n  * published by the Free Software Foundation.\n  */\n \n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"delta.h\"\n #include \"cache.h\"\n \n static const char usage_str[] =\n-\t\"test-delta (-d|-p) <from_file> <data_file> <out_file>\";\n+\t\"test-tool delta (-d|-p) <from_file> <data_file> <out_file>\";\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__delta(int argc, const char **argv)\n {\n \tint fd;\n \tstruct stat st;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex e92f93ac3b..6bef386842 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -11,6 +11,7 @@ static struct test_cmd cmds[] = {\n \t{ \"config\", cmd__config },\n \t{ \"ctype\", cmd__ctype },\n \t{ \"date\", cmd__date },\n+\t{ \"delta\", cmd__delta },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 31c20bb656..761705e110 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -5,6 +5,7 @@ int cmd__chmtime(int argc, const char **argv);\n int cmd__config(int argc, const char **argv);\n int cmd__ctype(int argc, const char **argv);\n int cmd__date(int argc, const char **argv);\n+int cmd__delta(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342773","messageId":"20180324074505.19100-8-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 07/36] t/helper: merge test-date into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:36Z","receivedAt":"2018-03-24T07:45:51Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               |  2 +-\n t/helper/test-date.c   | 17 +++++++++--------\n t/helper/test-tool.c   |  1 +\n t/helper/test-tool.h   |  1 +\n t/t0006-date.sh        |  8 ++++----\n t/t1300-repo-config.sh |  2 +-\n t/test-lib.sh          |  4 ++--\n 7 files changed, 19 insertions(+), 16 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d09710dc3d..efb1872c52 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -655,10 +655,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n TEST_BUILTINS_OBJS += test-chmtime.o\n TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n+TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-date\n TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\ndiff --git a/t/helper/test-date.c b/t/helper/test-date.c\nindex ac83687970..a0837371ab 100644\n--- a/t/helper/test-date.c\n+++ b/t/helper/test-date.c\n@@ -1,13 +1,14 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n static const char *usage_msg = \"\\n\"\n-\"  test-date relative [time_t]...\\n\"\n-\"  test-date show:<format> [time_t]...\\n\"\n-\"  test-date parse [date]...\\n\"\n-\"  test-date approxidate [date]...\\n\"\n-\"  test-date timestamp [date]...\\n\"\n-\"  test-date is64bit\\n\"\n-\"  test-date time_t-is64bit\\n\";\n+\"  test-tool date relative [time_t]...\\n\"\n+\"  test-tool date show:<format> [time_t]...\\n\"\n+\"  test-tool date parse [date]...\\n\"\n+\"  test-tool date approxidate [date]...\\n\"\n+\"  test-tool date timestamp [date]...\\n\"\n+\"  test-tool date is64bit\\n\"\n+\"  test-tool date time_t-is64bit\\n\";\n \n static void show_relative_dates(const char **argv, struct timeval *now)\n {\n@@ -81,7 +82,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__date(int argc, const char **argv)\n {\n \tstruct timeval now;\n \tconst char *x;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex d600a31935..e92f93ac3b 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -10,6 +10,7 @@ static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n \t{ \"config\", cmd__config },\n \t{ \"ctype\", cmd__ctype },\n+\t{ \"date\", cmd__date },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 41805ecd1c..31c20bb656 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -4,6 +4,7 @@\n int cmd__chmtime(int argc, const char **argv);\n int cmd__config(int argc, const char **argv);\n int cmd__ctype(int argc, const char **argv);\n+int cmd__date(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 7ac9466d50..64ff86df8e 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -10,7 +10,7 @@ check_relative() {\n \tt=$(($TEST_DATE_NOW - $1))\n \techo \"$t -> $2\" >expect\n \ttest_expect_${3:-success} \"relative date ($2)\" \"\n-\ttest-date relative $t >actual &&\n+\ttest-tool date relative $t >actual &&\n \ttest_i18ncmp expect actual\n \t\"\n }\n@@ -35,7 +35,7 @@ check_show () {\n \tzone=$5\n \ttest_expect_success $prereqs \"show date ($format:$time)\" '\n \t\techo \"$time -> $expect\" >expect &&\n-\t\tTZ=${zone:-$TZ} test-date show:\"$format\" \"$time\" >actual &&\n+\t\tTZ=${zone:-$TZ} test-tool date show:\"$format\" \"$time\" >actual &&\n \t\ttest_cmp expect actual\n \t'\n }\n@@ -71,7 +71,7 @@ check_show iso-local \"$FUTURE\" \"2152-06-19 22:24:56 +0000\" TIME_IS_64BIT,TIME_T_\n check_parse() {\n \techo \"$1 -> $2\" >expect\n \ttest_expect_${4:-success} \"parse date ($1${3:+ TZ=$3})\" \"\n-\tTZ=${3:-$TZ} test-date parse '$1' >actual &&\n+\tTZ=${3:-$TZ} test-tool date parse '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n }\n@@ -92,7 +92,7 @@ check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST5\n check_approxidate() {\n \techo \"$1 -> $2 +0000\" >expect\n \ttest_expect_${3:-success} \"parse approxidate ($1)\" \"\n-\ttest-date approxidate '$1' >actual &&\n+\ttest-tool date approxidate '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n }\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 4f8e6f5fde..8780934478 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -914,7 +914,7 @@ test_expect_success 'get --expiry-date' '\n \tinvalid1 = \"abc\"\n \tEOF\n \tcat >expect <<-EOF &&\n-\t$(test-date timestamp $rel)\n+\t$(test-tool date timestamp $rel)\n \t1275666415\n \t1510441871\n \t1510348087\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7ab8af47a5..483c8d6d7c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1206,5 +1206,5 @@ test_lazy_prereq LONG_IS_64BIT '\n \ttest 8 -le \"$(build_option sizeof-long)\"\n '\n \n-test_lazy_prereq TIME_IS_64BIT 'test-date is64bit'\n-test_lazy_prereq TIME_T_IS_64BIT 'test-date time_t-is64bit'\n+test_lazy_prereq TIME_IS_64BIT 'test-tool date is64bit'\n+test_lazy_prereq TIME_T_IS_64BIT 'test-tool date time_t-is64bit'\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342774","messageId":"20180324074505.19100-10-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 09/36] t/helper: merge test-drop-caches into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:38Z","receivedAt":"2018-03-24T07:45:53Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    |  2 +-\n t/helper/test-drop-caches.c |  3 ++-\n t/helper/test-tool.c        |  1 +\n t/helper/test-tool.h        |  1 +\n t/perf/p7519-fsmonitor.sh   | 12 ++++++------\n 5 files changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 327d63217a..edd9c43982 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -657,10 +657,10 @@ TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n+TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-drop-caches\n TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-split-index\ndiff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\nindex bd1a857d52..838760898b 100644\n--- a/t/helper/test-drop-caches.c\n+++ b/t/helper/test-drop-caches.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n \n #if defined(GIT_WINDOWS_NATIVE)\n@@ -157,7 +158,7 @@ static int cmd_dropcaches(void)\n \n #endif\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__drop_caches(int argc, const char **argv)\n {\n \tcmd_sync();\n \treturn cmd_dropcaches();\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 6bef386842..b6f648d387 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -12,6 +12,7 @@ static struct test_cmd cmds[] = {\n \t{ \"ctype\", cmd__ctype },\n \t{ \"date\", cmd__date },\n \t{ \"delta\", cmd__delta },\n+\t{ \"drop-caches\", cmd__drop_caches },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 761705e110..f585b7776e 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -6,6 +6,7 @@ int cmd__config(int argc, const char **argv);\n int cmd__ctype(int argc, const char **argv);\n int cmd__date(int argc, const char **argv);\n int cmd__delta(int argc, const char **argv);\n+int cmd__drop_caches(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh\nindex 65e145c02d..def7ecdbc7 100755\n--- a/t/perf/p7519-fsmonitor.sh\n+++ b/t/perf/p7519-fsmonitor.sh\n@@ -118,7 +118,7 @@ test_expect_success \"setup for fsmonitor\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -126,7 +126,7 @@ test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -134,7 +134,7 @@ test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uall (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -148,7 +148,7 @@ test_expect_success \"setup without fsmonitor\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -156,7 +156,7 @@ test_perf \"status (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n@@ -164,7 +164,7 @@ test_perf \"status -uno (fsmonitor=$INTEGRATION_SCRIPT)\" '\n '\n \n if test -n \"$GIT_PERF_7519_DROP_CACHE\"; then\n-\ttest-drop-caches\n+\ttest-tool drop-caches\n fi\n \n test_perf \"status -uall (fsmonitor=$INTEGRATION_SCRIPT)\" '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342775","messageId":"20180324074505.19100-14-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 13/36] t/helper: merge test-genrandom into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:42Z","receivedAt":"2018-03-24T07:45:56Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                              |  2 +-\n t/helper/test-genrandom.c             |  3 ++-\n t/helper/test-tool.c                  |  1 +\n t/helper/test-tool.h                  |  1 +\n t/t0005-signals.sh                    |  2 +-\n t/t0021-conversion.sh                 |  4 ++--\n t/t1006-cat-file.sh                   |  2 +-\n t/t1050-large.sh                      |  6 +++---\n t/t5000-tar-tree.sh                   |  2 +-\n t/t5300-pack-object.sh                |  4 ++--\n t/t5301-sliding-window.sh             |  2 +-\n t/t5302-pack-index.sh                 | 14 +++++++-------\n t/t5303-pack-corruption-resilience.sh | 10 +++++-----\n t/t5310-pack-bitmaps.sh               |  2 +-\n t/t5313-pack-bounds-checks.sh         |  4 ++--\n t/t5314-pack-cycle-detection.sh       |  2 +-\n t/t5316-pack-delta-depth.sh           |  2 +-\n t/t5546-receive-limits.sh             |  2 +-\n t/t5547-push-quarantine.sh            |  2 +-\n t/t5608-clone-2gb.sh                  |  2 +-\n t/t9300-fast-import.sh                |  2 +-\n t/t9802-git-p4-filetype.sh            |  2 +-\n 22 files changed, 38 insertions(+), 35 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 895b170fe3..d0bc6cfecf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -661,13 +661,13 @@ TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n+TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n-TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n TEST_PROGRAMS_NEED_X += test-line-buffer\ndiff --git a/t/helper/test-genrandom.c b/t/helper/test-genrandom.c\nindex 8d11d22d98..99b8dc1e2d 100644\n--- a/t/helper/test-genrandom.c\n+++ b/t/helper/test-genrandom.c\n@@ -4,9 +4,10 @@\n  * Copyright (C) 2007 by Nicolas Pitre, licensed under the GPL version 2.\n  */\n \n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__genrandom(int argc, const char **argv)\n {\n \tunsigned long count, next = 0;\n \tunsigned char *c;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex a0e95c13ed..eb20b7d8fe 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -16,6 +16,7 @@ static struct test_cmd cmds[] = {\n \t{ \"dump-cache-tree\", cmd__dump_cache_tree },\n \t{ \"dump-split-index\", cmd__dump_split_index },\n \t{ \"example-decorate\", cmd__example_decorate },\n+\t{ \"genrandom\", cmd__genrandom },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 721a1e1b09..f7ec6ae0c3 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -10,6 +10,7 @@ int cmd__drop_caches(int argc, const char **argv);\n int cmd__dump_cache_tree(int argc, const char **argv);\n int cmd__dump_split_index(int argc, const char **argv);\n int cmd__example_decorate(int argc, const char **argv);\n+int cmd__genrandom(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\nindex 46042f1f13..c16947cf5d 100755\n--- a/t/t0005-signals.sh\n+++ b/t/t0005-signals.sh\n@@ -36,7 +36,7 @@ large_git () {\n }\n \n test_expect_success 'create blob' '\n-\ttest-genrandom foo 16384 >file &&\n+\ttest-tool genrandom foo 16384 >file &&\n \tgit add file\n '\n \ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 46f8e583c3..9479a4aaab 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -19,7 +19,7 @@ write_script rot13-filter.pl \"$PERL_PATH\" \\\n generate_random_characters () {\n \tLEN=$1\n \tNAME=$2\n-\ttest-genrandom some-seed $LEN |\n+\ttest-tool genrandom some-seed $LEN |\n \t\tperl -pe \"s/./chr((ord($&) % 26) + ord('a'))/sge\" >\"$TEST_ROOT/$NAME\"\n }\n \n@@ -267,7 +267,7 @@ test_expect_success 'filtering large input to small output should use little mem\n '\n \n test_expect_success 'filter that does not read is fine' '\n-\ttest-genrandom foo $((128 * 1024 + 1)) >big &&\n+\ttest-tool genrandom foo $((128 * 1024 + 1)) >big &&\n \techo \"big filter=epipe\" >.gitattributes &&\n \ttest_config filter.epipe.clean \"echo xyzzy\" &&\n \tgit add big &&\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex b19f332694..2ac3b940c6 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -282,7 +282,7 @@ test_expect_success \"--batch-check with multiple sha1s gives correct format\" '\n '\n \n test_expect_success 'setup blobs which are likely to delta' '\n-\ttest-genrandom foo 10240 >foo &&\n+\ttest-tool genrandom foo 10240 >foo &&\n \t{ cat foo; echo plus; } >foo-plus &&\n \tgit add foo foo-plus &&\n \tgit commit -m foo &&\ndiff --git a/t/t1050-large.sh b/t/t1050-large.sh\nindex 6fd264cff0..f9eb143f43 100755\n--- a/t/t1050-large.sh\n+++ b/t/t1050-large.sh\n@@ -103,9 +103,9 @@ test_expect_success 'packsize limit' '\n \t\t# mid1 and mid2 will fit within 256k limit but\n \t\t# appending mid3 will bust the limit and will\n \t\t# result in a separate packfile.\n-\t\ttest-genrandom \"a\" $(( 66 * 1024 )) >mid1 &&\n-\t\ttest-genrandom \"b\" $(( 80 * 1024 )) >mid2 &&\n-\t\ttest-genrandom \"c\" $(( 128 * 1024 )) >mid3 &&\n+\t\ttest-tool genrandom \"a\" $(( 66 * 1024 )) >mid1 &&\n+\t\ttest-tool genrandom \"b\" $(( 80 * 1024 )) >mid2 &&\n+\t\ttest-tool genrandom \"c\" $(( 128 * 1024 )) >mid3 &&\n \t\tgit add mid1 mid2 mid3 &&\n \n \t\tcount=0\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 266d052efb..af4d9b8876 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -101,7 +101,7 @@ test_expect_success \\\n      ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n      echo long filename >a/four$hundred &&\n      mkdir a/bin &&\n-     test-genrandom \"frotz\" 500000 >a/bin/sh &&\n+     test-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n      printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n      printf \"A not substituted O\" >a/substfile2 &&\n      if test_have_prereq SYMLINKS; then\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 9c68b99251..3bac1f20e0 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -16,8 +16,8 @@ test_expect_success \\\n      perl -e \"print \\\"a\\\" x 4096;\" > a &&\n      perl -e \"print \\\"b\\\" x 4096;\" > b &&\n      perl -e \"print \\\"c\\\" x 4096;\" > c &&\n-     test-genrandom \"seed a\" 2097152 > a_big &&\n-     test-genrandom \"seed b\" 2097152 > b_big &&\n+     test-tool genrandom \"seed a\" 2097152 > a_big &&\n+     test-tool genrandom \"seed b\" 2097152 > b_big &&\n      git update-index --add a a_big b b_big c &&\n      cat c >d && echo foo >>d && git update-index --add d &&\n      tree=$(git write-tree) &&\ndiff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh\nindex cae8c2e882..8132642163 100755\n--- a/t/t5301-sliding-window.sh\n+++ b/t/t5301-sliding-window.sh\n@@ -12,7 +12,7 @@ test_expect_success \\\n      for i in a b c\n      do\n          echo $i >$i &&\n-         test-genrandom \"$i\" 32768 >>$i &&\n+         test-tool genrandom \"$i\" 32768 >>$i &&\n          git update-index --add $i || return 1\n      done &&\n      echo d >d && cat c >>d && git update-index --add d &&\ndiff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh\nindex d695a6082e..7a62947f74 100755\n--- a/t/t5302-pack-index.sh\n+++ b/t/t5302-pack-index.sh\n@@ -15,17 +15,17 @@ test_expect_success \\\n      while test $i -le 100\n      do\n          iii=$(printf '%03i' $i)\n-         test-genrandom \"bar\" 200 > wide_delta_$iii &&\n-         test-genrandom \"baz $iii\" 50 >> wide_delta_$iii &&\n-         test-genrandom \"foo\"$i 100 > deep_delta_$iii &&\n-         test-genrandom \"foo\"$(expr $i + 1) 100 >> deep_delta_$iii &&\n-         test-genrandom \"foo\"$(expr $i + 2) 100 >> deep_delta_$iii &&\n+         test-tool genrandom \"bar\" 200 > wide_delta_$iii &&\n+         test-tool genrandom \"baz $iii\" 50 >> wide_delta_$iii &&\n+         test-tool genrandom \"foo\"$i 100 > deep_delta_$iii &&\n+         test-tool genrandom \"foo\"$(expr $i + 1) 100 >> deep_delta_$iii &&\n+         test-tool genrandom \"foo\"$(expr $i + 2) 100 >> deep_delta_$iii &&\n          echo $iii >file_$iii &&\n-         test-genrandom \"$iii\" 8192 >>file_$iii &&\n+         test-tool genrandom \"$iii\" 8192 >>file_$iii &&\n          git update-index --add file_$iii deep_delta_$iii wide_delta_$iii &&\n          i=$(expr $i + 1) || return 1\n      done &&\n-     { echo 101 && test-genrandom 100 8192; } >file_101 &&\n+     { echo 101 && test-tool genrandom 100 8192; } >file_101 &&\n      git update-index --add file_101 &&\n      tree=$(git write-tree) &&\n      commit=$(git commit-tree $tree </dev/null) && {\ndiff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh\nindex 5940ce2084..3634e258f8 100755\n--- a/t/t5303-pack-corruption-resilience.sh\n+++ b/t/t5303-pack-corruption-resilience.sh\n@@ -19,14 +19,14 @@ test_description='resilience to pack corruptions with redundant objects'\n # 3) object header is always 2 bytes.\n \n create_test_files() {\n-    test-genrandom \"foo\" 2000 > file_1 &&\n-    test-genrandom \"foo\" 1800 > file_2 &&\n-    test-genrandom \"foo\" 1800 > file_3 &&\n+    test-tool genrandom \"foo\" 2000 > file_1 &&\n+    test-tool genrandom \"foo\" 1800 > file_2 &&\n+    test-tool genrandom \"foo\" 1800 > file_3 &&\n     echo \" base \" >> file_1 &&\n     echo \" delta1 \" >> file_2 &&\n     echo \" delta delta2 \" >> file_3 &&\n-    test-genrandom \"bar\" 150 >> file_2 &&\n-    test-genrandom \"baz\" 100 >> file_3\n+    test-tool genrandom \"bar\" 150 >> file_2 &&\n+    test-tool genrandom \"baz\" 100 >> file_3\n }\n \n create_new_pack() {\ndiff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\nindex 20e2473a03..f6d600fd82 100755\n--- a/t/t5310-pack-bitmaps.sh\n+++ b/t/t5310-pack-bitmaps.sh\n@@ -284,7 +284,7 @@ test_expect_success JGIT 'jgit can read our bitmaps' '\n '\n \n test_expect_success 'splitting packs does not generate bogus bitmaps' '\n-\ttest-genrandom foo $((1024 * 1024)) >rand &&\n+\ttest-tool genrandom foo $((1024 * 1024)) >rand &&\n \tgit add rand &&\n \tgit commit -m \"commit with big file\" &&\n \tgit -c pack.packSizeLimit=500k repack -adb &&\ndiff --git a/t/t5313-pack-bounds-checks.sh b/t/t5313-pack-bounds-checks.sh\nindex 9372508c99..4fe4ad9d61 100755\n--- a/t/t5313-pack-bounds-checks.sh\n+++ b/t/t5313-pack-bounds-checks.sh\n@@ -163,8 +163,8 @@ test_expect_success 'bogus offset inside v2 extended table' '\n \n test_expect_success 'bogus OFS_DELTA in packfile' '\n \t# Generate a pack with a delta in it.\n-\tbase=$(test-genrandom foo 3000 | git hash-object --stdin -w) &&\n-\tdelta=$(test-genrandom foo 2000 | git hash-object --stdin -w) &&\n+\tbase=$(test-tool genrandom foo 3000 | git hash-object --stdin -w) &&\n+\tdelta=$(test-tool genrandom foo 2000 | git hash-object --stdin -w) &&\n \tdo_pack \"$base $delta\" --delta-base-offset &&\n \trm -f .git/objects/??/* &&\n \ndiff --git a/t/t5314-pack-cycle-detection.sh b/t/t5314-pack-cycle-detection.sh\nindex f7dbdfb412..f31995d3d2 100755\n--- a/t/t5314-pack-cycle-detection.sh\n+++ b/t/t5314-pack-cycle-detection.sh\n@@ -73,7 +73,7 @@ make_pack () {\n }\n \n test_expect_success 'setup' '\n-\ttest-genrandom base 4096 >base &&\n+\ttest-tool genrandom base 4096 >base &&\n \tfor i in one two\n \tdo\n \t\t# we want shared content here to encourage deltas...\ndiff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh\nindex 2ed479b712..0f06c40eb1 100755\n--- a/t/t5316-pack-delta-depth.sh\n+++ b/t/t5316-pack-delta-depth.sh\n@@ -47,7 +47,7 @@ test_description='pack-objects breaks long cross-pack delta chains'\n # repeatedly-modified file to generate the delta chain).\n \n test_expect_success 'create series of packs' '\n-\ttest-genrandom foo 4096 >content &&\n+\ttest-tool genrandom foo 4096 >content &&\n \tprev= &&\n \tfor i in $(test_seq 1 10)\n \tdo\ndiff --git a/t/t5546-receive-limits.sh b/t/t5546-receive-limits.sh\nindex 10cb0be2b7..0b0e987fdb 100755\n--- a/t/t5546-receive-limits.sh\n+++ b/t/t5546-receive-limits.sh\n@@ -44,7 +44,7 @@ test_pack_input_limit () {\n }\n \n test_expect_success \"create known-size (1024 bytes) commit\" '\n-\ttest-genrandom foo 1024 >one-k &&\n+\ttest-tool genrandom foo 1024 >one-k &&\n \tgit add one-k &&\n \ttest_commit one-k\n '\ndiff --git a/t/t5547-push-quarantine.sh b/t/t5547-push-quarantine.sh\nindex 113c87007f..faaa51ccc5 100755\n--- a/t/t5547-push-quarantine.sh\n+++ b/t/t5547-push-quarantine.sh\n@@ -39,7 +39,7 @@ test_expect_success 'push to repo path with path separator (colon)' '\n \t# so make it likely for us to generate a delta by having\n \t# a non-trivial file with multiple versions.\n \n-\ttest-genrandom foo 4096 >file.bin &&\n+\ttest-tool genrandom foo 4096 >file.bin &&\n \tgit add file.bin &&\n \tgit commit -m bin &&\n \ndiff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh\nindex 191d6d3a78..df822d9a3e 100755\n--- a/t/t5608-clone-2gb.sh\n+++ b/t/t5608-clone-2gb.sh\n@@ -21,7 +21,7 @@ test_expect_success CLONE_2GB 'setup' '\n \t do\n \t\tprintf \"Generating blob $i/$blobcount\\r\" >&2 &&\n \t\tprintf \"blob\\nmark :$i\\ndata $blobsize\\n\" &&\n-\t\t#test-genrandom $i $blobsize &&\n+\t\t#test-tool genrandom $i $blobsize &&\n \t\tprintf \"%-${blobsize}s\" $i &&\n \t\techo \"M 100644 :$i $i\" >> commit\n \t\ti=$(($i+1)) ||\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex e4d06accc4..dc79df7b04 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -2654,7 +2654,7 @@ test_expect_success 'R: corrupt lines do not mess marks file' '\n ##\n test_expect_success 'R: blob bigger than threshold' '\n \tblobsize=$((2*1024*1024 + 53)) &&\n-\ttest-genrandom bar $blobsize >expect &&\n+\ttest-tool genrandom bar $blobsize >expect &&\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/big-file\n \tcommitter $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\ndiff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh\nindex eb9a8ed197..1fc9b33aeb 100755\n--- a/t/t9802-git-p4-filetype.sh\n+++ b/t/t9802-git-p4-filetype.sh\n@@ -237,7 +237,7 @@ test_expect_success 'ignore apple' '\n \tbuild_gendouble &&\n \t(\n \t\tcd \"$cli\" &&\n-\t\ttest-genrandom apple 1024 >double.png &&\n+\t\ttest-tool genrandom apple 1024 >double.png &&\n \t\t\"$PYTHON_PATH\" \"$TRASH_DIRECTORY/gendouble.py\" >%double.png &&\n \t\tp4 add -t apple double.png &&\n \t\tp4 submit -d appledouble\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342776","messageId":"20180324074505.19100-15-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 14/36] t/helper: merge test-hashmap into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:43Z","receivedAt":"2018-03-24T07:45:58Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                | 2 +-\n t/helper/test-hashmap.c | 5 +++--\n t/helper/test-tool.c    | 1 +\n t/helper/test-tool.h    | 1 +\n t/t0011-hashmap.sh      | 4 ++--\n 5 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d0bc6cfecf..f6c3ddc703 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -662,13 +662,13 @@ TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-genrandom.o\n+TEST_BUILTINS_OBJS += test-hashmap.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n-TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\ndiff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c\nindex 9ae9281c07..23d2b172fe 100644\n--- a/t/helper/test-hashmap.c\n+++ b/t/helper/test-hashmap.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"hashmap.h\"\n #include \"strbuf.h\"\n@@ -77,7 +78,7 @@ static unsigned int hash(unsigned int method, unsigned int i, const char *key)\n \n /*\n  * Test performance of hashmap.[ch]\n- * Usage: time echo \"perfhashmap method rounds\" | test-hashmap\n+ * Usage: time echo \"perfhashmap method rounds\" | test-tool hashmap\n  */\n static void perf_hashmap(unsigned int method, unsigned int rounds)\n {\n@@ -144,7 +145,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)\n  *\n  * perfhashmap method rounds -> test hashmap.[ch] performance\n  */\n-int cmd_main(int argc, const char **argv)\n+int cmd__hashmap(int argc, const char **argv)\n {\n \tstruct strbuf line = STRBUF_INIT;\n \tstruct hashmap map;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex eb20b7d8fe..b9a6e7cbaa 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -17,6 +17,7 @@ static struct test_cmd cmds[] = {\n \t{ \"dump-split-index\", cmd__dump_split_index },\n \t{ \"example-decorate\", cmd__example_decorate },\n \t{ \"genrandom\", cmd__genrandom },\n+\t{ \"hashmap\", cmd__hashmap },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex f7ec6ae0c3..fba4bd80b9 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -11,6 +11,7 @@ int cmd__dump_cache_tree(int argc, const char **argv);\n int cmd__dump_split_index(int argc, const char **argv);\n int cmd__example_decorate(int argc, const char **argv);\n int cmd__genrandom(int argc, const char **argv);\n+int cmd__hashmap(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0011-hashmap.sh b/t/t0011-hashmap.sh\nindex 9c217d948c..3f1f505e89 100755\n--- a/t/t0011-hashmap.sh\n+++ b/t/t0011-hashmap.sh\n@@ -4,7 +4,7 @@ test_description='test hashmap and string hash functions'\n . ./test-lib.sh\n \n test_hashmap() {\n-\techo \"$1\" | test-hashmap $3 > actual &&\n+\techo \"$1\" | test-tool hashmap $3 > actual &&\n \techo \"$2\" > expect &&\n \ttest_cmp expect actual\n }\n@@ -232,7 +232,7 @@ test_expect_success 'grow / shrink' '\n \techo value40 >> expect &&\n \techo size >> in &&\n \techo 64 39 >> expect &&\n-\tcat in | test-hashmap > out &&\n+\tcat in | test-tool hashmap > out &&\n \ttest_cmp expect out\n \n '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342777","messageId":"20180324074505.19100-17-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 16/36] t/helper: merge (unused) test-match-trees into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:45Z","receivedAt":"2018-03-24T07:46:05Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    | 2 +-\n t/helper/test-match-trees.c | 3 ++-\n t/helper/test-tool.c        | 1 +\n t/helper/test-tool.h        | 1 +\n 4 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d7342e3a8b..6552a8f4ed 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -665,13 +665,13 @@ TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-hashmap.o\n TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n+TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\n TEST_PROGRAMS_NEED_X += test-mktemp\n TEST_PROGRAMS_NEED_X += test-online-cpus\ndiff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c\nindex 356d8edef1..96857f26ac 100644\n--- a/t/helper/test-match-trees.c\n+++ b/t/helper/test-match-trees.c\n@@ -1,7 +1,8 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"tree.h\"\n \n-int cmd_main(int ac, const char **av)\n+int cmd__match_trees(int ac, const char **av)\n {\n \tstruct object_id hash1, hash2, shifted;\n \tstruct tree *one, *two;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 88fbe8ddbd..3653646f3a 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -20,6 +20,7 @@ static struct test_cmd cmds[] = {\n \t{ \"hashmap\", cmd__hashmap },\n \t{ \"index-version\", cmd__index_version },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n+\t{ \"match-trees\", cmd__match_trees },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex b855203477..d2f009cb3e 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -14,6 +14,7 @@ int cmd__genrandom(int argc, const char **argv);\n int cmd__hashmap(int argc, const char **argv);\n int cmd__index_version(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n+int cmd__match_trees(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342778","messageId":"20180324074505.19100-13-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 12/36] t/helper: merge test-example-decorate into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:41Z","receivedAt":"2018-03-24T07:46:08Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         | 2 +-\n t/helper/test-example-decorate.c | 3 ++-\n t/helper/test-tool.c             | 1 +\n t/helper/test-tool.h             | 1 +\n t/t9004-example.sh               | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 8993cec274..895b170fe3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -660,12 +660,12 @@ TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n+TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n-TEST_PROGRAMS_NEED_X += test-example-decorate\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\ndiff --git a/t/helper/test-example-decorate.c b/t/helper/test-example-decorate.c\nindex 90dc97a9d0..081115bf8e 100644\n--- a/t/helper/test-example-decorate.c\n+++ b/t/helper/test-example-decorate.c\n@@ -1,8 +1,9 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"object.h\"\n #include \"decorate.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__example_decorate(int argc, const char **argv)\n {\n \tstruct decoration n;\n \tstruct object_id one_oid = { {1} };\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 26ae209cd5..a0e95c13ed 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -15,6 +15,7 @@ static struct test_cmd cmds[] = {\n \t{ \"drop-caches\", cmd__drop_caches },\n \t{ \"dump-cache-tree\", cmd__dump_cache_tree },\n \t{ \"dump-split-index\", cmd__dump_split_index },\n+\t{ \"example-decorate\", cmd__example_decorate },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex e8363e851f..721a1e1b09 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -9,6 +9,7 @@ int cmd__delta(int argc, const char **argv);\n int cmd__drop_caches(int argc, const char **argv);\n int cmd__dump_cache_tree(int argc, const char **argv);\n int cmd__dump_split_index(int argc, const char **argv);\n+int cmd__example_decorate(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t9004-example.sh b/t/t9004-example.sh\nindex b28a028f55..7e8894a4a7 100755\n--- a/t/t9004-example.sh\n+++ b/t/t9004-example.sh\n@@ -4,7 +4,7 @@ test_description='check that example code compiles and runs'\n . ./test-lib.sh\n \n test_expect_success 'decorate' '\n-\ttest-example-decorate\n+\ttest-tool example-decorate\n '\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342779","messageId":"20180324074505.19100-27-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 26/36] t/helper: merge test-run-command into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:55Z","receivedAt":"2018-03-24T07:46:10Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    |  2 +-\n t/helper/test-run-command.c |  3 ++-\n t/helper/test-tool.c        |  1 +\n t/helper/test-tool.h        |  1 +\n t/t0061-run-command.sh      | 24 ++++++++++++------------\n 5 files changed, 17 insertions(+), 14 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3ed461cd55..adece67b8e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -675,6 +675,7 @@ TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n+TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -683,7 +684,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 153342e44d..2cc93bb69c 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -8,6 +8,7 @@\n  * published by the Free Software Foundation.\n  */\n \n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"run-command.h\"\n #include \"argv-array.h\"\n@@ -49,7 +50,7 @@ static int task_finished(int result,\n \treturn 1;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__run_command(int argc, const char **argv)\n {\n \tstruct child_process proc = CHILD_PROCESS_INIT;\n \tint jobs;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex e43405bea9..94ceda66e7 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -30,6 +30,7 @@ static struct test_cmd cmds[] = {\n \t{ \"ref-store\", cmd__ref_store },\n \t{ \"regex\", cmd__regex },\n \t{ \"revision-walking\", cmd__revision_walking },\n+\t{ \"run-command\", cmd__run_command },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 4dff220646..0fe2dd640b 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -24,6 +24,7 @@ int cmd__read_cache(int argc, const char **argv);\n int cmd__ref_store(int argc, const char **argv);\n int cmd__regex(int argc, const char **argv);\n int cmd__revision_walking(int argc, const char **argv);\n+int cmd__run_command(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh\nindex 24c92b6cd7..d03149be9f 100755\n--- a/t/t0061-run-command.sh\n+++ b/t/t0061-run-command.sh\n@@ -14,13 +14,13 @@ EOF\n >empty\n \n test_expect_success 'start_command reports ENOENT' '\n-\ttest-run-command start-command-ENOENT ./does-not-exist\n+\ttest-tool run-command start-command-ENOENT ./does-not-exist\n '\n \n test_expect_success 'run_command can run a command' '\n \tcat hello-script >hello.sh &&\n \tchmod +x hello.sh &&\n-\ttest-run-command run-command ./hello.sh >actual 2>err &&\n+\ttest-tool run-command run-command ./hello.sh >actual 2>err &&\n \n \ttest_cmp hello-script actual &&\n \ttest_cmp empty err\n@@ -31,7 +31,7 @@ test_expect_success !MINGW 'run_command can run a script without a #! line' '\n \tcat hello-script\n \tEOF\n \tchmod +x hello &&\n-\ttest-run-command run-command ./hello >actual 2>err &&\n+\ttest-tool run-command run-command ./hello >actual 2>err &&\n \n \ttest_cmp hello-script actual &&\n \ttest_cmp empty err\n@@ -45,7 +45,7 @@ test_expect_success 'run_command does not try to execute a directory' '\n \tEOF\n \n \tPATH=$PWD/bin1:$PWD/bin2:$PATH \\\n-\t\ttest-run-command run-command greet >actual 2>err &&\n+\t\ttest-tool run-command run-command greet >actual 2>err &&\n \ttest_cmp bin2/greet actual &&\n \ttest_cmp empty err\n '\n@@ -62,7 +62,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '\n \tEOF\n \n \tPATH=$PWD/bin1:$PWD/bin2:$PATH \\\n-\t\ttest-run-command run-command greet >actual 2>err &&\n+\t\ttest-tool run-command run-command greet >actual 2>err &&\n \ttest_cmp bin2/greet actual &&\n \ttest_cmp empty err\n '\n@@ -70,7 +70,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '\n test_expect_success POSIXPERM 'run_command reports EACCES' '\n \tcat hello-script >hello.sh &&\n \tchmod -x hello.sh &&\n-\ttest_must_fail test-run-command run-command ./hello.sh 2>err &&\n+\ttest_must_fail test-tool run-command run-command ./hello.sh 2>err &&\n \n \tgrep \"fatal: cannot exec.*hello.sh\" err\n '\n@@ -104,17 +104,17 @@ World\n EOF\n \n test_expect_success 'run_command runs in parallel with more jobs available than tasks' '\n-\ttest-run-command run-command-parallel 5 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-parallel 5 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'run_command runs in parallel with as many jobs as tasks' '\n-\ttest-run-command run-command-parallel 4 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-parallel 4 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'run_command runs in parallel with more tasks than jobs available' '\n-\ttest-run-command run-command-parallel 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-parallel 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n@@ -128,7 +128,7 @@ asking for a quick stop\n EOF\n \n test_expect_success 'run_command is asked to abort gracefully' '\n-\ttest-run-command run-command-abort 3 false 2>actual &&\n+\ttest-tool run-command run-command-abort 3 false 2>actual &&\n \ttest_cmp expect actual\n '\n \n@@ -137,14 +137,14 @@ no further jobs available\n EOF\n \n test_expect_success 'run_command outputs ' '\n-\ttest-run-command run-command-no-jobs 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n+\ttest-tool run-command run-command-no-jobs 3 sh -c \"printf \\\"%s\\n%s\\n\\\" Hello World\" 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_trace () {\n \texpect=\"$1\"\n \tshift\n-\tGIT_TRACE=1 test-run-command \"$@\" run-command true 2>&1 >/dev/null | \\\n+\tGIT_TRACE=1 test-tool run-command \"$@\" run-command true 2>&1 >/dev/null | \\\n \t\tsed 's/.* run_command: //' >actual &&\n \techo \"$expect true\" >expect &&\n \ttest_cmp expect actual\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342780","messageId":"20180324074505.19100-28-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 27/36] t/helper: merge test-scrap-cache-tree into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:56Z","receivedAt":"2018-03-24T07:46:12Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         | 2 +-\n t/helper/test-scrap-cache-tree.c | 3 ++-\n t/helper/test-tool.c             | 1 +\n t/helper/test-tool.h             | 1 +\n t/t0090-cache-tree.sh            | 8 ++++----\n 5 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex adece67b8e..ba7c7d8a79 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -676,6 +676,7 @@ TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-run-command.o\n+TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\ndiff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\nindex d2a63bea43..d26d3e7c8b 100644\n--- a/t/helper/test-scrap-cache-tree.c\n+++ b/t/helper/test-scrap-cache-tree.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"lockfile.h\"\n #include \"tree.h\"\n@@ -5,7 +6,7 @@\n \n static struct lock_file index_lock;\n \n-int cmd_main(int ac, const char **av)\n+int cmd__scrap_cache_tree(int ac, const char **av)\n {\n \tsetup_git_directory();\n \thold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 94ceda66e7..96d8df69d4 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -31,6 +31,7 @@ static struct test_cmd cmds[] = {\n \t{ \"regex\", cmd__regex },\n \t{ \"revision-walking\", cmd__revision_walking },\n \t{ \"run-command\", cmd__run_command },\n+\t{ \"scrap-cache-tree\", cmd__scrap_cache_tree },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 0fe2dd640b..448119a44a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -25,6 +25,7 @@ int cmd__ref_store(int argc, const char **argv);\n int cmd__regex(int argc, const char **argv);\n int cmd__revision_walking(int argc, const char **argv);\n int cmd__run_command(int argc, const char **argv);\n+int cmd__scrap_cache_tree(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex 3266209e41..4ae0995cd9 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -115,14 +115,14 @@ test_expect_success 'update-index invalidates cache-tree' '\n '\n \n test_expect_success 'write-tree establishes cache-tree' '\n-\ttest-scrap-cache-tree &&\n+\ttest-tool scrap-cache-tree &&\n \tgit write-tree &&\n \ttest_cache_tree\n '\n \n-test_expect_success 'test-scrap-cache-tree works' '\n+test_expect_success 'test-tool scrap-cache-tree works' '\n \tgit read-tree HEAD &&\n-\ttest-scrap-cache-tree &&\n+\ttest-tool scrap-cache-tree &&\n \ttest_no_cache_tree\n '\n \n@@ -170,7 +170,7 @@ test_expect_success 'commit in child dir has cache-tree' '\n '\n \n test_expect_success 'reset --hard gives cache-tree' '\n-\ttest-scrap-cache-tree &&\n+\ttest-tool scrap-cache-tree &&\n \tgit reset --hard &&\n \ttest_cache_tree\n '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342781","messageId":"20180324074505.19100-30-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 29/36] t/helper: merge test-sigchain into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:58Z","receivedAt":"2018-03-24T07:46:15Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                 | 2 +-\n t/helper/test-sigchain.c | 3 ++-\n t/helper/test-tool.c     | 1 +\n t/helper/test-tool.h     | 1 +\n t/t0005-signals.sh       | 4 ++--\n 5 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b50a0818a9..51de8882d0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -679,6 +679,7 @@ TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n+TEST_BUILTINS_OBJS += test-sigchain.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -686,7 +687,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\ndiff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c\nindex b71edbd442..77ac5bc33f 100644\n--- a/t/helper/test-sigchain.c\n+++ b/t/helper/test-sigchain.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"sigchain.h\"\n \n@@ -13,7 +14,7 @@ X(two)\n X(three)\n #undef X\n \n-int cmd_main(int argc, const char **argv) {\n+int cmd__sigchain(int argc, const char **argv) {\n \tsigchain_push(SIGTERM, one);\n \tsigchain_push(SIGTERM, two);\n \tsigchain_push(SIGTERM, three);\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 27f7b6ff75..c1de1a3397 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -34,6 +34,7 @@ static struct test_cmd cmds[] = {\n \t{ \"scrap-cache-tree\", cmd__scrap_cache_tree },\n \t{ \"sha1-array\", cmd__sha1_array },\n \t{ \"sha1\", cmd__sha1 },\n+\t{ \"sigchain\", cmd__sigchain },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex d8066e3f63..1d366846f3 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -28,5 +28,6 @@ int cmd__run_command(int argc, const char **argv);\n int cmd__scrap_cache_tree(int argc, const char **argv);\n int cmd__sha1_array(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n+int cmd__sigchain(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\nindex c16947cf5d..4c214bd11c 100755\n--- a/t/t0005-signals.sh\n+++ b/t/t0005-signals.sh\n@@ -10,7 +10,7 @@ one\n EOF\n \n test_expect_success 'sigchain works' '\n-\t{ test-sigchain >actual; ret=$?; } &&\n+\t{ test-tool sigchain >actual; ret=$?; } &&\n \t{\n \t\t# Signal death by raise() on Windows acts like exit(3),\n \t\t# regardless of the signal number. So we must allow that\n@@ -24,7 +24,7 @@ test_expect_success 'sigchain works' '\n test_expect_success !MINGW 'signals are propagated using shell convention' '\n \t# we use exec here to avoid any sub-shell interpretation\n \t# of the exit code\n-\tgit config alias.sigterm \"!exec test-sigchain\" &&\n+\tgit config alias.sigterm \"!exec test-tool sigchain\" &&\n \ttest_expect_code 143 git sigterm\n '\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342782","messageId":"20180324074505.19100-29-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 28/36] t/helper: merge test-sha1-array into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:57Z","receivedAt":"2018-03-24T07:46:18Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   |  2 +-\n t/helper/test-sha1-array.c |  3 ++-\n t/helper/test-tool.c       |  1 +\n t/helper/test-tool.h       |  1 +\n t/t0064-sha1-array.sh      | 16 ++++++++--------\n 5 files changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ba7c7d8a79..b50a0818a9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -677,6 +677,7 @@ TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n+TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -685,7 +686,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n TEST_PROGRAMS_NEED_X += test-string-list\ndiff --git a/t/helper/test-sha1-array.c b/t/helper/test-sha1-array.c\nindex edfd52d82a..ad5e69f9d3 100644\n--- a/t/helper/test-sha1-array.c\n+++ b/t/helper/test-sha1-array.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"sha1-array.h\"\n \n@@ -7,7 +8,7 @@ static int print_oid(const struct object_id *oid, void *data)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__sha1_array(int argc, const char **argv)\n {\n \tstruct oid_array array = OID_ARRAY_INIT;\n \tstruct strbuf line = STRBUF_INIT;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 96d8df69d4..27f7b6ff75 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -32,6 +32,7 @@ static struct test_cmd cmds[] = {\n \t{ \"revision-walking\", cmd__revision_walking },\n \t{ \"run-command\", cmd__run_command },\n \t{ \"scrap-cache-tree\", cmd__scrap_cache_tree },\n+\t{ \"sha1-array\", cmd__sha1_array },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 448119a44a..d8066e3f63 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -26,6 +26,7 @@ int cmd__regex(int argc, const char **argv);\n int cmd__revision_walking(int argc, const char **argv);\n int cmd__run_command(int argc, const char **argv);\n int cmd__scrap_cache_tree(int argc, const char **argv);\n+int cmd__sha1_array(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0064-sha1-array.sh b/t/t0064-sha1-array.sh\nindex 50b31ffe75..67484502a0 100755\n--- a/t/t0064-sha1-array.sh\n+++ b/t/t0064-sha1-array.sh\n@@ -18,7 +18,7 @@ test_expect_success 'ordered enumeration' '\n \t{\n \t\techo20 append 88 44 aa 55 &&\n \t\techo for_each_unique\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -28,7 +28,7 @@ test_expect_success 'ordered enumeration with duplicate suppression' '\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 append 88 44 aa 55 &&\n \t\techo for_each_unique\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'lookup' '\n \t{\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -eq 1\n '\n@@ -45,7 +45,7 @@ test_expect_success 'lookup non-existing entry' '\n \t{\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 33\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -lt 0\n '\n@@ -55,7 +55,7 @@ test_expect_success 'lookup with duplicates' '\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -ge 2 &&\n \ttest \"$n\" -le 3\n@@ -66,7 +66,7 @@ test_expect_success 'lookup non-existing entry with duplicates' '\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 append 88 44 aa 55 &&\n \t\techo20 lookup 66\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -lt 0\n '\n@@ -76,7 +76,7 @@ test_expect_success 'lookup with almost duplicate values' '\n \t\techo \"append 5555555555555555555555555555555555555555\" &&\n \t\techo \"append 555555555555555555555555555555555555555f\" &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -eq 0\n '\n@@ -85,7 +85,7 @@ test_expect_success 'lookup with single duplicate value' '\n \t{\n \t\techo20 append 55 55 &&\n \t\techo20 lookup 55\n-\t} | test-sha1-array >actual &&\n+\t} | test-tool sha1-array >actual &&\n \tn=$(cat actual) &&\n \ttest \"$n\" -ge 0 &&\n \ttest \"$n\" -le 1\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342783","messageId":"20180324074505.19100-31-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 30/36] t/helper: merge test-strcmp-offset into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:59Z","receivedAt":"2018-03-24T07:46:19Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                      | 2 +-\n t/helper/test-strcmp-offset.c | 3 ++-\n t/helper/test-tool.c          | 1 +\n t/helper/test-tool.h          | 1 +\n t/t0065-strcmp-offset.sh      | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 51de8882d0..528a80b6a6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -680,6 +680,7 @@ TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n+TEST_BUILTINS_OBJS += test-strcmp-offset.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -687,7 +688,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-strcmp-offset\n TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\ndiff --git a/t/helper/test-strcmp-offset.c b/t/helper/test-strcmp-offset.c\nindex e159c9a127..44e4a6d143 100644\n--- a/t/helper/test-strcmp-offset.c\n+++ b/t/helper/test-strcmp-offset.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__strcmp_offset(int argc, const char **argv)\n {\n \tint result;\n \tsize_t offset;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex c1de1a3397..41b8f869ae 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -35,6 +35,7 @@ static struct test_cmd cmds[] = {\n \t{ \"sha1-array\", cmd__sha1_array },\n \t{ \"sha1\", cmd__sha1 },\n \t{ \"sigchain\", cmd__sigchain },\n+\t{ \"strcmp-offset\", cmd__strcmp_offset },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 1d366846f3..035e82ec6a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -29,5 +29,6 @@ int cmd__scrap_cache_tree(int argc, const char **argv);\n int cmd__sha1_array(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n int cmd__sigchain(int argc, const char **argv);\n+int cmd__strcmp_offset(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0065-strcmp-offset.sh b/t/t0065-strcmp-offset.sh\nindex 7d6d21425f..91fa639c4a 100755\n--- a/t/t0065-strcmp-offset.sh\n+++ b/t/t0065-strcmp-offset.sh\n@@ -8,7 +8,7 @@ while read s1 s2 expect\n do\n \ttest_expect_success \"strcmp_offset($s1, $s2)\" '\n \t\techo \"$expect\" >expect &&\n-\t\ttest-strcmp-offset \"$s1\" \"$s2\" >actual &&\n+\t\ttest-tool strcmp-offset \"$s1\" \"$s2\" >actual &&\n \t\ttest_cmp expect actual\n \t'\n done <<-EOF\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342784","messageId":"20180324074505.19100-34-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 33/36] t/helper: merge test-subprocess into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:45:02Z","receivedAt":"2018-03-24T07:46:21Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   | 2 +-\n t/helper/test-subprocess.c | 3 ++-\n t/helper/test-tool.c       | 1 +\n t/helper/test-tool.h       | 1 +\n t/t1501-work-tree.sh       | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c1dc9ff8d6..893ea64ca2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -683,6 +683,7 @@ TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n+TEST_BUILTINS_OBJS += test-subprocess.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -690,7 +691,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\ndiff --git a/t/helper/test-subprocess.c b/t/helper/test-subprocess.c\nindex 30c5765bfc..92b69de635 100644\n--- a/t/helper/test-subprocess.c\n+++ b/t/helper/test-subprocess.c\n@@ -1,7 +1,8 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"run-command.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__subprocess(int argc, const char **argv)\n {\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n \tint nogit = 0;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 434fedc8d8..96180f0350 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -38,6 +38,7 @@ static struct test_cmd cmds[] = {\n \t{ \"strcmp-offset\", cmd__strcmp_offset },\n \t{ \"string-list\", cmd__string_list },\n \t{ \"submodule-config\", cmd__submodule_config },\n+\t{ \"subprocess\", cmd__subprocess },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex be7e79738f..a611801061 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -32,5 +32,6 @@ int cmd__sigchain(int argc, const char **argv);\n int cmd__strcmp_offset(int argc, const char **argv);\n int cmd__string_list(int argc, const char **argv);\n int cmd__submodule_config(int argc, const char **argv);\n+int cmd__subprocess(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh\nindex b07cb9140e..02cf2013fc 100755\n--- a/t/t1501-work-tree.sh\n+++ b/t/t1501-work-tree.sh\n@@ -341,7 +341,7 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '\n \n test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' '\n \tGIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \\\n-\ttest-subprocess --setup-work-tree rev-parse --show-toplevel >actual &&\n+\ttest-tool subprocess --setup-work-tree rev-parse --show-toplevel >actual &&\n \techo \"$(pwd)/repo.git/work\" >expected &&\n \ttest_cmp expected actual\n '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342785","messageId":"20180324074505.19100-36-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 35/36] t/helper: merge test-wildmatch into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:45:04Z","receivedAt":"2018-03-24T07:46:23Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  |  2 +-\n t/helper/test-tool.c      |  1 +\n t/helper/test-tool.h      |  1 +\n t/helper/test-wildmatch.c |  3 ++-\n t/t3070-wildmatch.sh      | 14 +++++++-------\n 5 files changed, 12 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7923ec3747..2ab76c6838 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -685,6 +685,7 @@ TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n+TEST_BUILTINS_OBJS += test-wildmatch.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -694,7 +695,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n-TEST_PROGRAMS_NEED_X += test-wildmatch\n \n TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex b3d84fdac9..a804e64048 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -40,6 +40,7 @@ static struct test_cmd cmds[] = {\n \t{ \"submodule-config\", cmd__submodule_config },\n \t{ \"subprocess\", cmd__subprocess },\n \t{ \"urlmatch-normalization\", cmd__urlmatch_normalization },\n+\t{ \"wildmatch\", cmd__wildmatch },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex fa53c82659..84c583e68f 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -34,5 +34,6 @@ int cmd__string_list(int argc, const char **argv);\n int cmd__submodule_config(int argc, const char **argv);\n int cmd__subprocess(int argc, const char **argv);\n int cmd__urlmatch_normalization(int argc, const char **argv);\n+int cmd__wildmatch(int argc, const char **argv);\n \n #endif\ndiff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c\nindex 66d33dfcfd..2c103d1824 100644\n--- a/t/helper/test-wildmatch.c\n+++ b/t/helper/test-wildmatch.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__wildmatch(int argc, const char **argv)\n {\n \tint i;\n \tfor (i = 2; i < argc; i++) {\ndiff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh\nindex c1fc6ca730..dce102130f 100755\n--- a/t/t3070-wildmatch.sh\n+++ b/t/t3070-wildmatch.sh\n@@ -79,12 +79,12 @@ match_with_function() {\n \tif test \"$match_expect\" = 1\n \tthen\n \t\ttest_expect_success \"$match_function: match '$text' '$pattern'\" \"\n-\t\t\ttest-wildmatch $match_function '$text' '$pattern'\n+\t\t\ttest-tool wildmatch $match_function '$text' '$pattern'\n \t\t\"\n \telif test \"$match_expect\" = 0\n \tthen\n \t\ttest_expect_success \"$match_function: no match '$text' '$pattern'\" \"\n-\t\t\ttest_must_fail test-wildmatch $match_function '$text' '$pattern'\n+\t\t\ttest_must_fail test-tool wildmatch $match_function '$text' '$pattern'\n \t\t\"\n \telse\n \t\ttest_expect_success \"PANIC: Test framework error. Unknown matches value $match_expect\" 'false'\n@@ -148,7 +148,7 @@ match_with_ls_files() {\n match() {\n \tif test \"$#\" = 6\n \tthen\n-\t\t# When test-wildmatch and git ls-files produce the same\n+\t\t# When test-tool wildmatch and git ls-files produce the same\n \t\t# result.\n \t\tmatch_glob=$1\n \t\tmatch_file_glob=$match_glob\n@@ -204,19 +204,19 @@ match() {\n \t\tfi\n \t'\n \n-\t# $1: Case sensitive glob match: test-wildmatch & ls-files\n+\t# $1: Case sensitive glob match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_glob \"wildmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_glob \"wildmatch\" \" --glob-pathspecs\"\n \n-\t# $2: Case insensitive glob match: test-wildmatch & ls-files\n+\t# $2: Case insensitive glob match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_iglob \"iwildmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_iglob \"iwildmatch\" \" --glob-pathspecs --icase-pathspecs\"\n \n-\t# $3: Case sensitive path match: test-wildmatch & ls-files\n+\t# $3: Case sensitive path match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_pathmatch \"pathmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_pathmatch \"pathmatch\" \"\"\n \n-\t# $4: Case insensitive path match: test-wildmatch & ls-files\n+\t# $4: Case insensitive path match: test-tool wildmatch & ls-files\n \tmatch_with_function \"$text\" \"$pattern\" $match_pathmatchi \"ipathmatch\"\n \tmatch_with_ls_files \"$text\" \"$pattern\" $match_file_pathmatchi \"ipathmatch\" \" --icase-pathspecs\"\n }\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342786","messageId":"20180324074505.19100-35-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 34/36] t/helper: merge test-urlmatch-normalization into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:45:03Z","receivedAt":"2018-03-24T07:46:27Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                               |   2 +-\n t/helper/test-tool.c                   |   1 +\n t/helper/test-tool.h                   |   1 +\n t/helper/test-urlmatch-normalization.c |   5 +-\n t/t0110-urlmatch-normalization.sh      | 266 ++++++++++++-------------\n 5 files changed, 139 insertions(+), 136 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 893ea64ca2..7923ec3747 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -684,6 +684,7 @@ TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n+TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -693,7 +694,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\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))\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 96180f0350..b3d84fdac9 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -39,6 +39,7 @@ static struct test_cmd cmds[] = {\n \t{ \"string-list\", cmd__string_list },\n \t{ \"submodule-config\", cmd__submodule_config },\n \t{ \"subprocess\", cmd__subprocess },\n+\t{ \"urlmatch-normalization\", cmd__urlmatch_normalization },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex a611801061..fa53c82659 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -33,5 +33,6 @@ int cmd__strcmp_offset(int argc, const char **argv);\n int cmd__string_list(int argc, const char **argv);\n int cmd__submodule_config(int argc, const char **argv);\n int cmd__subprocess(int argc, const char **argv);\n+int cmd__urlmatch_normalization(int argc, const char **argv);\n \n #endif\ndiff --git a/t/helper/test-urlmatch-normalization.c b/t/helper/test-urlmatch-normalization.c\nindex 49b6e836be..8f4d67e646 100644\n--- a/t/helper/test-urlmatch-normalization.c\n+++ b/t/helper/test-urlmatch-normalization.c\n@@ -1,9 +1,10 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"urlmatch.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__urlmatch_normalization(int argc, const char **argv)\n {\n-\tconst char usage[] = \"test-urlmatch-normalization [-p | -l] <url1> | <url1> <url2>\";\n+\tconst char usage[] = \"test-tool urlmatch-normalization [-p | -l] <url1> | <url1> <url2>\";\n \tchar *url1, *url2;\n \tint opt_p = 0, opt_l = 0;\n \ndiff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh\nindex 410d5768ca..f99529d838 100755\n--- a/t/t0110-urlmatch-normalization.sh\n+++ b/t/t0110-urlmatch-normalization.sh\n@@ -9,172 +9,172 @@ tu=\"$TEST_DIRECTORY/t0110/url\"\n # Note that only file: URLs should be allowed without a host\n \n test_expect_success 'url scheme' '\n-\t! test-urlmatch-normalization \"\" &&\n-\t! test-urlmatch-normalization \"_\" &&\n-\t! test-urlmatch-normalization \"scheme\" &&\n-\t! test-urlmatch-normalization \"scheme:\" &&\n-\t! test-urlmatch-normalization \"scheme:/\" &&\n-\t! test-urlmatch-normalization \"scheme://\" &&\n-\t! test-urlmatch-normalization \"file\" &&\n-\t! test-urlmatch-normalization \"file:\" &&\n-\t! test-urlmatch-normalization \"file:/\" &&\n-\ttest-urlmatch-normalization \"file://\" &&\n-\t! test-urlmatch-normalization \"://acme.co\" &&\n-\t! test-urlmatch-normalization \"x_test://acme.co\" &&\n-\t! test-urlmatch-normalization \"-test://acme.co\" &&\n-\t! test-urlmatch-normalization \"0test://acme.co\" &&\n-\t! test-urlmatch-normalization \"+test://acme.co\" &&\n-\t! test-urlmatch-normalization \".test://acme.co\" &&\n-\t! test-urlmatch-normalization \"schem%6e://\" &&\n-\ttest-urlmatch-normalization \"x-Test+v1.0://acme.co\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"AbCdeF://x.Y\")\" = \"abcdef://x.y/\"\n+\t! test-tool urlmatch-normalization \"\" &&\n+\t! test-tool urlmatch-normalization \"_\" &&\n+\t! test-tool urlmatch-normalization \"scheme\" &&\n+\t! test-tool urlmatch-normalization \"scheme:\" &&\n+\t! test-tool urlmatch-normalization \"scheme:/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://\" &&\n+\t! test-tool urlmatch-normalization \"file\" &&\n+\t! test-tool urlmatch-normalization \"file:\" &&\n+\t! test-tool urlmatch-normalization \"file:/\" &&\n+\ttest-tool urlmatch-normalization \"file://\" &&\n+\t! test-tool urlmatch-normalization \"://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"x_test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"-test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"0test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"+test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \".test://acme.co\" &&\n+\t! test-tool urlmatch-normalization \"schem%6e://\" &&\n+\ttest-tool urlmatch-normalization \"x-Test+v1.0://acme.co\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"AbCdeF://x.Y\")\" = \"abcdef://x.y/\"\n '\n \n test_expect_success 'url authority' '\n-\t! test-urlmatch-normalization \"scheme://user:pass@\" &&\n-\t! test-urlmatch-normalization \"scheme://?\" &&\n-\t! test-urlmatch-normalization \"scheme://#\" &&\n-\t! test-urlmatch-normalization \"scheme:///\" &&\n-\t! test-urlmatch-normalization \"scheme://:\" &&\n-\t! test-urlmatch-normalization \"scheme://:555\" &&\n-\ttest-urlmatch-normalization \"file://user:pass@\" &&\n-\ttest-urlmatch-normalization \"file://?\" &&\n-\ttest-urlmatch-normalization \"file://#\" &&\n-\ttest-urlmatch-normalization \"file:///\" &&\n-\ttest-urlmatch-normalization \"file://:\" &&\n-\t! test-urlmatch-normalization \"file://:555\" &&\n-\ttest-urlmatch-normalization \"scheme://user:pass@host\" &&\n-\ttest-urlmatch-normalization \"scheme://@host\" &&\n-\ttest-urlmatch-normalization \"scheme://%00@host\" &&\n-\t! test-urlmatch-normalization \"scheme://%%@host\" &&\n-\t! test-urlmatch-normalization \"scheme://host_\" &&\n-\ttest-urlmatch-normalization \"scheme://user:pass@host/\" &&\n-\ttest-urlmatch-normalization \"scheme://@host/\" &&\n-\ttest-urlmatch-normalization \"scheme://host/\" &&\n-\ttest-urlmatch-normalization \"scheme://host?x\" &&\n-\ttest-urlmatch-normalization \"scheme://host#x\" &&\n-\ttest-urlmatch-normalization \"scheme://host/@\" &&\n-\ttest-urlmatch-normalization \"scheme://host?@x\" &&\n-\ttest-urlmatch-normalization \"scheme://host#@x\" &&\n-\ttest-urlmatch-normalization \"scheme://[::1]\" &&\n-\ttest-urlmatch-normalization \"scheme://[::1]/\" &&\n-\t! test-urlmatch-normalization \"scheme://hos%41/\" &&\n-\ttest-urlmatch-normalization \"scheme://[invalid....:/\" &&\n-\ttest-urlmatch-normalization \"scheme://invalid....:]/\" &&\n-\t! test-urlmatch-normalization \"scheme://invalid....:[/\" &&\n-\t! test-urlmatch-normalization \"scheme://invalid....:[\"\n+\t! test-tool urlmatch-normalization \"scheme://user:pass@\" &&\n+\t! test-tool urlmatch-normalization \"scheme://?\" &&\n+\t! test-tool urlmatch-normalization \"scheme://#\" &&\n+\t! test-tool urlmatch-normalization \"scheme:///\" &&\n+\t! test-tool urlmatch-normalization \"scheme://:\" &&\n+\t! test-tool urlmatch-normalization \"scheme://:555\" &&\n+\ttest-tool urlmatch-normalization \"file://user:pass@\" &&\n+\ttest-tool urlmatch-normalization \"file://?\" &&\n+\ttest-tool urlmatch-normalization \"file://#\" &&\n+\ttest-tool urlmatch-normalization \"file:///\" &&\n+\ttest-tool urlmatch-normalization \"file://:\" &&\n+\t! test-tool urlmatch-normalization \"file://:555\" &&\n+\ttest-tool urlmatch-normalization \"scheme://user:pass@host\" &&\n+\ttest-tool urlmatch-normalization \"scheme://@host\" &&\n+\ttest-tool urlmatch-normalization \"scheme://%00@host\" &&\n+\t! test-tool urlmatch-normalization \"scheme://%%@host\" &&\n+\t! test-tool urlmatch-normalization \"scheme://host_\" &&\n+\ttest-tool urlmatch-normalization \"scheme://user:pass@host/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://@host/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host?x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host#x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host/@\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host?@x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://host#@x\" &&\n+\ttest-tool urlmatch-normalization \"scheme://[::1]\" &&\n+\ttest-tool urlmatch-normalization \"scheme://[::1]/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://hos%41/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://[invalid....:/\" &&\n+\ttest-tool urlmatch-normalization \"scheme://invalid....:]/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://invalid....:[/\" &&\n+\t! test-tool urlmatch-normalization \"scheme://invalid....:[\"\n '\n \n test_expect_success 'url port checks' '\n-\ttest-urlmatch-normalization \"xyz://q@some.host:\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:456/\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:0\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:0000000\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:0000001?\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:065535#\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:65535\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:65536\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:99999\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:100000\" &&\n-\t! test-urlmatch-normalization \"xyz://q@some.host:100001\" &&\n-\ttest-urlmatch-normalization \"http://q@some.host:80\" &&\n-\ttest-urlmatch-normalization \"https://q@some.host:443\" &&\n-\ttest-urlmatch-normalization \"http://q@some.host:80/\" &&\n-\ttest-urlmatch-normalization \"https://q@some.host:443?\" &&\n-\t! test-urlmatch-normalization \"http://q@:8008\" &&\n-\t! test-urlmatch-normalization \"http://:8080\" &&\n-\t! test-urlmatch-normalization \"http://:\" &&\n-\ttest-urlmatch-normalization \"xyz://q@some.host:456/\" &&\n-\ttest-urlmatch-normalization \"xyz://[::1]:456/\" &&\n-\ttest-urlmatch-normalization \"xyz://[::1]:/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:000/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:0%300/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:0x80/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:4294967297/\" &&\n-\t! test-urlmatch-normalization \"xyz://[::1]:030f/\"\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:456/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:0\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:0000000\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:0000001?\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:065535#\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:65535\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:65536\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:99999\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:100000\" &&\n+\t! test-tool urlmatch-normalization \"xyz://q@some.host:100001\" &&\n+\ttest-tool urlmatch-normalization \"http://q@some.host:80\" &&\n+\ttest-tool urlmatch-normalization \"https://q@some.host:443\" &&\n+\ttest-tool urlmatch-normalization \"http://q@some.host:80/\" &&\n+\ttest-tool urlmatch-normalization \"https://q@some.host:443?\" &&\n+\t! test-tool urlmatch-normalization \"http://q@:8008\" &&\n+\t! test-tool urlmatch-normalization \"http://:8080\" &&\n+\t! test-tool urlmatch-normalization \"http://:\" &&\n+\ttest-tool urlmatch-normalization \"xyz://q@some.host:456/\" &&\n+\ttest-tool urlmatch-normalization \"xyz://[::1]:456/\" &&\n+\ttest-tool urlmatch-normalization \"xyz://[::1]:/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:000/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:0%300/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:0x80/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:4294967297/\" &&\n+\t! test-tool urlmatch-normalization \"xyz://[::1]:030f/\"\n '\n \n test_expect_success 'url port normalization' '\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:800\")\" = \"http://x:800/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:0800\")\" = \"http://x:800/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:00000800\")\" = \"http://x:800/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:065535\")\" = \"http://x:65535/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:1\")\" = \"http://x:1/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:80\")\" = \"http://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:080\")\" = \"http://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"http://x:000000080\")\" = \"http://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"https://x:443\")\" = \"https://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"https://x:0443\")\" = \"https://x/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"https://x:000000443\")\" = \"https://x/\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:800\")\" = \"http://x:800/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:0800\")\" = \"http://x:800/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:00000800\")\" = \"http://x:800/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:065535\")\" = \"http://x:65535/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:1\")\" = \"http://x:1/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:80\")\" = \"http://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:080\")\" = \"http://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"http://x:000000080\")\" = \"http://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"https://x:443\")\" = \"https://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"https://x:0443\")\" = \"https://x/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"https://x:000000443\")\" = \"https://x/\"\n '\n \n test_expect_success 'url general escapes' '\n-\t! test-urlmatch-normalization \"http://x.y?%fg\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/%7e%41^%3a\")\" = \"x://w/~A%5E%3A\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/:/?#[]@\")\" = \"x://w/:/?#[]@\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/$&()*+,;=\")\" = \"x://w/$&()*+,;=\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W/'\\''\")\" = \"x://w/'\\''\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"X://W?'\\!'\")\" = \"x://w/?'\\!'\"\n+\t! test-tool urlmatch-normalization \"http://x.y?%fg\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/%7e%41^%3a\")\" = \"x://w/~A%5E%3A\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/:/?#[]@\")\" = \"x://w/:/?#[]@\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/$&()*+,;=\")\" = \"x://w/$&()*+,;=\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W/'\\''\")\" = \"x://w/'\\''\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"X://W?'\\!'\")\" = \"x://w/?'\\!'\"\n '\n \n test_expect_success !MINGW 'url high-bit escapes' '\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-1\")\")\" = \"x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-2\")\")\" = \"x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-3\")\")\" = \"x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-4\")\")\" = \"x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-5\")\")\" = \"x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-6\")\")\" = \"x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-7\")\")\" = \"x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-8\")\")\" = \"x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-9\")\")\" = \"x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-10\")\")\" = \"x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-1\")\")\" = \"x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-2\")\")\" = \"x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-3\")\")\" = \"x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-4\")\")\" = \"x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-5\")\")\" = \"x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-6\")\")\" = \"x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-7\")\")\" = \"x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-8\")\")\" = \"x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-9\")\")\" = \"x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-10\")\")\" = \"x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF\"\n '\n \n test_expect_success 'url utf-8 escapes' '\n-\ttest \"$(test-urlmatch-normalization -p \"$(cat \"$tu-11\")\")\" = \"x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"$(cat \"$tu-11\")\")\" = \"x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD\"\n '\n \n test_expect_success 'url username/password escapes' '\n-\ttest \"$(test-urlmatch-normalization -p \"x://%41%62(^):%70+d@foo\")\" = \"x://Ab(%5E):p+d@foo/\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://%41%62(^):%70+d@foo\")\" = \"x://Ab(%5E):p+d@foo/\"\n '\n \n test_expect_success 'url normalized lengths' '\n-\ttest \"$(test-urlmatch-normalization -l \"Http://%4d%65:%4d^%70@The.Host\")\" = 25 &&\n-\ttest \"$(test-urlmatch-normalization -l \"http://%41:%42@x.y/%61/\")\" = 17 &&\n-\ttest \"$(test-urlmatch-normalization -l \"http://@x.y/^\")\" = 15\n+\ttest \"$(test-tool urlmatch-normalization -l \"Http://%4d%65:%4d^%70@The.Host\")\" = 25 &&\n+\ttest \"$(test-tool urlmatch-normalization -l \"http://%41:%42@x.y/%61/\")\" = 17 &&\n+\ttest \"$(test-tool urlmatch-normalization -l \"http://@x.y/^\")\" = 15\n '\n \n test_expect_success 'url . and .. segments' '\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/.\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/./\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/.\")\" = \"x://y/a\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./\")\" = \"x://y/a/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/.?\")\" = \"x://y/?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/./?\")\" = \"x://y/?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/.?\")\" = \"x://y/a?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./?\")\" = \"x://y/a/?\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./b/.././../c\")\" = \"x://y/c\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./b/../.././c/\")\" = \"x://y/c/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./b/.././../c/././.././.\")\" = \"x://y/\" &&\n-\t! test-urlmatch-normalization \"x://y/a/./b/.././../c/././.././..\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/./?/././..\")\" = \"x://y/a/?/././..\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/%2e/\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/%2E/\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/a/%2e./\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/b/.%2E/\")\" = \"x://y/\" &&\n-\ttest \"$(test-urlmatch-normalization -p \"x://y/c/%2e%2E/\")\" = \"x://y/\"\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/.\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/./\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/.\")\" = \"x://y/a\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./\")\" = \"x://y/a/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/.?\")\" = \"x://y/?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/./?\")\" = \"x://y/?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/.?\")\" = \"x://y/a?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./?\")\" = \"x://y/a/?\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./b/.././../c\")\" = \"x://y/c\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./b/../.././c/\")\" = \"x://y/c/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./b/.././../c/././.././.\")\" = \"x://y/\" &&\n+\t! test-tool urlmatch-normalization \"x://y/a/./b/.././../c/././.././..\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/./?/././..\")\" = \"x://y/a/?/././..\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/%2e/\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/%2E/\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/a/%2e./\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/b/.%2E/\")\" = \"x://y/\" &&\n+\ttest \"$(test-tool urlmatch-normalization -p \"x://y/c/%2e%2E/\")\" = \"x://y/\"\n '\n \n # http://@foo specifies an empty user name but does not specify a password\n # http://foo  specifies neither a user name nor a password\n # So they should not be equivalent\n test_expect_success 'url equivalents' '\n-\ttest-urlmatch-normalization \"httP://x\" \"Http://X/\" &&\n-\ttest-urlmatch-normalization \"Http://%4d%65:%4d^%70@The.Host\" \"hTTP://Me:%4D^p@the.HOST:80/\" &&\n-\t! test-urlmatch-normalization \"https://@x.y/^\" \"httpS://x.y:443/^\" &&\n-\ttest-urlmatch-normalization \"https://@x.y/^\" \"httpS://@x.y:0443/^\" &&\n-\ttest-urlmatch-normalization \"https://@x.y/^/../abc\" \"httpS://@x.y:0443/abc\" &&\n-\ttest-urlmatch-normalization \"https://@x.y/^/..\" \"httpS://@x.y:0443/\"\n+\ttest-tool urlmatch-normalization \"httP://x\" \"Http://X/\" &&\n+\ttest-tool urlmatch-normalization \"Http://%4d%65:%4d^%70@The.Host\" \"hTTP://Me:%4D^p@the.HOST:80/\" &&\n+\t! test-tool urlmatch-normalization \"https://@x.y/^\" \"httpS://x.y:443/^\" &&\n+\ttest-tool urlmatch-normalization \"https://@x.y/^\" \"httpS://@x.y:0443/^\" &&\n+\ttest-tool urlmatch-normalization \"https://@x.y/^/../abc\" \"httpS://@x.y:0443/abc\" &&\n+\ttest-tool urlmatch-normalization \"https://@x.y/^/..\" \"httpS://@x.y:0443/\"\n '\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342787","messageId":"20180324074505.19100-37-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 36/36] t/helper: merge test-write-cache into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:45:05Z","receivedAt":"2018-03-24T07:46:29Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    | 2 +-\n t/helper/test-tool.c        | 1 +\n t/helper/test-tool.h        | 1 +\n t/helper/test-write-cache.c | 3 ++-\n t/perf/p0007-write-cache.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2ab76c6838..8ad9a2a1a9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -686,13 +686,13 @@ TEST_BUILTINS_OBJS += test-submodule-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n TEST_BUILTINS_OBJS += test-wildmatch.o\n+TEST_BUILTINS_OBJS += test-write-cache.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex a804e64048..cd5e28b045 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -41,6 +41,7 @@ static struct test_cmd cmds[] = {\n \t{ \"subprocess\", cmd__subprocess },\n \t{ \"urlmatch-normalization\", cmd__urlmatch_normalization },\n \t{ \"wildmatch\", cmd__wildmatch },\n+\t{ \"write-cache\", cmd__write_cache },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 84c583e68f..7116ddfb94 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -35,5 +35,6 @@ int cmd__submodule_config(int argc, const char **argv);\n int cmd__subprocess(int argc, const char **argv);\n int cmd__urlmatch_normalization(int argc, const char **argv);\n int cmd__wildmatch(int argc, const char **argv);\n+int cmd__write_cache(int argc, const char **argv);\n \n #endif\ndiff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c\nindex b7ee039669..017dc30380 100644\n--- a/t/helper/test-write-cache.c\n+++ b/t/helper/test-write-cache.c\n@@ -1,9 +1,10 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"lockfile.h\"\n \n static struct lock_file index_lock;\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__write_cache(int argc, const char **argv)\n {\n \tint i, cnt = 1, lockfd;\n \tif (argc == 2)\ndiff --git a/t/perf/p0007-write-cache.sh b/t/perf/p0007-write-cache.sh\nindex 261fe92fd9..09595264f0 100755\n--- a/t/perf/p0007-write-cache.sh\n+++ b/t/perf/p0007-write-cache.sh\n@@ -23,7 +23,7 @@ test_expect_success \"setup repo\" '\n \n count=3\n test_perf \"write_locked_index $count times ($nr_files files)\" \"\n-\ttest-write-cache $count\n+\ttest-tool write-cache $count\n \"\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342788","messageId":"20180324074505.19100-33-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 32/36] t/helper: merge test-submodule-config into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:45:01Z","receivedAt":"2018-03-24T07:46:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         |  2 +-\n t/helper/test-submodule-config.c |  3 ++-\n t/helper/test-tool.c             |  1 +\n t/helper/test-tool.h             |  1 +\n t/t7411-submodule-config.sh      | 18 +++++++++---------\n 5 files changed, 14 insertions(+), 11 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6819792c2b..c1dc9ff8d6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -682,6 +682,7 @@ TEST_BUILTINS_OBJS += test-sha1.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n+TEST_BUILTINS_OBJS += test-submodule-config.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -689,7 +690,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\ndiff --git a/t/helper/test-submodule-config.c b/t/helper/test-submodule-config.c\nindex f23db3b19a..5c6e4b010d 100644\n--- a/t/helper/test-submodule-config.c\n+++ b/t/helper/test-submodule-config.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"config.h\"\n #include \"submodule-config.h\"\n@@ -10,7 +11,7 @@ static void die_usage(int argc, const char **argv, const char *msg)\n \texit(1);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__submodule_config(int argc, const char **argv)\n {\n \tconst char **arg = argv;\n \tint my_argc = argc;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 90008533cd..434fedc8d8 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -37,6 +37,7 @@ static struct test_cmd cmds[] = {\n \t{ \"sigchain\", cmd__sigchain },\n \t{ \"strcmp-offset\", cmd__strcmp_offset },\n \t{ \"string-list\", cmd__string_list },\n+\t{ \"submodule-config\", cmd__submodule_config },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 19ad2b0df8..be7e79738f 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -31,5 +31,6 @@ int cmd__sha1(int argc, const char **argv);\n int cmd__sigchain(int argc, const char **argv);\n int cmd__strcmp_offset(int argc, const char **argv);\n int cmd__string_list(int argc, const char **argv);\n+int cmd__submodule_config(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex 46c09c7765..0bde5850ac 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -41,7 +41,7 @@ test_expect_success 'configuration parsing with error' '\n \tEOF\n \t(\n \t\tcd repo &&\n-\t\ttest_must_fail test-submodule-config \"\" s 2>actual &&\n+\t\ttest_must_fail test-tool submodule-config \"\" s 2>actual &&\n \t\ttest_i18ngrep \"bad config\" actual\n \t)\n '\n@@ -55,7 +55,7 @@ EOF\n \n test_expect_success 'test parsing and lookup of submodule config by path' '\n \t(cd super &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD^ a \\\n \t\t\tHEAD b \\\n \t\t\tHEAD^ submodule \\\n@@ -67,7 +67,7 @@ test_expect_success 'test parsing and lookup of submodule config by path' '\n \n test_expect_success 'test parsing and lookup of submodule config by name' '\n \t(cd super &&\n-\t\ttest-submodule-config --name \\\n+\t\ttest-tool submodule-config --name \\\n \t\t\tHEAD^ a \\\n \t\t\tHEAD a \\\n \t\t\tHEAD^ submodule \\\n@@ -89,7 +89,7 @@ test_expect_success 'error in one submodule config lets continue' '\n \t\tgit add .gitmodules &&\n \t\tmv .gitmodules.bak .gitmodules &&\n \t\tgit commit -m \"add error\" &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t>actual &&\n@@ -100,7 +100,7 @@ test_expect_success 'error in one submodule config lets continue' '\n test_expect_success 'error message contains blob reference' '\n \t(cd super &&\n \t\tsha1=$(git rev-parse HEAD) &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t2>actual_err &&\n@@ -114,9 +114,9 @@ test_expect_success 'using different treeishs works' '\n \t\tgit tag new_tag &&\n \t\ttree=$(git rev-parse HEAD^{tree}) &&\n \t\tcommit=$(git rev-parse HEAD^{commit}) &&\n-\t\ttest-submodule-config $commit b >expect &&\n-\t\ttest-submodule-config $tree b >actual.1 &&\n-\t\ttest-submodule-config new_tag b >actual.2 &&\n+\t\ttest-tool submodule-config $commit b >expect &&\n+\t\ttest-tool submodule-config $tree b >actual.1 &&\n+\t\ttest-tool submodule-config new_tag b >actual.2 &&\n \t\ttest_cmp expect actual.1 &&\n \t\ttest_cmp expect actual.2\n \t)\n@@ -130,7 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '\n \t\tgit config --unset -f .gitmodules \\\n \t\t\tsubmodule.submodule.fetchrecursesubmodules &&\n \t\tgit commit -m \"add error in fetchrecursesubmodules\" &&\n-\t\ttest-submodule-config \\\n+\t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t>actual &&\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342789","messageId":"20180324074505.19100-32-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 31/36] t/helper: merge test-string-list into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:45:00Z","receivedAt":"2018-03-24T07:46:36Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                    |  2 +-\n t/helper/test-string-list.c |  3 ++-\n t/helper/test-tool.c        |  1 +\n t/helper/test-tool.h        |  1 +\n t/perf/p0071-sort.sh        |  2 +-\n t/t0063-string-list.sh      | 48 ++++++++++++++++++-------------------\n 6 files changed, 30 insertions(+), 27 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 528a80b6a6..6819792c2b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -681,6 +681,7 @@ TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n+TEST_BUILTINS_OBJS += test-string-list.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n@@ -688,7 +689,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-string-list\n TEST_PROGRAMS_NEED_X += test-submodule-config\n TEST_PROGRAMS_NEED_X += test-subprocess\n TEST_PROGRAMS_NEED_X += test-svn-fe\ndiff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c\nindex 829ec3d7d2..2123dda85b 100644\n--- a/t/helper/test-string-list.c\n+++ b/t/helper/test-string-list.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"string-list.h\"\n \n@@ -41,7 +42,7 @@ static int prefix_cb(struct string_list_item *item, void *cb_data)\n \treturn starts_with(item->string, prefix);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__string_list(int argc, const char **argv)\n {\n \tif (argc == 5 && !strcmp(argv[1], \"split\")) {\n \t\tstruct string_list list = STRING_LIST_INIT_DUP;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 41b8f869ae..90008533cd 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -36,6 +36,7 @@ static struct test_cmd cmds[] = {\n \t{ \"sha1\", cmd__sha1 },\n \t{ \"sigchain\", cmd__sigchain },\n \t{ \"strcmp-offset\", cmd__strcmp_offset },\n+\t{ \"string-list\", cmd__string_list },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 035e82ec6a..19ad2b0df8 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -30,5 +30,6 @@ int cmd__sha1_array(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n int cmd__sigchain(int argc, const char **argv);\n int cmd__strcmp_offset(int argc, const char **argv);\n+int cmd__string_list(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0071-sort.sh b/t/perf/p0071-sort.sh\nindex 7c9a35a646..6e924f5fa3 100755\n--- a/t/perf/p0071-sort.sh\n+++ b/t/perf/p0071-sort.sh\n@@ -16,7 +16,7 @@ test_perf 'sort(1)' '\n '\n \n test_perf 'string_list_sort()' '\n-\ttest-string-list sort <unsorted >actual\n+\ttest-tool string-list sort <unsorted >actual\n '\n \n test_expect_success 'string_list_sort() sorts like sort(1)' '\ndiff --git a/t/t0063-string-list.sh b/t/t0063-string-list.sh\nindex dbfc05ebdc..c6ee9f66b1 100755\n--- a/t/t0063-string-list.sh\n+++ b/t/t0063-string-list.sh\n@@ -10,9 +10,9 @@ test_description='Test string list functionality'\n test_split () {\n \tcat >expected &&\n \ttest_expect_success \"split $1 at $2, max $3\" \"\n-\t\ttest-string-list split '$1' '$2' '$3' >actual &&\n+\t\ttest-tool string-list split '$1' '$2' '$3' >actual &&\n \t\ttest_cmp expected actual &&\n-\t\ttest-string-list split_in_place '$1' '$2' '$3' >actual &&\n+\t\ttest-tool string-list split_in_place '$1' '$2' '$3' >actual &&\n \t\ttest_cmp expected actual\n \t\"\n }\n@@ -61,31 +61,31 @@ test_split \":\" \":\" \"-1\" <<EOF\n EOF\n \n test_expect_success \"test filter_string_list\" '\n-\ttest \"x-\" = \"x$(test-string-list filter - y)\" &&\n-\ttest \"x-\" = \"x$(test-string-list filter no y)\" &&\n-\ttest yes = \"$(test-string-list filter yes y)\" &&\n-\ttest yes = \"$(test-string-list filter no:yes y)\" &&\n-\ttest yes = \"$(test-string-list filter yes:no y)\" &&\n-\ttest y1:y2 = \"$(test-string-list filter y1:y2 y)\" &&\n-\ttest y2:y1 = \"$(test-string-list filter y2:y1 y)\" &&\n-\ttest \"x-\" = \"x$(test-string-list filter x1:x2 y)\"\n+\ttest \"x-\" = \"x$(test-tool string-list filter - y)\" &&\n+\ttest \"x-\" = \"x$(test-tool string-list filter no y)\" &&\n+\ttest yes = \"$(test-tool string-list filter yes y)\" &&\n+\ttest yes = \"$(test-tool string-list filter no:yes y)\" &&\n+\ttest yes = \"$(test-tool string-list filter yes:no y)\" &&\n+\ttest y1:y2 = \"$(test-tool string-list filter y1:y2 y)\" &&\n+\ttest y2:y1 = \"$(test-tool string-list filter y2:y1 y)\" &&\n+\ttest \"x-\" = \"x$(test-tool string-list filter x1:x2 y)\"\n '\n \n test_expect_success \"test remove_duplicates\" '\n-\ttest \"x-\" = \"x$(test-string-list remove_duplicates -)\" &&\n-\ttest \"x\" = \"x$(test-string-list remove_duplicates \"\")\" &&\n-\ttest a = \"$(test-string-list remove_duplicates a)\" &&\n-\ttest a = \"$(test-string-list remove_duplicates a:a)\" &&\n-\ttest a = \"$(test-string-list remove_duplicates a:a:a:a:a)\" &&\n-\ttest a:b = \"$(test-string-list remove_duplicates a:b)\" &&\n-\ttest a:b = \"$(test-string-list remove_duplicates a:a:b)\" &&\n-\ttest a:b = \"$(test-string-list remove_duplicates a:b:b)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:b:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:a:b:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:b:b:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:b:c:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:a:b:b:c:c)\" &&\n-\ttest a:b:c = \"$(test-string-list remove_duplicates a:a:a:b:b:b:c:c:c)\"\n+\ttest \"x-\" = \"x$(test-tool string-list remove_duplicates -)\" &&\n+\ttest \"x\" = \"x$(test-tool string-list remove_duplicates \"\")\" &&\n+\ttest a = \"$(test-tool string-list remove_duplicates a)\" &&\n+\ttest a = \"$(test-tool string-list remove_duplicates a:a)\" &&\n+\ttest a = \"$(test-tool string-list remove_duplicates a:a:a:a:a)\" &&\n+\ttest a:b = \"$(test-tool string-list remove_duplicates a:b)\" &&\n+\ttest a:b = \"$(test-tool string-list remove_duplicates a:a:b)\" &&\n+\ttest a:b = \"$(test-tool string-list remove_duplicates a:b:b)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:b:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:a:b:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:b:b:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:b:c:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:a:b:b:c:c)\" &&\n+\ttest a:b:c = \"$(test-tool string-list remove_duplicates a:a:a:b:b:b:c:c:c)\"\n '\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342790","messageId":"20180324074505.19100-16-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 15/36] t/helper: merge test-index-version into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:44Z","receivedAt":"2018-03-24T07:46:41Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                              | 2 +-\n t/helper/test-index-version.c         | 3 ++-\n t/helper/test-tool.c                  | 1 +\n t/helper/test-tool.h                  | 1 +\n t/t1600-index.sh                      | 2 +-\n t/t1700-split-index.sh                | 2 +-\n t/t2104-update-index-skip-worktree.sh | 6 +++---\n 7 files changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f6c3ddc703..d7342e3a8b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -663,13 +663,13 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-hashmap.o\n+TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n-TEST_PROGRAMS_NEED_X += test-index-version\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\ndiff --git a/t/helper/test-index-version.c b/t/helper/test-index-version.c\nindex f569f6b7ef..fcd10968cc 100644\n--- a/t/helper/test-index-version.c\n+++ b/t/helper/test-index-version.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__index_version(int argc, const char **argv)\n {\n \tstruct cache_header hdr;\n \tint version;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex b9a6e7cbaa..88fbe8ddbd 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -18,6 +18,7 @@ static struct test_cmd cmds[] = {\n \t{ \"example-decorate\", cmd__example_decorate },\n \t{ \"genrandom\", cmd__genrandom },\n \t{ \"hashmap\", cmd__hashmap },\n+\t{ \"index-version\", cmd__index_version },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex fba4bd80b9..b855203477 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -12,6 +12,7 @@ int cmd__dump_split_index(int argc, const char **argv);\n int cmd__example_decorate(int argc, const char **argv);\n int cmd__genrandom(int argc, const char **argv);\n int cmd__hashmap(int argc, const char **argv);\n+int cmd__index_version(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t1600-index.sh b/t/t1600-index.sh\nindex 079d241145..c4422312f4 100755\n--- a/t/t1600-index.sh\n+++ b/t/t1600-index.sh\n@@ -68,7 +68,7 @@ test_expect_success 'GIT_INDEX_VERSION takes precedence over config' '\n \t\tgit config --add index.version 2 &&\n \t\tgit add a 2>&1 &&\n \t\techo 4 >expect &&\n-\t\ttest-index-version <.git/index >actual &&\n+\t\ttest-tool index-version <.git/index >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex ec179fbaf7..e4f4c4df4e 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -12,7 +12,7 @@ test_expect_success 'enable split index' '\n \tgit config splitIndex.maxPercentChange 100 &&\n \tgit update-index --split-index &&\n \ttest-tool dump-split-index .git/index >actual &&\n-\tindexversion=$(test-index-version <.git/index) &&\n+\tindexversion=$(test-tool index-version <.git/index) &&\n \tif test \"$indexversion\" = \"4\"\n \tthen\n \t\town=432ef4b63f32193984f339431fd50ca796493569\ndiff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh\nindex cc830da58d..7e2e7dd4ae 100755\n--- a/t/t2104-update-index-skip-worktree.sh\n+++ b/t/t2104-update-index-skip-worktree.sh\n@@ -33,7 +33,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'index is at version 2' '\n-\ttest \"$(test-index-version < .git/index)\" = 2\n+\ttest \"$(test-tool index-version < .git/index)\" = 2\n '\n \n test_expect_success 'update-index --skip-worktree' '\n@@ -42,7 +42,7 @@ test_expect_success 'update-index --skip-worktree' '\n '\n \n test_expect_success 'index is at version 3 after having some skip-worktree entries' '\n-\ttest \"$(test-index-version < .git/index)\" = 3\n+\ttest \"$(test-tool index-version < .git/index)\" = 3\n '\n \n test_expect_success 'ls-files -t' '\n@@ -55,7 +55,7 @@ test_expect_success 'update-index --no-skip-worktree' '\n '\n \n test_expect_success 'index version is back to 2 when there is no skip-worktree entry' '\n-\ttest \"$(test-index-version < .git/index)\" = 2\n+\ttest \"$(test-tool index-version < .git/index)\" = 2\n '\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342791","messageId":"20180324074505.19100-26-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 25/36] t/helper: merge test-revision-walking into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:54Z","receivedAt":"2018-03-24T07:46:42Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         | 2 +-\n t/helper/test-revision-walking.c | 3 ++-\n t/helper/test-tool.c             | 1 +\n t/helper/test-tool.h             | 1 +\n t/t0062-revision-walking.sh      | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7444c00bbb..3ed461cd55 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -674,6 +674,7 @@ TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-regex.o\n+TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -682,7 +683,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n TEST_PROGRAMS_NEED_X += test-sha1-array\ndiff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c\nindex b8e6fe1d00..4f8bc75821 100644\n--- a/t/helper/test-revision-walking.c\n+++ b/t/helper/test-revision-walking.c\n@@ -8,6 +8,7 @@\n  * published by the Free Software Foundation.\n  */\n \n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n@@ -45,7 +46,7 @@ static int run_revision_walk(void)\n \treturn got_revision;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__revision_walking(int argc, const char **argv)\n {\n \tif (argc < 2)\n \t\treturn 1;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 0dd3b879ad..e43405bea9 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -29,6 +29,7 @@ static struct test_cmd cmds[] = {\n \t{ \"read-cache\", cmd__read_cache },\n \t{ \"ref-store\", cmd__ref_store },\n \t{ \"regex\", cmd__regex },\n+\t{ \"revision-walking\", cmd__revision_walking },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 5f73c83ac0..4dff220646 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -23,6 +23,7 @@ int cmd__prio_queue(int argc, const char **argv);\n int cmd__read_cache(int argc, const char **argv);\n int cmd__ref_store(int argc, const char **argv);\n int cmd__regex(int argc, const char **argv);\n+int cmd__revision_walking(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0062-revision-walking.sh b/t/t0062-revision-walking.sh\nindex 113c728e67..8e215867b8 100755\n--- a/t/t0062-revision-walking.sh\n+++ b/t/t0062-revision-walking.sh\n@@ -26,7 +26,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'revision walking can be done twice' '\n-\ttest-revision-walking run-twice >run_twice_actual &&\n+\ttest-tool revision-walking run-twice >run_twice_actual &&\n \ttest_cmp run_twice_expected run_twice_actual\n '\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342792","messageId":"20180324074505.19100-19-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 18/36] t/helper: merge test-mktemp into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:47Z","receivedAt":"2018-03-24T07:46:46Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile               | 2 +-\n t/helper/test-mktemp.c | 3 ++-\n t/helper/test-tool.c   | 1 +\n t/helper/test-tool.h   | 1 +\n t/t0070-fundamental.sh | 4 ++--\n 5 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 67f37b849e..3145a9b1b2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -667,13 +667,13 @@ TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n+TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-mktemp\n TEST_PROGRAMS_NEED_X += test-online-cpus\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-path-utils\ndiff --git a/t/helper/test-mktemp.c b/t/helper/test-mktemp.c\nindex 89d9b2f7be..2290688940 100644\n--- a/t/helper/test-mktemp.c\n+++ b/t/helper/test-mktemp.c\n@@ -1,9 +1,10 @@\n /*\n  * test-mktemp.c: code to exercise the creation of temporary files\n  */\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__mktemp(int argc, const char **argv)\n {\n \tif (argc != 2)\n \t\tusage(\"Expected 1 parameter defining the temporary file template\");\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 7ec0e8efe5..fd3bf560d4 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -22,6 +22,7 @@ static struct test_cmd cmds[] = {\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"match-trees\", cmd__match_trees },\n \t{ \"mergesort\", cmd__mergesort },\n+\t{ \"mktemp\", cmd__mktemp },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 6c9437ff5e..cf2598798a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -16,6 +16,7 @@ int cmd__index_version(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__match_trees(int argc, const char **argv);\n int cmd__mergesort(int argc, const char **argv);\n+int cmd__mktemp(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex 70d4d98a2e..ac007938ee 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -13,7 +13,7 @@ test_expect_success 'character classes (isspace, isalpha etc.)' '\n '\n \n test_expect_success 'mktemp to nonexistent directory prints filename' '\n-\ttest_must_fail test-mktemp doesnotexist/testXXXXXX 2>err &&\n+\ttest_must_fail test-tool mktemp doesnotexist/testXXXXXX 2>err &&\n \tgrep \"doesnotexist/test\" err\n '\n \n@@ -21,7 +21,7 @@ test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints file\n \tmkdir cannotwrite &&\n \tchmod -w cannotwrite &&\n \ttest_when_finished \"chmod +w cannotwrite\" &&\n-\ttest_must_fail test-mktemp cannotwrite/testXXXXXX 2>err &&\n+\ttest_must_fail test-tool mktemp cannotwrite/testXXXXXX 2>err &&\n \tgrep \"cannotwrite/test\" err\n '\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342793","messageId":"20180324074505.19100-25-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 24/36] t/helper: merge test-regex into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:53Z","receivedAt":"2018-03-24T07:46:47Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                        | 2 +-\n t/helper/test-regex.c           | 7 ++++---\n t/helper/test-tool.c            | 1 +\n t/helper/test-tool.h            | 1 +\n t/t0070-fundamental.sh          | 2 +-\n t/t7812-grep-icase-non-ascii.sh | 2 +-\n 6 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 20080fddb8..7444c00bbb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -673,6 +673,7 @@ TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n+TEST_BUILTINS_OBJS += test-regex.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -681,7 +682,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\ndiff --git a/t/helper/test-regex.c b/t/helper/test-regex.c\nindex b5ea8a97c5..10284cc56f 100644\n--- a/t/helper/test-regex.c\n+++ b/t/helper/test-regex.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n \n@@ -36,7 +37,7 @@ static int test_regex_bug(void)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__regex(int argc, const char **argv)\n {\n \tconst char *pat;\n \tconst char *str;\n@@ -47,8 +48,8 @@ int cmd_main(int argc, const char **argv)\n \tif (argc == 2 && !strcmp(argv[1], \"--bug\"))\n \t\treturn test_regex_bug();\n \telse if (argc < 3)\n-\t\tusage(\"test-regex --bug\\n\"\n-\t\t      \"test-regex <pattern> <string> [<options>]\");\n+\t\tusage(\"test-tool regex --bug\\n\"\n+\t\t      \"test-tool regex <pattern> <string> [<options>]\");\n \n \targv++;\n \tpat = *argv++;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 777150e4ad..0dd3b879ad 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -28,6 +28,7 @@ static struct test_cmd cmds[] = {\n \t{ \"prio-queue\", cmd__prio_queue },\n \t{ \"read-cache\", cmd__read_cache },\n \t{ \"ref-store\", cmd__ref_store },\n+\t{ \"regex\", cmd__regex },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 2b5cc6e117..5f73c83ac0 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -22,6 +22,7 @@ int cmd__path_utils(int argc, const char **argv);\n int cmd__prio_queue(int argc, const char **argv);\n int cmd__read_cache(int argc, const char **argv);\n int cmd__ref_store(int argc, const char **argv);\n+int cmd__regex(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex ac007938ee..23fbe6434a 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -31,7 +31,7 @@ test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '\n \n test_expect_success 'check for a bug in the regex routines' '\n \t# if this test fails, re-build git with NO_REGEX=1\n-\ttest-regex --bug\n+\ttest-tool regex --bug\n '\n \n test_done\ndiff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh\nindex 0059a1f837..0c685d3598 100755\n--- a/t/t7812-grep-icase-non-ascii.sh\n+++ b/t/t7812-grep-icase-non-ascii.sh\n@@ -12,7 +12,7 @@ test_expect_success GETTEXT_LOCALE 'setup' '\n '\n \n test_have_prereq GETTEXT_LOCALE &&\n-test-regex \"HALLÓ\" \"Halló\" ICASE &&\n+test-tool regex \"HALLÓ\" \"Halló\" ICASE &&\n test_set_prereq REGEX_LOCALE\n \n test_expect_success REGEX_LOCALE 'grep literal string, no -F' '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342794","messageId":"20180324074505.19100-24-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 23/36] t/helper: merge test-ref-store into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:52Z","receivedAt":"2018-03-24T07:46:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                       | 2 +-\n t/helper/test-ref-store.c      | 3 ++-\n t/helper/test-tool.c           | 1 +\n t/helper/test-tool.h           | 1 +\n t/t1405-main-ref-store.sh      | 2 +-\n t/t1406-submodule-ref-store.sh | 2 +-\n t/t1407-worktree-ref-store.sh  | 4 ++--\n 7 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 393fb9aca4..20080fddb8 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -672,6 +672,7 @@ TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n+TEST_BUILTINS_OBJS += test-ref-store.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -680,7 +681,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-write-cache\n-TEST_PROGRAMS_NEED_X += test-ref-store\n TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex 7120634b04..cdefb66a87 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"refs.h\"\n #include \"worktree.h\"\n@@ -274,7 +275,7 @@ static struct command commands[] = {\n \t{ NULL, NULL }\n };\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__ref_store(int argc, const char **argv)\n {\n \tstruct ref_store *refs;\n \tconst char *func;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex f64355c25c..777150e4ad 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -27,6 +27,7 @@ static struct test_cmd cmds[] = {\n \t{ \"path-utils\", cmd__path_utils },\n \t{ \"prio-queue\", cmd__prio_queue },\n \t{ \"read-cache\", cmd__read_cache },\n+\t{ \"ref-store\", cmd__ref_store },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 4d51c17f5a..2b5cc6e117 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -21,6 +21,7 @@ int cmd__online_cpus(int argc, const char **argv);\n int cmd__path_utils(int argc, const char **argv);\n int cmd__prio_queue(int argc, const char **argv);\n int cmd__read_cache(int argc, const char **argv);\n+int cmd__ref_store(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh\nindex e8115df5ba..a30a080b20 100755\n--- a/t/t1405-main-ref-store.sh\n+++ b/t/t1405-main-ref-store.sh\n@@ -4,7 +4,7 @@ test_description='test main ref store api'\n \n . ./test-lib.sh\n \n-RUN=\"test-ref-store main\"\n+RUN=\"test-tool ref-store main\"\n \n test_expect_success 'pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' '\n \ttest_commit one &&\ndiff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh\nindex c32d4cc465..e093782cc3 100755\n--- a/t/t1406-submodule-ref-store.sh\n+++ b/t/t1406-submodule-ref-store.sh\n@@ -4,7 +4,7 @@ test_description='test submodule ref store api'\n \n . ./test-lib.sh\n \n-RUN=\"test-ref-store submodule:sub\"\n+RUN=\"test-tool ref-store submodule:sub\"\n \n test_expect_success 'setup' '\n \tgit init sub &&\ndiff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\nindex 8842d0329f..2211f9831f 100755\n--- a/t/t1407-worktree-ref-store.sh\n+++ b/t/t1407-worktree-ref-store.sh\n@@ -4,8 +4,8 @@ test_description='test worktree ref store api'\n \n . ./test-lib.sh\n \n-RWT=\"test-ref-store worktree:wt\"\n-RMAIN=\"test-ref-store worktree:main\"\n+RWT=\"test-tool ref-store worktree:wt\"\n+RMAIN=\"test-tool ref-store worktree:main\"\n \n test_expect_success 'setup' '\n \ttest_commit first &&\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342795","messageId":"20180324074505.19100-18-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 17/36] t/helper: merge (unused) test-mergesort into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:46Z","receivedAt":"2018-03-24T07:47:12Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  | 2 +-\n t/helper/test-mergesort.c | 3 ++-\n t/helper/test-tool.c      | 1 +\n t/helper/test-tool.h      | 1 +\n 4 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6552a8f4ed..67f37b849e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -666,13 +666,13 @@ TEST_BUILTINS_OBJS += test-hashmap.o\n TEST_BUILTINS_OBJS += test-index-version.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-match-trees.o\n+TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-mergesort\n TEST_PROGRAMS_NEED_X += test-mktemp\n TEST_PROGRAMS_NEED_X += test-online-cpus\n TEST_PROGRAMS_NEED_X += test-parse-options\ndiff --git a/t/helper/test-mergesort.c b/t/helper/test-mergesort.c\nindex 335cf6b626..c5cffaa4b7 100644\n--- a/t/helper/test-mergesort.c\n+++ b/t/helper/test-mergesort.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"mergesort.h\"\n \n@@ -22,7 +23,7 @@ static int compare_strings(const void *a, const void *b)\n \treturn strcmp(x->text, y->text);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__mergesort(int argc, const char **argv)\n {\n \tstruct line *line, *p = NULL, *lines = NULL;\n \tstruct strbuf sb = STRBUF_INIT;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 3653646f3a..7ec0e8efe5 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -21,6 +21,7 @@ static struct test_cmd cmds[] = {\n \t{ \"index-version\", cmd__index_version },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"match-trees\", cmd__match_trees },\n+\t{ \"mergesort\", cmd__mergesort },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex d2f009cb3e..6c9437ff5e 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -15,6 +15,7 @@ int cmd__hashmap(int argc, const char **argv);\n int cmd__index_version(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__match_trees(int argc, const char **argv);\n+int cmd__mergesort(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342796","messageId":"20180324074505.19100-23-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 22/36] t/helper: merge test-read-cache into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:51Z","receivedAt":"2018-03-24T07:47:15Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   | 2 +-\n t/helper/test-read-cache.c | 3 ++-\n t/helper/test-tool.c       | 1 +\n t/helper/test-tool.h       | 1 +\n t/perf/p0002-read-cache.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 076c778494..393fb9aca4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -671,6 +671,7 @@ TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n+TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -678,7 +679,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-read-cache\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-ref-store\n TEST_PROGRAMS_NEED_X += test-regex\ndiff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c\nindex 48255eef31..d674c88ba0 100644\n--- a/t/helper/test-read-cache.c\n+++ b/t/helper/test-read-cache.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__read_cache(int argc, const char **argv)\n {\n \tint i, cnt = 1;\n \tif (argc == 2)\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex be5f784865..f64355c25c 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -26,6 +26,7 @@ static struct test_cmd cmds[] = {\n \t{ \"online-cpus\", cmd__online_cpus },\n \t{ \"path-utils\", cmd__path_utils },\n \t{ \"prio-queue\", cmd__prio_queue },\n+\t{ \"read-cache\", cmd__read_cache },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 900c96dc02..4d51c17f5a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -20,6 +20,7 @@ int cmd__mktemp(int argc, const char **argv);\n int cmd__online_cpus(int argc, const char **argv);\n int cmd__path_utils(int argc, const char **argv);\n int cmd__prio_queue(int argc, const char **argv);\n+int cmd__read_cache(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0002-read-cache.sh b/t/perf/p0002-read-cache.sh\nindex 9180ae9343..cdd105a594 100755\n--- a/t/perf/p0002-read-cache.sh\n+++ b/t/perf/p0002-read-cache.sh\n@@ -8,7 +8,7 @@ test_perf_default_repo\n \n count=1000\n test_perf \"read_cache/discard_cache $count times\" \"\n-\ttest-read-cache $count\n+\ttest-tool read-cache $count\n \"\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342797","messageId":"20180324074505.19100-20-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 19/36] t/helper: merge test-online-cpus into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:48Z","receivedAt":"2018-03-24T07:47:36Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                                | 2 +-\n t/helper/test-online-cpus.c             | 3 ++-\n t/helper/test-tool.c                    | 1 +\n t/helper/test-tool.h                    | 1 +\n t/t3008-ls-files-lazy-init-name-hash.sh | 2 +-\n 5 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3145a9b1b2..91af906d08 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -668,13 +668,13 @@ TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n+TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-online-cpus\n TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-path-utils\n TEST_PROGRAMS_NEED_X += test-prio-queue\ndiff --git a/t/helper/test-online-cpus.c b/t/helper/test-online-cpus.c\nindex 06c09c6b88..8cb0d53840 100644\n--- a/t/helper/test-online-cpus.c\n+++ b/t/helper/test-online-cpus.c\n@@ -1,7 +1,8 @@\n+#include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"thread-utils.h\"\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__online_cpus(int argc, const char **argv)\n {\n \tprintf(\"%d\\n\", online_cpus());\n \treturn 0;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex fd3bf560d4..8f78d61b68 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -23,6 +23,7 @@ static struct test_cmd cmds[] = {\n \t{ \"match-trees\", cmd__match_trees },\n \t{ \"mergesort\", cmd__mergesort },\n \t{ \"mktemp\", cmd__mktemp },\n+\t{ \"online-cpus\", cmd__online_cpus },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex cf2598798a..aeabc9740f 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -17,6 +17,7 @@ int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__match_trees(int argc, const char **argv);\n int cmd__mergesort(int argc, const char **argv);\n int cmd__mktemp(int argc, const char **argv);\n+int cmd__online_cpus(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh\nindex 8df4aa7c99..08af596ba6 100755\n--- a/t/t3008-ls-files-lazy-init-name-hash.sh\n+++ b/t/t3008-ls-files-lazy-init-name-hash.sh\n@@ -4,7 +4,7 @@ test_description='Test the lazy init name hash with various folder structures'\n \n . ./test-lib.sh\n \n-if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-online-cpus)\n+if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus)\n then\n \tskip_all='skipping lazy-init tests, single cpu'\n \ttest_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342798","messageId":"20180324074505.19100-11-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 10/36] t/helper: merge test-dump-cache-tree into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:39Z","receivedAt":"2018-03-24T07:47:37Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                        | 2 +-\n t/helper/test-dump-cache-tree.c | 3 ++-\n t/helper/test-tool.c            | 1 +\n t/helper/test-tool.h            | 1 +\n t/t0090-cache-tree.sh           | 6 +++---\n t/t1700-split-index.sh          | 2 +-\n 6 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex edd9c43982..991bafa6fb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -658,10 +658,10 @@ TEST_BUILTINS_OBJS += test-ctype.o\n TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n+TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n-TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-dump-split-index\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\ndiff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\nindex ebf3aab22d..98a4891f1d 100644\n--- a/t/helper/test-dump-cache-tree.c\n+++ b/t/helper/test-dump-cache-tree.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"tree.h\"\n #include \"cache-tree.h\"\n@@ -54,7 +55,7 @@ static int dump_cache_tree(struct cache_tree *it,\n \treturn errs;\n }\n \n-int cmd_main(int ac, const char **av)\n+int cmd__dump_cache_tree(int ac, const char **av)\n {\n \tstruct index_state istate;\n \tstruct cache_tree *another = cache_tree();\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex b6f648d387..3d8d9ed1ce 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -13,6 +13,7 @@ static struct test_cmd cmds[] = {\n \t{ \"date\", cmd__date },\n \t{ \"delta\", cmd__delta },\n \t{ \"drop-caches\", cmd__drop_caches },\n+\t{ \"dump-cache-tree\", cmd__dump_cache_tree },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex f585b7776e..2a0d034adf 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -7,6 +7,7 @@ int cmd__ctype(int argc, const char **argv);\n int cmd__date(int argc, const char **argv);\n int cmd__delta(int argc, const char **argv);\n int cmd__drop_caches(int argc, const char **argv);\n+int cmd__dump_cache_tree(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex adfd4f0b5e..f81e3deead 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -8,13 +8,13 @@ cache-tree extension.\n  . ./test-lib.sh\n \n cmp_cache_tree () {\n-\ttest-dump-cache-tree | sed -e '/#(ref)/d' >actual &&\n+\ttest-tool dump-cache-tree | sed -e '/#(ref)/d' >actual &&\n \tsed \"s/$_x40/SHA/\" <actual >filtered &&\n \ttest_cmp \"$1\" filtered\n }\n \n # We don't bother with actually checking the SHA1:\n-# test-dump-cache-tree already verifies that all existing data is\n+# test-tool dump-cache-tree already verifies that all existing data is\n # correct.\n generate_expected_cache_tree_rec () {\n \tdir=\"$1${1:+/}\" &&\n@@ -47,7 +47,7 @@ test_cache_tree () {\n \n test_invalid_cache_tree () {\n \tprintf \"invalid                                  %s ()\\n\" \"\" \"$@\" >expect &&\n-\ttest-dump-cache-tree |\n+\ttest-tool dump-cache-tree |\n \tsed -n -e \"s/[0-9]* subtrees//\" -e '/#(ref)/d' -e '/^invalid /p' >actual &&\n \ttest_cmp expect actual\n }\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex 4b5d443280..b778975de8 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -435,7 +435,7 @@ test_expect_success 'writing split index with null sha1 does not write cache tre\n \tcommit=$(git commit-tree $tree -p HEAD <msg) &&\n \tgit update-ref HEAD \"$commit\" &&\n \tGIT_ALLOW_NULL_SHA1=1 git reset --hard &&\n-\t(test-dump-cache-tree >cache-tree.out || true) &&\n+\t(test-tool dump-cache-tree >cache-tree.out || true) &&\n \ttest_line_count = 0 cache-tree.out\n '\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342799","messageId":"20180324074505.19100-12-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 11/36] t/helper: merge test-dump-split-index into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:40Z","receivedAt":"2018-03-24T07:47:41Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                         |  2 +-\n t/helper/test-dump-split-index.c |  3 +-\n t/helper/test-tool.c             |  1 +\n t/helper/test-tool.h             |  1 +\n t/t0090-cache-tree.sh            |  4 +--\n t/t1700-split-index.sh           | 48 ++++++++++++++++----------------\n 6 files changed, 31 insertions(+), 28 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 991bafa6fb..8993cec274 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -659,11 +659,11 @@ TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n+TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n-TEST_PROGRAMS_NEED_X += test-dump-split-index\n TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-example-decorate\n TEST_PROGRAMS_NEED_X += test-fake-ssh\ndiff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c\nindex e44430b699..4e2fdb5e30 100644\n--- a/t/helper/test-dump-split-index.c\n+++ b/t/helper/test-dump-split-index.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"split-index.h\"\n #include \"ewah/ewok.h\"\n@@ -7,7 +8,7 @@ static void show_bit(size_t pos, void *data)\n \tprintf(\" %d\", (int)pos);\n }\n \n-int cmd_main(int ac, const char **av)\n+int cmd__dump_split_index(int ac, const char **av)\n {\n \tstruct split_index *si;\n \tint i;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 3d8d9ed1ce..26ae209cd5 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -14,6 +14,7 @@ static struct test_cmd cmds[] = {\n \t{ \"delta\", cmd__delta },\n \t{ \"drop-caches\", cmd__drop_caches },\n \t{ \"dump-cache-tree\", cmd__dump_cache_tree },\n+\t{ \"dump-split-index\", cmd__dump_split_index },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 2a0d034adf..e8363e851f 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -8,6 +8,7 @@ int cmd__date(int argc, const char **argv);\n int cmd__delta(int argc, const char **argv);\n int cmd__drop_caches(int argc, const char **argv);\n int cmd__dump_cache_tree(int argc, const char **argv);\n+int cmd__dump_split_index(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex f81e3deead..3266209e41 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -246,9 +246,9 @@ test_expect_success 'switching trees does not invalidate shared index' '\n \tgit update-index --split-index &&\n \t>split &&\n \tgit add split &&\n-\ttest-dump-split-index .git/index | grep -v ^own >before &&\n+\ttest-tool dump-split-index .git/index | grep -v ^own >before &&\n \tgit commit -m \"as-is\" &&\n-\ttest-dump-split-index .git/index | grep -v ^own >after &&\n+\ttest-tool dump-split-index .git/index | grep -v ^own >after &&\n \ttest_cmp before after\n '\n \ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex b778975de8..ec179fbaf7 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -11,7 +11,7 @@ sane_unset GIT_FSMONITOR_TEST\n test_expect_success 'enable split index' '\n \tgit config splitIndex.maxPercentChange 100 &&\n \tgit update-index --split-index &&\n-\ttest-dump-split-index .git/index >actual &&\n+\ttest-tool dump-split-index .git/index >actual &&\n \tindexversion=$(test-index-version <.git/index) &&\n \tif test \"$indexversion\" = \"4\"\n \tthen\n@@ -39,7 +39,7 @@ test_expect_success 'add one file' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tbase $base\n \t100644 $EMPTY_BLOB 0\tone\n@@ -57,8 +57,8 @@ test_expect_success 'disable split index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\tBASE=$(test-dump-split-index .git/index | grep \"^own\" | sed \"s/own/base/\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^own\" | sed \"s/own/base/\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tnot a split index\n \tEOF\n@@ -73,7 +73,7 @@ test_expect_success 'enable split index again, \"one\" now belongs to base index\"'\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -91,7 +91,7 @@ test_expect_success 'modify original file, base index untouched' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tq_to_tab >expect <<-EOF &&\n \t$BASE\n \t100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q\n@@ -111,7 +111,7 @@ test_expect_success 'add another file, which stays index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tq_to_tab >expect <<-EOF &&\n \t$BASE\n \t100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q\n@@ -130,7 +130,7 @@ test_expect_success 'remove file not in base index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tq_to_tab >expect <<-EOF &&\n \t$BASE\n \t100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q\n@@ -147,7 +147,7 @@ test_expect_success 'remove file in base index' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -165,7 +165,7 @@ test_expect_success 'add original file back' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \t100644 $EMPTY_BLOB 0\tone\n@@ -195,7 +195,7 @@ test_expect_success 'unify index, two files remain' '\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n \n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tnot a split index\n \tEOF\n@@ -229,8 +229,8 @@ test_expect_success 'set core.splitIndex config variable to true' '\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\ttwo\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -248,7 +248,7 @@ test_expect_success 'set core.splitIndex config variable to false' '\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\ttwo\n \tEOF\n \ttest_cmp ls-files.expect ls-files.actual &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \tnot a split index\n \tEOF\n@@ -259,8 +259,8 @@ test_expect_success 'set core.splitIndex config variable to true' '\n \tgit config core.splitIndex true &&\n \t: >three &&\n \tgit update-index --add three &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -269,7 +269,7 @@ test_expect_success 'set core.splitIndex config variable to true' '\n \ttest_cmp expect actual &&\n \t: >four &&\n \tgit update-index --add four &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tfour\n@@ -283,8 +283,8 @@ test_expect_success 'check behavior with splitIndex.maxPercentChange unset' '\n \tgit config --unset splitIndex.maxPercentChange &&\n \t: >five &&\n \tgit update-index --add five &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -293,7 +293,7 @@ test_expect_success 'check behavior with splitIndex.maxPercentChange unset' '\n \ttest_cmp expect actual &&\n \t: >six &&\n \tgit update-index --add six &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tsix\n@@ -307,8 +307,8 @@ test_expect_success 'check splitIndex.maxPercentChange set to 0' '\n \tgit config splitIndex.maxPercentChange 0 &&\n \t: >seven &&\n \tgit update-index --add seven &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n@@ -317,8 +317,8 @@ test_expect_success 'check splitIndex.maxPercentChange set to 0' '\n \ttest_cmp expect actual &&\n \t: >eight &&\n \tgit update-index --add eight &&\n-\tBASE=$(test-dump-split-index .git/index | grep \"^base\") &&\n-\ttest-dump-split-index .git/index | sed \"/^own/d\" >actual &&\n+\tBASE=$(test-tool dump-split-index .git/index | grep \"^base\") &&\n+\ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\n \t$BASE\n \treplacements:\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342800","messageId":"20180324074505.19100-21-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 20/36] t/helper: merge test-path-utils into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:49Z","receivedAt":"2018-03-24T07:47:44Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   |  2 +-\n t/helper/test-path-utils.c |  3 +-\n t/helper/test-tool.c       |  1 +\n t/helper/test-tool.h       |  1 +\n t/lib-git-p4.sh            |  2 +-\n t/t0060-path-utils.sh      | 60 +++++++++++++++++++-------------------\n t/t1501-work-tree.sh       |  8 ++---\n 7 files changed, 40 insertions(+), 37 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 91af906d08..751ea6cad7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -669,6 +669,7 @@ TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n+TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -676,7 +677,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-path-utils\n TEST_PROGRAMS_NEED_X += test-prio-queue\n TEST_PROGRAMS_NEED_X += test-read-cache\n TEST_PROGRAMS_NEED_X += test-write-cache\ndiff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c\nindex 2b3c5092a1..e115d44ac2 100644\n--- a/t/helper/test-path-utils.c\n+++ b/t/helper/test-path-utils.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"string-list.h\"\n \n@@ -170,7 +171,7 @@ static struct test_data dirname_data[] = {\n \t{ NULL,              NULL     }\n };\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__path_utils(int argc, const char **argv)\n {\n \tif (argc == 3 && !strcmp(argv[1], \"normalize_path_copy\")) {\n \t\tchar *buf = xmallocz(strlen(argv[2]));\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 8f78d61b68..4c985074b7 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -24,6 +24,7 @@ static struct test_cmd cmds[] = {\n \t{ \"mergesort\", cmd__mergesort },\n \t{ \"mktemp\", cmd__mktemp },\n \t{ \"online-cpus\", cmd__online_cpus },\n+\t{ \"path-utils\", cmd__path_utils },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex aeabc9740f..3b7ced01f5 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -18,6 +18,7 @@ int cmd__match_trees(int argc, const char **argv);\n int cmd__mergesort(int argc, const char **argv);\n int cmd__mktemp(int argc, const char **argv);\n int cmd__online_cpus(int argc, const char **argv);\n+int cmd__path_utils(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh\nindex 54fd5a6ca0..c27599474c 100644\n--- a/t/lib-git-p4.sh\n+++ b/t/lib-git-p4.sh\n@@ -39,7 +39,7 @@ native_path () {\n \tthen\n \t\tpath=$(cygpath --windows \"$path\")\n \telse\n-\t\tpath=$(test-path-utils real_path \"$path\")\n+\t\tpath=$(test-tool path-utils real_path \"$path\")\n \tfi &&\n \techo \"$path\"\n }\ndiff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh\nindex 7ea2bb515b..f46e3c4995 100755\n--- a/t/t0060-path-utils.sh\n+++ b/t/t0060-path-utils.sh\n@@ -8,15 +8,15 @@ test_description='Test various path utilities'\n . ./test-lib.sh\n \n norm_path() {\n-\texpected=$(test-path-utils print_path \"$2\")\n+\texpected=$(test-tool path-utils print_path \"$2\")\n \ttest_expect_success $3 \"normalize path: $1 => $2\" \\\n-\t\"test \\\"\\$(test-path-utils normalize_path_copy '$1')\\\" = '$expected'\"\n+\t\"test \\\"\\$(test-tool path-utils normalize_path_copy '$1')\\\" = '$expected'\"\n }\n \n relative_path() {\n-\texpected=$(test-path-utils print_path \"$3\")\n+\texpected=$(test-tool path-utils print_path \"$3\")\n \ttest_expect_success $4 \"relative path: $1 $2 => $3\" \\\n-\t\"test \\\"\\$(test-path-utils relative_path '$1' '$2')\\\" = '$expected'\"\n+\t\"test \\\"\\$(test-tool path-utils relative_path '$1' '$2')\\\" = '$expected'\"\n }\n \n test_submodule_relative_url() {\n@@ -37,7 +37,7 @@ test_git_path() {\n # On Windows, we are using MSYS's bash, which mangles the paths.\n # Absolute paths are anchored at the MSYS installation directory,\n # which means that the path / accounts for this many characters:\n-rootoff=$(test-path-utils normalize_path_copy / | wc -c)\n+rootoff=$(test-tool path-utils normalize_path_copy / | wc -c)\n # Account for the trailing LF:\n if test $rootoff = 2; then\n \trootoff=\t# we are on Unix\n@@ -46,7 +46,7 @@ else\n \t# In MSYS2, the root directory \"/\" is translated into a Windows\n \t# directory *with* trailing slash. Let's test for that and adjust\n \t# our expected longest ancestor length accordingly.\n-\tcase \"$(test-path-utils print_path /)\" in\n+\tcase \"$(test-tool path-utils print_path /)\" in\n \t*/) rootslash=1;;\n \t*) rootslash=0;;\n \tesac\n@@ -61,7 +61,7 @@ ancestor() {\n \t\texpected=$(($expected+$rootoff))\n \tfi\n \ttest_expect_success \"longest ancestor: $1 $2 => $expected\" \\\n-\t\"actual=\\$(test-path-utils longest_ancestor_length '$1' '$2') &&\n+\t\"actual=\\$(test-tool path-utils longest_ancestor_length '$1' '$2') &&\n \t test \\\"\\$actual\\\" = '$expected'\"\n }\n \n@@ -77,8 +77,8 @@ case $(uname -s) in\n \t;;\n esac\n \n-test_expect_success basename 'test-path-utils basename'\n-test_expect_success dirname 'test-path-utils dirname'\n+test_expect_success basename 'test-tool path-utils basename'\n+test_expect_success dirname 'test-tool path-utils dirname'\n \n norm_path \"\" \"\"\n norm_path . \"\"\n@@ -157,48 +157,48 @@ ancestor /foo/bar /foo:/bar 4\n ancestor /foo/bar /bar -1\n \n test_expect_success 'strip_path_suffix' '\n-\ttest c:/msysgit = $(test-path-utils strip_path_suffix \\\n+\ttest c:/msysgit = $(test-tool path-utils strip_path_suffix \\\n \t\tc:/msysgit/libexec//git-core libexec/git-core)\n '\n \n test_expect_success 'absolute path rejects the empty string' '\n-\ttest_must_fail test-path-utils absolute_path \"\"\n+\ttest_must_fail test-tool path-utils absolute_path \"\"\n '\n \n test_expect_success 'real path rejects the empty string' '\n-\ttest_must_fail test-path-utils real_path \"\"\n+\ttest_must_fail test-tool path-utils real_path \"\"\n '\n \n test_expect_success POSIX 'real path works on absolute paths 1' '\n \tnopath=\"hopefully-absent-path\" &&\n-\ttest \"/\" = \"$(test-path-utils real_path \"/\")\" &&\n-\ttest \"/$nopath\" = \"$(test-path-utils real_path \"/$nopath\")\"\n+\ttest \"/\" = \"$(test-tool path-utils real_path \"/\")\" &&\n+\ttest \"/$nopath\" = \"$(test-tool path-utils real_path \"/$nopath\")\"\n '\n \n test_expect_success 'real path works on absolute paths 2' '\n \tnopath=\"hopefully-absent-path\" &&\n \t# Find an existing top-level directory for the remaining tests:\n \td=$(pwd -P | sed -e \"s|^\\([^/]*/[^/]*\\)/.*|\\1|\") &&\n-\ttest \"$d\" = \"$(test-path-utils real_path \"$d\")\" &&\n-\ttest \"$d/$nopath\" = \"$(test-path-utils real_path \"$d/$nopath\")\"\n+\ttest \"$d\" = \"$(test-tool path-utils real_path \"$d\")\" &&\n+\ttest \"$d/$nopath\" = \"$(test-tool path-utils real_path \"$d/$nopath\")\"\n '\n \n test_expect_success POSIX 'real path removes extra leading slashes' '\n \tnopath=\"hopefully-absent-path\" &&\n-\ttest \"/\" = \"$(test-path-utils real_path \"///\")\" &&\n-\ttest \"/$nopath\" = \"$(test-path-utils real_path \"///$nopath\")\" &&\n+\ttest \"/\" = \"$(test-tool path-utils real_path \"///\")\" &&\n+\ttest \"/$nopath\" = \"$(test-tool path-utils real_path \"///$nopath\")\" &&\n \t# Find an existing top-level directory for the remaining tests:\n \td=$(pwd -P | sed -e \"s|^\\([^/]*/[^/]*\\)/.*|\\1|\") &&\n-\ttest \"$d\" = \"$(test-path-utils real_path \"//$d\")\" &&\n-\ttest \"$d/$nopath\" = \"$(test-path-utils real_path \"//$d/$nopath\")\"\n+\ttest \"$d\" = \"$(test-tool path-utils real_path \"//$d\")\" &&\n+\ttest \"$d/$nopath\" = \"$(test-tool path-utils real_path \"//$d/$nopath\")\"\n '\n \n test_expect_success 'real path removes other extra slashes' '\n \tnopath=\"hopefully-absent-path\" &&\n \t# Find an existing top-level directory for the remaining tests:\n \td=$(pwd -P | sed -e \"s|^\\([^/]*/[^/]*\\)/.*|\\1|\") &&\n-\ttest \"$d\" = \"$(test-path-utils real_path \"$d///\")\" &&\n-\ttest \"$d/$nopath\" = \"$(test-path-utils real_path \"$d///$nopath\")\"\n+\ttest \"$d\" = \"$(test-tool path-utils real_path \"$d///\")\" &&\n+\ttest \"$d/$nopath\" = \"$(test-tool path-utils real_path \"$d///$nopath\")\"\n '\n \n test_expect_success SYMLINKS 'real path works on symlinks' '\n@@ -209,35 +209,35 @@ test_expect_success SYMLINKS 'real path works on symlinks' '\n \tmkdir third &&\n \tdir=\"$(cd .git; pwd -P)\" &&\n \tdir2=third/../second/other/.git &&\n-\ttest \"$dir\" = \"$(test-path-utils real_path $dir2)\" &&\n+\ttest \"$dir\" = \"$(test-tool path-utils real_path $dir2)\" &&\n \tfile=\"$dir\"/index &&\n-\ttest \"$file\" = \"$(test-path-utils real_path $dir2/index)\" &&\n+\ttest \"$file\" = \"$(test-tool path-utils real_path $dir2/index)\" &&\n \tbasename=blub &&\n-\ttest \"$dir/$basename\" = \"$(cd .git && test-path-utils real_path \"$basename\")\" &&\n+\ttest \"$dir/$basename\" = \"$(cd .git && test-tool path-utils real_path \"$basename\")\" &&\n \tln -s ../first/file .git/syml &&\n \tsym=\"$(cd first; pwd -P)\"/file &&\n-\ttest \"$sym\" = \"$(test-path-utils real_path \"$dir2/syml\")\"\n+\ttest \"$sym\" = \"$(test-tool path-utils real_path \"$dir2/syml\")\"\n '\n \n test_expect_success SYMLINKS 'prefix_path works with absolute paths to work tree symlinks' '\n \tln -s target symlink &&\n-\ttest \"$(test-path-utils prefix_path prefix \"$(pwd)/symlink\")\" = \"symlink\"\n+\ttest \"$(test-tool path-utils prefix_path prefix \"$(pwd)/symlink\")\" = \"symlink\"\n '\n \n test_expect_success 'prefix_path works with only absolute path to work tree' '\n \techo \"\" >expected &&\n-\ttest-path-utils prefix_path prefix \"$(pwd)\" >actual &&\n+\ttest-tool path-utils prefix_path prefix \"$(pwd)\" >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success 'prefix_path rejects absolute path to dir with same beginning as work tree' '\n-\ttest_must_fail test-path-utils prefix_path prefix \"$(pwd)a\"\n+\ttest_must_fail test-tool path-utils prefix_path prefix \"$(pwd)a\"\n '\n \n test_expect_success SYMLINKS 'prefix_path works with absolute path to a symlink to work tree having  same beginning as work tree' '\n \tgit init repo &&\n \tln -s repo repolink &&\n-\ttest \"a\" = \"$(cd repo && test-path-utils prefix_path prefix \"$(pwd)/../repolink/a\")\"\n+\ttest \"a\" = \"$(cd repo && test-tool path-utils prefix_path prefix \"$(pwd)/../repolink/a\")\"\n '\n \n relative_path /foo/a/b/c/\t/foo/a/b/\tc/\ndiff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh\nindex b06210ec5e..b07cb9140e 100755\n--- a/t/t1501-work-tree.sh\n+++ b/t/t1501-work-tree.sh\n@@ -360,7 +360,7 @@ test_expect_success 'GIT_DIR set (1)' '\n \t(\n \t\tcd work &&\n \t\tGIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -371,7 +371,7 @@ test_expect_success 'GIT_DIR set (2)' '\n \t(\n \t\tcd work &&\n \t\tGIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -382,7 +382,7 @@ test_expect_success 'Auto discovery' '\n \t(\n \t\tcd work &&\n \t\tgit rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual &&\n \t\techo haha >data1 &&\n \t\tgit add data1 &&\n@@ -400,7 +400,7 @@ test_expect_success '$GIT_DIR/common overrides core.worktree' '\n \t(\n \t\tcd work &&\n \t\tgit rev-parse --git-common-dir >actual &&\n-\t\ttest-path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n+\t\ttest-tool path-utils real_path \"$TRASH_DIRECTORY/repo.git\" >expect &&\n \t\ttest_cmp expect actual &&\n \t\techo haha >data2 &&\n \t\tgit add data2 &&\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342801","messageId":"20180324074505.19100-22-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 21/36] t/helper: merge test-prio-queue into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:50Z","receivedAt":"2018-03-24T07:47:46Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                   | 2 +-\n t/helper/test-prio-queue.c | 3 ++-\n t/helper/test-tool.c       | 1 +\n t/helper/test-tool.h       | 1 +\n t/t0009-prio-queue.sh      | 6 +++---\n 5 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 751ea6cad7..076c778494 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -670,6 +670,7 @@ TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n+TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n@@ -677,7 +678,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-prio-queue\n TEST_PROGRAMS_NEED_X += test-read-cache\n TEST_PROGRAMS_NEED_X += test-write-cache\n TEST_PROGRAMS_NEED_X += test-ref-store\ndiff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c\nindex ae58fff359..9807b649b1 100644\n--- a/t/helper/test-prio-queue.c\n+++ b/t/helper/test-prio-queue.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"prio-queue.h\"\n \n@@ -16,7 +17,7 @@ static void show(int *v)\n \tfree(v);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__prio_queue(int argc, const char **argv)\n {\n \tstruct prio_queue pq = { intcmp };\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 4c985074b7..be5f784865 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -25,6 +25,7 @@ static struct test_cmd cmds[] = {\n \t{ \"mktemp\", cmd__mktemp },\n \t{ \"online-cpus\", cmd__online_cpus },\n \t{ \"path-utils\", cmd__path_utils },\n+\t{ \"prio-queue\", cmd__prio_queue },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 3b7ced01f5..900c96dc02 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -19,6 +19,7 @@ int cmd__mergesort(int argc, const char **argv);\n int cmd__mktemp(int argc, const char **argv);\n int cmd__online_cpus(int argc, const char **argv);\n int cmd__path_utils(int argc, const char **argv);\n+int cmd__prio_queue(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/t0009-prio-queue.sh b/t/t0009-prio-queue.sh\nindex 94045c3fad..e56dfce668 100755\n--- a/t/t0009-prio-queue.sh\n+++ b/t/t0009-prio-queue.sh\n@@ -17,7 +17,7 @@ cat >expect <<'EOF'\n 10\n EOF\n test_expect_success 'basic ordering' '\n-\ttest-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&\n+\ttest-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -30,7 +30,7 @@ cat >expect <<'EOF'\n 6\n EOF\n test_expect_success 'mixed put and get' '\n-\ttest-prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&\n+\ttest-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -43,7 +43,7 @@ NULL\n NULL\n EOF\n test_expect_success 'notice empty queue' '\n-\ttest-prio-queue 1 2 get get get 1 2 get get get >actual &&\n+\ttest-tool prio-queue 1 2 get get get 1 2 get get get >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342802","messageId":"20180324074505.19100-4-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 03/36] t/helper: merge test-sha1 into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:32Z","receivedAt":"2018-03-24T07:47:48Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/howto/recover-corrupted-object-harder.txt | 2 +-\n Makefile                                                | 4 ++--\n t/helper/test-sha1.c                                    | 3 ++-\n t/helper/test-sha1.sh                                   | 4 ++--\n t/helper/test-tool.c                                    | 1 +\n t/helper/test-tool.h                                    | 1 +\n t/lib-pack.sh                                           | 2 +-\n t/t0013-sha1dc.sh                                       | 2 +-\n 8 files changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/howto/recover-corrupted-object-harder.txt b/Documentation/howto/recover-corrupted-object-harder.txt\nindex 9c4cd0915f..8994e2559e 100644\n--- a/Documentation/howto/recover-corrupted-object-harder.txt\n+++ b/Documentation/howto/recover-corrupted-object-harder.txt\n@@ -80,7 +80,7 @@ valid pack like:\n     # now add our object data\n     cat object >>tmp.pack\n     # and then append the pack trailer\n-    /path/to/git.git/test-sha1 -b <tmp.pack >trailer\n+    /path/to/git.git/t/helper/test-tool sha1 -b <tmp.pack >trailer\n     cat trailer >>tmp.pack\n ------------\n \ndiff --git a/Makefile b/Makefile\nindex 416a8e39c1..3c0d0474af 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,6 +653,7 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n TEST_PROGRAMS_NEED_X += test-config\n@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-regex\n TEST_PROGRAMS_NEED_X += test-revision-walking\n TEST_PROGRAMS_NEED_X += test-run-command\n TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n-TEST_PROGRAMS_NEED_X += test-sha1\n TEST_PROGRAMS_NEED_X += test-sha1-array\n TEST_PROGRAMS_NEED_X += test-sigchain\n TEST_PROGRAMS_NEED_X += test-strcmp-offset\n@@ -2502,7 +2502,7 @@ t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\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:: t/helper/test-sha1$X\n+check-sha1:: t/helper/test-tool$X\n \tt/helper/test-sha1.sh\n \n SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\ndiff --git a/t/helper/test-sha1.c b/t/helper/test-sha1.c\nindex a1c13f54ec..1ba0675c75 100644\n--- a/t/helper/test-sha1.c\n+++ b/t/helper/test-sha1.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int ac, const char **av)\n+int cmd__sha1(int ac, const char **av)\n {\n \tgit_SHA_CTX ctx;\n \tunsigned char sha1[20];\ndiff --git a/t/helper/test-sha1.sh b/t/helper/test-sha1.sh\nindex 750b95a0a1..84594885c7 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 t/helper/test-tool 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} | ./t/helper/test-tool sha1 $cnt\n \t)\n \tif test \"$expect\" = \"$actual\"\n \tthen\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 63ec15cb56..7a9bb9f140 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n+\t{ \"sha1\", cmd__sha1 },\n };\n \n int cmd_main(int argc, const char **argv)\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 3a35e70e79..a05b8bd14c 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,5 +2,6 @@\n #define __TEST_TOOL_H__\n \n int cmd__chmtime(int argc, const char **argv);\n+int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/lib-pack.sh b/t/lib-pack.sh\nindex 7509846571..501078249d 100644\n--- a/t/lib-pack.sh\n+++ b/t/lib-pack.sh\n@@ -85,7 +85,7 @@ pack_obj () {\n \n # Compute and append pack trailer to \"$1\"\n pack_trailer () {\n-\ttest-sha1 -b <\"$1\" >trailer.tmp &&\n+\ttest-tool sha1 -b <\"$1\" >trailer.tmp &&\n \tcat trailer.tmp >>\"$1\" &&\n \trm -f trailer.tmp\n }\ndiff --git a/t/t0013-sha1dc.sh b/t/t0013-sha1dc.sh\nindex 6d655cb161..419f31a8f7 100755\n--- a/t/t0013-sha1dc.sh\n+++ b/t/t0013-sha1dc.sh\n@@ -11,7 +11,7 @@ then\n fi\n \n test_expect_success 'test-sha1 detects shattered pdf' '\n-\ttest_must_fail test-sha1 <\"$TEST_DATA/shattered-1.pdf\" 2>err &&\n+\ttest_must_fail test-tool sha1 <\"$TEST_DATA/shattered-1.pdf\" 2>err &&\n \ttest_i18ngrep collision err &&\n \tgrep 38762cf7f55934b34d179ae6a4c80cadccbb7f0a err\n '\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342803","messageId":"20180324074505.19100-6-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 05/36] t/helper: merge test-config into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:34Z","receivedAt":"2018-03-24T07:47:50Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                  |  2 +-\n t/helper/test-config.c    |  5 +++--\n t/helper/test-tool.c      |  1 +\n t/helper/test-tool.h      |  1 +\n t/t1305-config-include.sh |  2 +-\n t/t1308-config-set.sh     | 22 +++++++++++-----------\n t/t1309-early-config.sh   | 12 ++++++------\n 7 files changed, 24 insertions(+), 21 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 31287cedf2..227f16ad17 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,11 +653,11 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-config.o\n TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n-TEST_PROGRAMS_NEED_X += test-config\n TEST_PROGRAMS_NEED_X += test-date\n TEST_PROGRAMS_NEED_X += test-delta\n TEST_PROGRAMS_NEED_X += test-drop-caches\ndiff --git a/t/helper/test-config.c b/t/helper/test-config.c\nindex 1a7b8bd3d6..214003d5b2 100644\n--- a/t/helper/test-config.c\n+++ b/t/helper/test-config.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"config.h\"\n #include \"string-list.h\"\n@@ -32,7 +33,7 @@\n  * Examples:\n  *\n  * To print the value with highest priority for key \"foo.bAr Baz.rock\":\n- * \ttest-config get_value \"foo.bAr Baz.rock\"\n+ * \ttest-tool config get_value \"foo.bAr Baz.rock\"\n  *\n  */\n \n@@ -77,7 +78,7 @@ static int early_config_cb(const char *var, const char *value, void *vdata)\n \treturn 0;\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__config(int argc, const char **argv)\n {\n \tint i, val;\n \tconst char *v;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex afc7a518d6..e8d6c6b9eb 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n+\t{ \"config\", cmd__config },\n \t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 1dc4673c3a..3084f458a0 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,6 +2,7 @@\n #define __TEST_TOOL_H__\n \n int cmd__chmtime(int argc, const char **argv);\n+int cmd__config(int argc, const char **argv);\n int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \ndiff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh\nindex d9d2f545a4..f035ee40a3 100755\n--- a/t/t1305-config-include.sh\n+++ b/t/t1305-config-include.sh\n@@ -224,7 +224,7 @@ test_expect_success 'conditional include, early config reading' '\n \t\techo \"[includeIf \\\"gitdir:foo/\\\"]path=bar6\" >>.git/config &&\n \t\techo \"[test]six=6\" >.git/bar6 &&\n \t\techo 6 >expect &&\n-\t\ttest-config read_early_config test.six >actual &&\n+\t\ttest-tool config read_early_config test.six >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh\nindex bafed5c9b8..3e00d1af01 100755\n--- a/t/t1308-config-set.sh\n+++ b/t/t1308-config-set.sh\n@@ -18,7 +18,7 @@ check_config () {\n \tthen\n \t\tprintf \"%s\\n\" \"$@\"\n \tfi >expect &&\n-\ttest_expect_code $expect_code test-config \"$op\" \"$key\" >actual &&\n+\ttest_expect_code $expect_code test-tool config \"$op\" \"$key\" >actual &&\n \ttest_cmp expect actual\n }\n \n@@ -125,7 +125,7 @@ test_expect_success 'find string value for a key' '\n '\n \n test_expect_success 'check line error when NULL string is queried' '\n-\ttest_expect_code 128 test-config get_string case.foo 2>result &&\n+\ttest_expect_code 128 test-tool config get_string case.foo 2>result &&\n \ttest_i18ngrep \"fatal: .*case\\.foo.*\\.git/config.*line 7\" result\n '\n \n@@ -155,13 +155,13 @@ test_expect_success 'find value from a configset' '\n \t\tbaz = ball\n \tEOF\n \techo silk >expect &&\n-\ttest-config configset_get_value my.new config2 .git/config >actual &&\n+\ttest-tool config configset_get_value my.new config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'find value with highest priority from a configset' '\n \techo hask >expect &&\n-\ttest-config configset_get_value case.baz config2 .git/config >actual &&\n+\ttest-tool config configset_get_value case.baz config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -173,20 +173,20 @@ test_expect_success 'find value_list for a key from a configset' '\n \tlama\n \tball\n \tEOF\n-\ttest-config configset_get_value case.baz config2 .git/config >actual &&\n+\ttest-tool config configset_get_value case.baz config2 .git/config >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'proper error on non-existent files' '\n \techo \"Error (-1) reading configuration file non-existent-file.\" >expect &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar non-existent-file 2>actual &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar non-existent-file 2>actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'proper error on directory \"files\"' '\n \techo \"Error (-1) reading configuration file a-directory.\" >expect &&\n \tmkdir a-directory &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar a-directory 2>output &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar a-directory 2>output &&\n \tgrep \"^warning:\" output &&\n \tgrep \"^Error\" output >actual &&\n \ttest_cmp expect actual\n@@ -196,7 +196,7 @@ test_expect_success POSIXPERM,SANITY 'proper error on non-accessible files' '\n \tchmod -r .git/config &&\n \ttest_when_finished \"chmod +r .git/config\" &&\n \techo \"Error (-1) reading configuration file .git/config.\" >expect &&\n-\ttest_expect_code 2 test-config configset_get_value foo.bar .git/config 2>output &&\n+\ttest_expect_code 2 test-tool config configset_get_value foo.bar .git/config 2>output &&\n \tgrep \"^warning:\" output &&\n \tgrep \"^Error\" output >actual &&\n \ttest_cmp expect actual\n@@ -207,14 +207,14 @@ test_expect_success 'proper error on error in default config files' '\n \ttest_when_finished \"mv .git/config.old .git/config\" &&\n \techo \"[\" >>.git/config &&\n \techo \"fatal: bad config line 34 in file .git/config\" >expect &&\n-\ttest_expect_code 128 test-config get_value foo.bar 2>actual &&\n+\ttest_expect_code 128 test-tool config get_value foo.bar 2>actual &&\n \ttest_i18ncmp expect actual\n '\n \n test_expect_success 'proper error on error in custom config files' '\n \techo \"[\" >>syntax-error &&\n \techo \"fatal: bad config line 1 in file syntax-error\" >expect &&\n-\ttest_expect_code 128 test-config configset_get_value foo.bar syntax-error 2>actual &&\n+\ttest_expect_code 128 test-tool config configset_get_value foo.bar syntax-error 2>actual &&\n \ttest_i18ncmp expect actual\n '\n \n@@ -267,7 +267,7 @@ test_expect_success 'iteration shows correct origins' '\n \tname=\n \tscope=cmdline\n \tEOF\n-\tGIT_CONFIG_PARAMETERS=$cmdline_config test-config iterate >actual &&\n+\tGIT_CONFIG_PARAMETERS=$cmdline_config test-tool config iterate >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh\nindex 3dda215e8e..413642aa56 100755\n--- a/t/t1309-early-config.sh\n+++ b/t/t1309-early-config.sh\n@@ -6,7 +6,7 @@ test_description='Test read_early_config()'\n \n test_expect_success 'read early config' '\n \ttest_config early.config correct &&\n-\ttest-config read_early_config early.config >output &&\n+\ttest-tool config read_early_config early.config >output &&\n \ttest correct = \"$(cat output)\"\n '\n \n@@ -15,7 +15,7 @@ test_expect_success 'in a sub-directory' '\n \tmkdir -p sub &&\n \t(\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest sub = \"$(cat output)\"\n '\n@@ -27,7 +27,7 @@ test_expect_success 'ceiling' '\n \t\tGIT_CEILING_DIRECTORIES=\"$PWD\" &&\n \t\texport GIT_CEILING_DIRECTORIES &&\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest -z \"$(cat output)\"\n '\n@@ -42,7 +42,7 @@ test_expect_success 'ceiling #2' '\n \t\tGIT_CEILING_DIRECTORIES=\"$PWD\" &&\n \t\texport GIT_CEILING_DIRECTORIES XDG_CONFIG_HOME &&\n \t\tcd sub &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t) >output &&\n \ttest xdg = \"$(cat output)\"\n '\n@@ -54,7 +54,7 @@ test_expect_success 'read config file in right order' '\n \t(\n \t\tcd foo &&\n \t\techo \"[test]source = repo\" >>.git/config &&\n-\t\tGIT_CONFIG_PARAMETERS=$cmdline_config test-config \\\n+\t\tGIT_CONFIG_PARAMETERS=$cmdline_config test-tool config \\\n \t\t\tread_early_config test.source >actual &&\n \t\tcat >expected <<-\\EOF &&\n \t\thome\n@@ -71,7 +71,7 @@ test_with_config () {\n \t(\n \t\tcd throwaway &&\n \t\techo \"$*\" >.git/config &&\n-\t\ttest-config read_early_config early.config\n+\t\ttest-tool config read_early_config early.config\n \t)\n }\n \n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342804","messageId":"20180324074505.19100-5-pclouds@gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"[PATCH v2 04/36] t/helper: merge test-lazy-init-name-hash into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T07:44:33Z","receivedAt":"2018-03-24T07:47:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                                |  2 +-\n t/helper/test-lazy-init-name-hash.c     | 13 +++++++------\n t/helper/test-tool.c                    |  1 +\n t/helper/test-tool.h                    |  1 +\n t/perf/p0004-lazy-init-name-hash.sh     |  8 ++++----\n t/t3008-ls-files-lazy-init-name-hash.sh |  2 +-\n 6 files changed, 15 insertions(+), 12 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3c0d0474af..31287cedf2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -653,6 +653,7 @@ X =\n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n TEST_BUILTINS_OBJS += test-chmtime.o\n+TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o\n TEST_BUILTINS_OBJS += test-sha1.o\n \n TEST_PROGRAMS_NEED_X += test-ctype\n@@ -669,7 +670,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-genrandom\n TEST_PROGRAMS_NEED_X += test-hashmap\n TEST_PROGRAMS_NEED_X += test-index-version\n-TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-match-trees\n TEST_PROGRAMS_NEED_X += test-mergesort\ndiff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\nindex 297fb01d61..b99a37080d 100644\n--- a/t/helper/test-lazy-init-name-hash.c\n+++ b/t/helper/test-lazy-init-name-hash.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"parse-options.h\"\n \n@@ -184,14 +185,14 @@ static void analyze_run(void)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__lazy_init_name_hash(int argc, const char **argv)\n {\n \tconst char *usage[] = {\n-\t\t\"test-lazy-init-name-hash -d (-s | -m)\",\n-\t\t\"test-lazy-init-name-hash -p [-c c]\",\n-\t\t\"test-lazy-init-name-hash -a a [--step s] [-c c]\",\n-\t\t\"test-lazy-init-name-hash (-s | -m) [-c c]\",\n-\t\t\"test-lazy-init-name-hash -s -m [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -d (-s | -m)\",\n+\t\t\"test-tool lazy-init-name-hash -p [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -a a [--step s] [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash (-s | -m) [-c c]\",\n+\t\t\"test-tool lazy-init-name-hash -s -m [-c c]\",\n \t\tNULL\n \t};\n \tstruct option options[] = {\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 7a9bb9f140..afc7a518d6 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -8,6 +8,7 @@ struct test_cmd {\n \n static struct test_cmd cmds[] = {\n \t{ \"chmtime\", cmd__chmtime },\n+\t{ \"lazy-init-name-hash\", cmd__lazy_init_name_hash },\n \t{ \"sha1\", cmd__sha1 },\n };\n \ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex a05b8bd14c..1dc4673c3a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -2,6 +2,7 @@\n #define __TEST_TOOL_H__\n \n int cmd__chmtime(int argc, const char **argv);\n+int cmd__lazy_init_name_hash(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n \n #endif\ndiff --git a/t/perf/p0004-lazy-init-name-hash.sh b/t/perf/p0004-lazy-init-name-hash.sh\nindex 8de5a98cfc..1afc08fe7f 100755\n--- a/t/perf/p0004-lazy-init-name-hash.sh\n+++ b/t/perf/p0004-lazy-init-name-hash.sh\n@@ -7,8 +7,8 @@ test_perf_large_repo\n test_checkout_worktree\n \n test_expect_success 'verify both methods build the same hashmaps' '\n-\ttest-lazy-init-name-hash --dump --single >out.single &&\n-\tif test-lazy-init-name-hash --dump --multi >out.multi\n+\ttest-tool lazy-init-name-hash --dump --single >out.single &&\n+\tif test-tool lazy-init-name-hash --dump --multi >out.multi\n \tthen\n \t\ttest_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&\n \t\tsort <out.single >sorted.single &&\n@@ -46,11 +46,11 @@ test_expect_success 'calibrate' '\n '\n \n test_perf \"single-threaded, $desc\" \"\n-\ttest-lazy-init-name-hash --single --count=$count\n+\ttest-tool lazy-init-name-hash --single --count=$count\n \"\n \n test_perf REPO_BIG_ENOUGH_FOR_MULTI \"multi-threaded, $desc\" \"\n-\ttest-lazy-init-name-hash --multi --count=$count\n+\ttest-tool lazy-init-name-hash --multi --count=$count\n \"\n \n test_done\ndiff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh\nindex bdf5198b7e..8df4aa7c99 100755\n--- a/t/t3008-ls-files-lazy-init-name-hash.sh\n+++ b/t/t3008-ls-files-lazy-init-name-hash.sh\n@@ -21,7 +21,7 @@ test_expect_success 'no buffer overflow in lazy_init_name_hash' '\n \t) |\n \tsed \"s/^/100644 $EMPTY_BLOB\t/\" |\n \tgit update-index --index-info &&\n-\ttest-lazy-init-name-hash -m\n+\ttest-tool lazy-init-name-hash -m\n '\n \n test_done\n-- \n2.17.0.rc0.348.gd5a49e0b6f\n\n"},{"id":"342809","messageId":"87fu4pyfvr.fsf@evledraar.gmail.com","threadId":"48064","inReplyTo":"20180324074308.18934-6-pclouds@gmail.com","subject":"Re: [PATCH v4 3/7] gc: add --keep-largest-pack option","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-24T09:36:24Z","receivedAt":"2018-03-24T09:36:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote:\n\n>  \tstruct option builtin_gc_options[] = {\n>  \t\tOPT__QUIET(&quiet, N_(\"suppress progress reporting\")),\n> @@ -362,6 +390,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n>  \t\tOPT_BOOL(0, \"aggressive\", &aggressive, N_(\"be more thorough (increased runtime)\")),\n>  \t\tOPT_BOOL(0, \"auto\", &auto_gc, N_(\"enable auto-gc mode\")),\n>  \t\tOPT_BOOL(0, \"force\", &force, N_(\"force running gc even if there may be another gc running\")),\n> +\t\tOPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n> +\t\t\t N_(\"repack all other packs except the largest pack\")),\n>  \t\tOPT_END()\n>  \t};\n\nThis conflicts with master because of your own 7e1eeaa431 (\"completion:\nuse __gitcomp_builtin in _git_gc\", 2018-02-09). I pushed out a\navar-pclouds/gc-auto-keep-base-pack branch to github.com/avar/git which\nresolves it as:\n\n    @@ -365,6 +393,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n                    OPT_BOOL_F(0, \"force\", &force,\n                               N_(\"force running gc even if there may be another gc running\"),\n                               PARSE_OPT_NOCOMPLETE),\n    +               OPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n    +                        N_(\"repack all other packs except the largest pack\")),\n                    OPT_END()\n            };\n\nI assume that's the intention here.\n"},{"id":"342816","messageId":"CACsJy8CvgAHcB6uKgN=aULST0CkmPeCXLZcM_LZcXv9S9rEWPg@mail.gmail.com","threadId":"48064","inReplyTo":"87fu4pyfvr.fsf@evledraar.gmail.com","subject":"Re: [PATCH v4 3/7] gc: add --keep-largest-pack option","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T12:13:41Z","receivedAt":"2018-03-24T12:14:16Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 24, 2018 at 10:36 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n> On Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote:\n>\n>>       struct option builtin_gc_options[] = {\n>>               OPT__QUIET(&quiet, N_(\"suppress progress reporting\")),\n>> @@ -362,6 +390,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n>>               OPT_BOOL(0, \"aggressive\", &aggressive, N_(\"be more thorough (increased runtime)\")),\n>>               OPT_BOOL(0, \"auto\", &auto_gc, N_(\"enable auto-gc mode\")),\n>>               OPT_BOOL(0, \"force\", &force, N_(\"force running gc even if there may be another gc running\")),\n>> +             OPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n>> +                      N_(\"repack all other packs except the largest pack\")),\n>>               OPT_END()\n>>       };\n>\n> This conflicts with master because of your own 7e1eeaa431 (\"completion:\n> use __gitcomp_builtin in _git_gc\", 2018-02-09). I pushed out a\n> avar-pclouds/gc-auto-keep-base-pack branch to github.com/avar/git which\n> resolves it as:\n>\n>     @@ -365,6 +393,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n>                     OPT_BOOL_F(0, \"force\", &force,\n>                                N_(\"force running gc even if there may be another gc running\"),\n>                                PARSE_OPT_NOCOMPLETE),\n>     +               OPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n>     +                        N_(\"repack all other packs except the largest pack\")),\n>                     OPT_END()\n>             };\n>\n> I assume that's the intention here.\n\nYeah, I want  to keep the same base for easy interdiff. There are\nworse conflicts are with the other series I'm helping Stefan.\n-- \nDuy\n"},{"id":"342818","messageId":"87bmfdy6vg.fsf@evledraar.gmail.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"Re: [PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-24T12:50:59Z","receivedAt":"2018-03-24T12:51:07Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote:\n\n> v2 fixes a couple of typos in commit messages and use the cmd__ prefix\n> for test commands instead of test_, which avoids a naming conflict\n> with the existing function test_lazy_init_name_hash\n>\n> [the previous v2 send out was aborted because I messed it up with some\n> other patches]\n\nThis whole thing looks good to me, and I've applied it to my own build\nand run several modes (normal, split index etc.) of the test suite with\nit. Didn't get any problems.\n\nMicronit: If you M-x sort-lines (and I assume similar in other editors\nthat have a function to sort stuff in ASCII order) the test-tool.c list\nyou get this diff on top:\n\n    diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\n    index cd5e28b045..c38939b93e 100644\n    --- a/t/helper/test-tool.c\n    +++ b/t/helper/test-tool.c\n    @@ -32,8 +32,8 @@ static struct test_cmd cmds[] = {\n            { \"revision-walking\", cmd__revision_walking },\n            { \"run-command\", cmd__run_command },\n            { \"scrap-cache-tree\", cmd__scrap_cache_tree },\n    -       { \"sha1-array\", cmd__sha1_array },\n            { \"sha1\", cmd__sha1 },\n    +       { \"sha1-array\", cmd__sha1_array },\n            { \"sigchain\", cmd__sigchain },\n            { \"strcmp-offset\", cmd__strcmp_offset },\n            { \"string-list\", cmd__string_list },\n\nI think it makes sense to keep such lists in ASCII order (\" before -)\nfor subsequent edits where one or more things are added to the list and\nthen sorted before submission.\n"},{"id":"342820","messageId":"CACsJy8A=qRN6VCP_NwTdtuZWEgsnX6U+zQN8LK8F9FT2XvBaRA@mail.gmail.com","threadId":"48064","inReplyTo":"87bmfdy6vg.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-24T12:57:33Z","receivedAt":"2018-03-24T12:58:09Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 24, 2018 at 1:50 PM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n> On Sat, Mar 24 2018, Nguyễn Thái Ngọc Duy wrote:\n>\n>> v2 fixes a couple of typos in commit messages and use the cmd__ prefix\n>> for test commands instead of test_, which avoids a naming conflict\n>> with the existing function test_lazy_init_name_hash\n>>\n>> [the previous v2 send out was aborted because I messed it up with some\n>> other patches]\n>\n> This whole thing looks good to me, and I've applied it to my own build\n> and run several modes (normal, split index etc.) of the test suite with\n> it. Didn't get any problems.\n>\n> Micronit: If you M-x sort-lines (and I assume similar in other editors\n> that have a function to sort stuff in ASCII order) the test-tool.c list\n> you get this diff on top:\n>\n>     diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\n>     index cd5e28b045..c38939b93e 100644\n>     --- a/t/helper/test-tool.c\n>     +++ b/t/helper/test-tool.c\n>     @@ -32,8 +32,8 @@ static struct test_cmd cmds[] = {\n>             { \"revision-walking\", cmd__revision_walking },\n>             { \"run-command\", cmd__run_command },\n>             { \"scrap-cache-tree\", cmd__scrap_cache_tree },\n>     -       { \"sha1-array\", cmd__sha1_array },\n>             { \"sha1\", cmd__sha1 },\n>     +       { \"sha1-array\", cmd__sha1_array },\n>             { \"sigchain\", cmd__sigchain },\n>             { \"strcmp-offset\", cmd__strcmp_offset },\n>             { \"string-list\", cmd__string_list },\n>\n> I think it makes sense to keep such lists in ASCII order (\" before -)\n> for subsequent edits where one or more things are added to the list and\n> then sorted before submission.\n\nYeah, my brain just failed to see that sha1-array should be behind\nsha1. Bad brain!\n-- \nDuy\n"},{"id":"342959","messageId":"xmqqh8p3egm6.fsf@gitster-ct.c.googlers.com","threadId":"48064","inReplyTo":"CACsJy8CvgAHcB6uKgN=aULST0CkmPeCXLZcM_LZcXv9S9rEWPg@mail.gmail.com","subject":"Re: [PATCH v4 3/7] gc: add --keep-largest-pack option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-26T02:05:21Z","receivedAt":"2018-03-26T02:05: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>> This conflicts with master because of your own 7e1eeaa431 (\"completion:\n>> use __gitcomp_builtin in _git_gc\", 2018-02-09). I pushed out a\n>> avar-pclouds/gc-auto-keep-base-pack branch to github.com/avar/git which\n>> resolves it as:\n>>\n>>     @@ -365,6 +393,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n>>                     OPT_BOOL_F(0, \"force\", &force,\n>>                                N_(\"force running gc even if there may be another gc running\"),\n>>                                PARSE_OPT_NOCOMPLETE),\n>>     +               OPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n>>     +                        N_(\"repack all other packs except the largest pack\")),\n>>                     OPT_END()\n>>             };\n>>\n>> I assume that's the intention here.\n>\n> Yeah, I want  to keep the same base for easy interdiff. There are\n> worse conflicts are with the other series I'm helping Stefan.\n\nRight now there are a couple of topics that wants to touch options\narray and also the builtins command table, which are both good\nexamples of \"central registry\" that everybody needs to touch and are\nbound to become a source of conflict.  Until I scream (and I try\nhard not to have to), contributors should not have to worry too much\nabout causing conflicts---being traffic cop and directing orderly\nintegration of these topics is what the maintainer(s) do.\n\nThanks.\n"},{"id":"342961","messageId":"xmqqd0zreg45.fsf@gitster-ct.c.googlers.com","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"Re: [PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-26T02:16:10Z","receivedAt":"2018-03-26T02:16:17Z","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> v2 fixes a couple of typos in commit messages and use the cmd__ prefix\n> for test commands instead of test_, which avoids a naming conflict\n> with the existing function test_lazy_init_name_hash\n>\n> [the previous v2 send out was aborted because I messed it up with some\n> other patches]\n\nYeah, I was wondering if the 7 v4 patches for --keep-pack should be\npicked up, or I should just wait for a proper resubmission under its\nown cover letter.\n"},{"id":"343014","messageId":"nycvar.QRO.7.76.6.1803261722350.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"48064","inReplyTo":"20180324074505.19100-2-pclouds@gmail.com","subject":"Re: [PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-03-26T15:27:55Z","receivedAt":"2018-03-26T15:28:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Duy,\n\nOn Sat, 24 Mar 2018, Nguyễn Thái Ngọc Duy wrote:\n\n> diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\n> new file mode 100644\n> index 0000000000..c730f718ca\n> --- /dev/null\n> +++ b/t/helper/test-tool.c\n> @@ -0,0 +1,27 @@\n> +#include \"git-compat-util.h\"\n> +#include \"test-tool.h\"\n> +\n> +struct test_cmd {\n> +\tconst char *name;\n> +\tint (*main)(int argc, const char **argv);\n\nThis makes the build fail on Windows, as we override `main` in\ncompat/mingw.h:\n\n\t/*\n\t * A replacement of main() that adds win32 specific initialization.\n\t */\n\n\tvoid mingw_startup(void);\n\t#define main(c,v) dummy_decl_mingw_main(void); \\\n\tstatic int mingw_main(c,v); \\\n\tint main(int argc, const char **argv) \\\n\t{ \\\n\t\tmingw_startup(); \\\n\t\treturn mingw_main(__argc, (void *)__argv); \\\n\t} \\\n\tstatic int mingw_main(c,v)\n\n\nI know, I know, now that common-main.c is a thing, we could simply pluck a\n`platform_specific_pre_main()` or some such, which is overridden in\ncompat/mingw.h to `mingw_startup` and to a no-op in git-compat-util.h as a\nfall-back.\n\nThe truth is: I simply did not get around to doing this yet.\n\nIn the meantime, could we have this SQUASH???, please?\n\n-- snipsnap --\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex cd5e28b045a..87066ced62a 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -3,7 +3,7 @@\n \n struct test_cmd {\n \tconst char *name;\n-\tint (*main)(int argc, const char **argv);\n+\tint (*fn)(int argc, const char **argv);\n };\n \n static struct test_cmd cmds[] = {\n@@ -55,7 +55,7 @@ int cmd_main(int argc, const char **argv)\n \t\tif (!strcmp(cmds[i].name, argv[1])) {\n \t\t\targv++;\n \t\t\targc--;\n-\t\t\treturn cmds[i].main(argc, argv);\n+\t\t\treturn cmds[i].fn(argc, argv);\n \t\t}\n \t}\n \tdie(\"There is no test named '%s'\", argv[1]);\n"},{"id":"343031","messageId":"CACsJy8Dz87YHiA48m_X7OmJXioKorUDNSyPy250jaqU7xt1JXQ@mail.gmail.com","threadId":"48064","inReplyTo":"nycvar.QRO.7.76.6.1803261722350.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","subject":"Re: [PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-26T17:09:49Z","receivedAt":"2018-03-26T17:10:31Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Mar 26, 2018 at 5:27 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi Duy,\n>\n> On Sat, 24 Mar 2018, Nguyễn Thái Ngọc Duy wrote:\n>\n>> diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\n>> new file mode 100644\n>> index 0000000000..c730f718ca\n>> --- /dev/null\n>> +++ b/t/helper/test-tool.c\n>> @@ -0,0 +1,27 @@\n>> +#include \"git-compat-util.h\"\n>> +#include \"test-tool.h\"\n>> +\n>> +struct test_cmd {\n>> +     const char *name;\n>> +     int (*main)(int argc, const char **argv);\n>\n> This makes the build fail on Windows, as we override `main` in\n> compat/mingw.h:\n\nSigh.. not complaining, but I wish somebody tries to compile git with\nwine (and automate it in travis). This way we could at least cover the\ncompilation part for all major platforms. Probably too small for a\nGSoC (and making the test suite pass with wine may be too large for\nGSoC)\n-- \nDuy\n"},{"id":"343079","messageId":"nycvar.QRO.7.76.6.1803270007550.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"48064","inReplyTo":"CACsJy8Dz87YHiA48m_X7OmJXioKorUDNSyPy250jaqU7xt1JXQ@mail.gmail.com","subject":"Re: [PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-03-26T22:14:43Z","receivedAt":"2018-03-26T22:14:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Duy,\n\nOn Mon, 26 Mar 2018, Duy Nguyen wrote:\n\n> On Mon, Mar 26, 2018 at 5:27 PM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > On Sat, 24 Mar 2018, Nguyễn Thái Ngọc Duy wrote:\n> >\n> >> diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\n> >> new file mode 100644\n> >> index 0000000000..c730f718ca\n> >> --- /dev/null\n> >> +++ b/t/helper/test-tool.c\n> >> @@ -0,0 +1,27 @@\n> >> +#include \"git-compat-util.h\"\n> >> +#include \"test-tool.h\"\n> >> +\n> >> +struct test_cmd {\n> >> +     const char *name;\n> >> +     int (*main)(int argc, const char **argv);\n> >\n> > This makes the build fail on Windows, as we override `main` in\n> > compat/mingw.h:\n> \n> Sigh.. not complaining, but I wish somebody tries to compile git with\n> wine (and automate it in travis). This way we could at least cover the\n> compilation part for all major platforms. Probably too small for a\n> GSoC (and making the test suite pass with wine may be too large for\n> GSoC)\n\nWe do have Continuous Testing of maint, master, next & pu.\n\nHowever, it seems that something is off, as\nba5bec9589e9eefe2446044657963e25b7c8d88e is reported as fine on Windows:\nhttps://travis-ci.org/git/git/jobs/358260023 (while there is clearly a red\nX next to that commit in\nhttps://github.com/git/git/commits/ba5bec9589e9eefe2446044657963e25b7c8d88e,\nthat X is due to a hiccup on macOS).\n\nIt seems that the good-trees feature for Travis does not quite work as\nintended. Gábor?\n\nCiao,\nDscho"},{"id":"343088","messageId":"CAM0VKjmCKmQisLZcBw7ZROQmg3bVTXTOK6auo6DjjkOfKdPv1w@mail.gmail.com","threadId":"48064","inReplyTo":"nycvar.QRO.7.76.6.1803270007550.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","subject":"Re: [PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-03-26T23:07:24Z","receivedAt":"2018-03-26T23:07:30Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Mar 27, 2018 at 12:14 AM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> However, it seems that something is off, as\n> ba5bec9589e9eefe2446044657963e25b7c8d88e is reported as fine on Windows:\n> https://travis-ci.org/git/git/jobs/358260023 (while there is clearly a red\n> X next to that commit in\n> https://github.com/git/git/commits/ba5bec9589e9eefe2446044657963e25b7c8d88e,\n> that X is due to a hiccup on macOS).\n>\n> It seems that the good-trees feature for Travis does not quite work as\n> intended. Gábor?\n\nAFAICT it works as expected.\n\nWhen a build job encounters a commit with a tree that has previously\nbeen built and tested successfully, then first it says so, like this:\n\n  https://travis-ci.org/szeder/git/jobs/347295038#L635\n\nand then skips the rest of the build job (see the 'exit 0' a few lines\nlater).\n\nIn case of this Windows build job we haven't seen this tree yet:\n\n  https://travis-ci.org/git/git/jobs/358260023#L467\n\nso the build job continues as usual (see the 'test -z Windows' two lines\nlater).\n\nUnfortunately, I have no idea about how the rest of the Windows build\njob is supposed to work...\n"},{"id":"343125","messageId":"nycvar.QRO.7.76.6.1803271556170.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"48064","inReplyTo":"CAM0VKjmCKmQisLZcBw7ZROQmg3bVTXTOK6auo6DjjkOfKdPv1w@mail.gmail.com","subject":"Re: [PATCH v2 01/36] t/helper: add an empty test-tool program","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-03-27T13:57:32Z","receivedAt":"2018-03-27T13:57:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Gábor,\n\nOn Tue, 27 Mar 2018, SZEDER Gábor wrote:\n\n> On Tue, Mar 27, 2018 at 12:14 AM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> > However, it seems that something is off, as\n> > ba5bec9589e9eefe2446044657963e25b7c8d88e is reported as fine on Windows:\n> > https://travis-ci.org/git/git/jobs/358260023 (while there is clearly a red\n> > X next to that commit in\n> > https://github.com/git/git/commits/ba5bec9589e9eefe2446044657963e25b7c8d88e,\n> > that X is due to a hiccup on macOS).\n> >\n> > It seems that the good-trees feature for Travis does not quite work as\n> > intended. Gábor?\n> \n> AFAICT it works as expected.\n> \n> When a build job encounters a commit with a tree that has previously\n> been built and tested successfully, then first it says so, like this:\n> \n>   https://travis-ci.org/szeder/git/jobs/347295038#L635\n\nBut what if it has not been built successfully (as was the case here)?\nThis very commit that is \"succeeding\" on Travis fails to compile on\nWindows.\n\n> and then skips the rest of the build job (see the 'exit 0' a few lines\n> later).\n> \n> In case of this Windows build job we haven't seen this tree yet:\n> \n>   https://travis-ci.org/git/git/jobs/358260023#L467\n> \n> so the build job continues as usual (see the 'test -z Windows' two lines\n> later).\n> \n> Unfortunately, I have no idea about how the rest of the Windows build\n> job is supposed to work...\n\nMaybe Travis timed out waiting for the result, and marked it as a success?\n\nCiao,\nDscho"},{"id":"343126","messageId":"nycvar.QRO.7.76.6.1803271558380.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"48064","inReplyTo":"20180324074505.19100-1-pclouds@gmail.com","subject":"Re: [PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-03-27T14:00:00Z","receivedAt":"2018-03-27T14:00:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Duy,\n\nOn Sat, 24 Mar 2018, Nguyễn Thái Ngọc Duy wrote:\n\n> v2 fixes a couple of typos in commit messages and use the cmd__ prefix\n> for test commands instead of test_, which avoids a naming conflict\n> with the existing function test_lazy_init_name_hash\n> \n> [the previous v2 send out was aborted because I messed it up with some\n> other patches]\n\nThis iteration, with the SQUASH??? I proposed (and that Junio will\nhopefully pick up soon), works well on Windows.\n\nThank you,\nDscho"},{"id":"343136","messageId":"xmqqtvt1a5kg.fsf@gitster-ct.c.googlers.com","threadId":"48064","inReplyTo":"nycvar.QRO.7.76.6.1803271558380.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","subject":"Re: [PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-27T15:42:07Z","receivedAt":"2018-03-27T15:42:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> This iteration, with the SQUASH??? I proposed (and that Junio will\n> hopefully pick up soon), works well on Windows.\n\nThanks; is that the \"call it fn, as main is macro-ed away by us?\"\nchange?\n"},{"id":"343144","messageId":"nycvar.QRO.7.76.6.1803271812430.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"48064","inReplyTo":"xmqqtvt1a5kg.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2 00/36] Combine t/helper binaries into a single one","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-03-27T16:12:54Z","receivedAt":"2018-03-27T16:13:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 27 Mar 2018, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > This iteration, with the SQUASH??? I proposed (and that Junio will\n> > hopefully pick up soon), works well on Windows.\n> \n> Thanks; is that the \"call it fn, as main is macro-ed away by us?\"\n> change?\n\nPrecisely.\n\nThanks,\nDscho\n"}]}