{"thread":{"id":"55129","subject":"[PATCH 00/12] test-lib: misc improvements","startedAt":"2021-02-09T22:28:46Z","lastAt":"2021-02-13T14:39:52Z","messageCount":38,"participants":["Ævar Arnfjörð Bjarmason","Denton Liu","Junio C Hamano","SZEDER Gábor","Jeff King","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":12},"messages":[{"id":"416568","messageId":"20210209214159.22815-1-avarab@gmail.com","threadId":"55129","inReplyTo":null,"subject":"[PATCH 00/12] test-lib: misc improvements","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:47Z","receivedAt":"2021-02-09T22:28:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Various miscellaneous small and easy to review cleanups & fixes to the\ntest libraries. This doesn't conflict with the current \"seen\" branch.\n\nÆvar Arnfjörð Bjarmason (12):\n  test-lib: remove check_var_migration\n  test lib: change \"error\" to \"BUG\" as appropriate\n  test-lib-functions: move test_set_index_version() to its user\n  test-lib-functions: remove generate_zero_bytes() wrapper\n  test libs: rename bundle helper to \"lib-bundle.sh\"\n  test libs: rename gitweb-lib.sh to lib-gitweb.sh\n  test-lib-functions: move function to lib-bitmap.sh\n  t/.gitattributes: sort lines\n  test libs: rename \"diff-lib\" to \"lib-diff\"\n  test-lib-functions: remove bug-inducing \"diagnostics\" helper param\n  test-lib-functions: assert correct parameter count\n  test-lib-functions: split out {debug,path,text} helpers\n\n t/.gitattributes                              |   4 +-\n t/README                                      |   8 +-\n t/lib-bitmap.sh                               |  26 ++\n t/{test-bundle-functions.sh => lib-bundle.sh} |   0\n t/{diff-lib.sh => lib-diff.sh}                |   0\n t/{diff-lib => lib-diff}/COPYING              |   0\n t/{diff-lib => lib-diff}/README               |   0\n t/{gitweb-lib.sh => lib-gitweb.sh}            |   0\n t/t2104-update-index-skip-worktree.sh         |   5 +\n t/t3404-rebase-interactive.sh                 |   3 +-\n t/t4000-diff-format.sh                        |   2 +-\n t/t4001-diff-rename.sh                        |   2 +-\n t/t4003-diff-rename-1.sh                      |   6 +-\n t/t4004-diff-rename-symlink.sh                |   2 +-\n t/t4005-diff-rename-2.sh                      |   6 +-\n t/t4007-rename-3.sh                           |   6 +-\n t/t4008-diff-break-rewrite.sh                 |   6 +-\n t/t4009-diff-rename-4.sh                      |   6 +-\n t/t4010-diff-pathspec.sh                      |   2 +-\n t/t4011-diff-symlink.sh                       |   2 +-\n t/t4013-diff-various.sh                       |   2 +-\n t/t4015-diff-whitespace.sh                    |   2 +-\n t/t4027-diff-submodule.sh                     |   2 +-\n t/t4034-diff-words.sh                         |   2 +-\n t/t4038-diff-combined.sh                      |   2 +-\n t/t4061-diff-indent.sh                        |   2 +-\n t/t4206-log-follow-harder-copies.sh           |   2 +-\n t/t5310-pack-bitmaps.sh                       |   2 +\n t/t5318-commit-graph.sh                       |   2 +-\n t/t5510-fetch.sh                              |   2 +-\n t/t6020-bundle-misc.sh                        |   2 +-\n t/t6113-rev-list-bitmap-filters.sh            |   1 +\n t/t6426-merge-skip-unneeded-updates.sh        |  16 +-\n t/t6500-gc.sh                                 |   4 +-\n t/t7501-commit-basic-functionality.sh         |   2 +-\n t/t9300-fast-import.sh                        |   2 +-\n t/t9500-gitweb-standalone-no-errors.sh        |   2 +-\n t/t9501-gitweb-standalone-http-status.sh      |   2 +-\n t/t9502-gitweb-standalone-parse-output.sh     |   2 +-\n t/test-lib-functions.sh                       | 305 +-----------------\n t/test-lib-functions/debug.sh                 |  99 ++++++\n t/test-lib-functions/path.sh                  | 137 ++++++++\n t/test-lib-functions/text.sh                  |  33 ++\n t/test-lib.sh                                 |  30 --\n 44 files changed, 370 insertions(+), 373 deletions(-)\n create mode 100644 t/lib-bitmap.sh\n rename t/{test-bundle-functions.sh => lib-bundle.sh} (100%)\n rename t/{diff-lib.sh => lib-diff.sh} (100%)\n rename t/{diff-lib => lib-diff}/COPYING (100%)\n rename t/{diff-lib => lib-diff}/README (100%)\n rename t/{gitweb-lib.sh => lib-gitweb.sh} (100%)\n create mode 100644 t/test-lib-functions/debug.sh\n create mode 100644 t/test-lib-functions/path.sh\n create mode 100644 t/test-lib-functions/text.sh\n\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416569","messageId":"20210209214159.22815-2-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 01/12] test-lib: remove check_var_migration","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:48Z","receivedAt":"2021-02-09T22:28:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the check_var_migration() migration helper. This was added back\nin [1], [2] and [3] to warn users to migrate from e.g. the\n\"GIT_FSMONITOR_TEST\" name to \"GIT_TEST_FSMONITOR\".\n\nI daresay that having been warning about this since late 2018 (or\nv2.20.0) was sufficient time to give everyone interested a heads-up\nabout moving to the new names.\n\nI don't see the need for going through the \"do this later\" codepath\nanticipated in [1], let's just remove this instead.\n\n1. 4cb54d0aa8e (fsmonitor: update GIT_TEST_FSMONITOR support,\n   2018-09-18)\n2. 1f357b045b5 (read-cache: update TEST_GIT_INDEX_VERSION support,\n   2018-09-18)\n3. 5765d97b71d (preload-index: update GIT_FORCE_PRELOAD_TEST support,\n   2018-09-18)\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib.sh | 30 ------------------------------\n 1 file changed, 30 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 76062db2964..61bda88245c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -462,36 +462,6 @@ export GIT_DEFAULT_HASH\n GIT_TRACE_BARE=1\n export GIT_TRACE_BARE\n \n-check_var_migration () {\n-\t# the warnings and hints given from this helper depends\n-\t# on end-user settings, which will disrupt the self-test\n-\t# done on the test framework itself.\n-\tcase \"$GIT_TEST_FRAMEWORK_SELFTEST\" in\n-\tt)\treturn ;;\n-\tesac\n-\n-\told_name=$1 new_name=$2\n-\teval \"old_isset=\\${${old_name}:+isset}\"\n-\teval \"new_isset=\\${${new_name}:+isset}\"\n-\n-\tcase \"$old_isset,$new_isset\" in\n-\tisset,)\n-\t\techo >&2 \"warning: $old_name is now $new_name\"\n-\t\techo >&2 \"hint: set $new_name too during the transition period\"\n-\t\teval \"$new_name=\\$$old_name\"\n-\t\t;;\n-\tisset,isset)\n-\t\t# do this later\n-\t\t# echo >&2 \"warning: $old_name is now $new_name\"\n-\t\t# echo >&2 \"hint: remove $old_name\"\n-\t\t;;\n-\tesac\n-}\n-\n-check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR\n-check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION\n-check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX\n-\n # Use specific version of the index file format\n if test -n \"${GIT_TEST_INDEX_VERSION:+isset}\"\n then\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416570","messageId":"20210209214159.22815-3-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 02/12] test lib: change \"error\" to \"BUG\" as appropriate","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:49Z","receivedAt":"2021-02-09T22:29:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change two uses of \"error\" in test-lib-functions.sh to \"BUG\".\n\nIn the first instance in \"test_cmp_rev\" the author of the \"BUG\"\nfunction added in [1] had another in-flight patch adding this in [2],\nand the two were never consolidated.\n\nIn the second case in \"test_atexit\" added in [3] that we could have\ninstead used \"BUG\" appears to have been missed.\n\n1. 165293af3ce (tests: send \"bug in the test script\" errors to the\n   script's stderr, 2018-11-19)\n\n2. 30d0b6dccbc (test-lib-functions: make 'test_cmp_rev' more\n   informative on failure, 2018-11-19)\n\n3. 900721e15c4 (test-lib: introduce 'test_atexit', 2019-03-13)\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib-functions.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 6bca0023168..0d40f8a598e 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -1105,7 +1105,7 @@ test_cmp_rev () {\n \tfi\n \tif test $# != 2\n \tthen\n-\t\terror \"bug in the test script: test_cmp_rev requires two revisions, but got $#\"\n+\t\tBUG \"test_cmp_rev requires two revisions, but got $#\"\n \telse\n \t\tlocal r1 r2\n \t\tr1=$(git rev-parse --verify \"$1\") &&\n@@ -1216,7 +1216,7 @@ test_atexit () {\n \t# doing so on Bash is better than nothing (the test will\n \t# silently pass on other shells).\n \ttest \"${BASH_SUBSHELL-0}\" = 0 ||\n-\terror \"bug in test script: test_atexit does nothing in a subshell\"\n+\tBUG \"test_atexit does nothing in a subshell\"\n \ttest_atexit_cleanup=\"{ $*\n \t\t} && (exit \\\"\\$eval_ret\\\"); eval_ret=\\$?; $test_atexit_cleanup\"\n }\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416574","messageId":"20210209214159.22815-4-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 03/12] test-lib-functions: move test_set_index_version() to its user","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:50Z","receivedAt":"2021-02-09T22:59:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move the test_set_index_version() function to its only user. This\nfunction has only been used in one place since its addition in\n5d9fc888b48 (test-lib: allow setting the index format version,\n2014-02-23). Let's have that test script define it.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t2104-update-index-skip-worktree.sh | 5 +++++\n t/test-lib-functions.sh               | 5 -----\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh\nindex 7e2e7dd4ae5..30666fc70d2 100755\n--- a/t/t2104-update-index-skip-worktree.sh\n+++ b/t/t2104-update-index-skip-worktree.sh\n@@ -9,6 +9,11 @@ test_description='skip-worktree bit test'\n \n sane_unset GIT_TEST_SPLIT_INDEX\n \n+test_set_index_version () {\n+    GIT_INDEX_VERSION=\"$1\"\n+    export GIT_INDEX_VERSION\n+}\n+\n test_set_index_version 3\n \n cat >expect.full <<EOF\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 0d40f8a598e..728bdf94684 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -32,11 +32,6 @@ test_set_editor () {\n \texport EDITOR\n }\n \n-test_set_index_version () {\n-    GIT_INDEX_VERSION=\"$1\"\n-    export GIT_INDEX_VERSION\n-}\n-\n test_decode_color () {\n \tawk '\n \t\tfunction name(n) {\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416575","messageId":"20210209214159.22815-5-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 04/12] test-lib-functions: remove generate_zero_bytes() wrapper","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:51Z","receivedAt":"2021-02-09T22:59:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Since d5cfd142ec1 (tests: teach the test-tool to generate NUL bytes\nand use it, 2019-02-14) the generate_zero_bytes() functions has been a\nthin wrapper for \"test-tool genzeros\". Let's have its only user call\nthat directly instead.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5318-commit-graph.sh | 2 +-\n t/test-lib-functions.sh | 7 -------\n 2 files changed, 1 insertion(+), 8 deletions(-)\n\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 2ed0c1544da..368d1cfb448 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -529,7 +529,7 @@ corrupt_graph_and_verify() {\n \tzero_pos=${4:-${orig_size}} &&\n \tprintf \"$data\" | dd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$pos\" conv=notrunc &&\n \tdd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" if=/dev/null &&\n-\tgenerate_zero_bytes $(($orig_size - $zero_pos)) >>\"$objdir/info/commit-graph\" &&\n+\ttest-tool genzeros $(($orig_size - $zero_pos)) >>\"$objdir/info/commit-graph\" &&\n \tcorrupt_graph_verify \"$grepstr\"\n \n }\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 728bdf94684..55d58b4a6ac 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -111,13 +111,6 @@ remove_cr () {\n \ttr '\\015' Q | sed -e 's/Q$//'\n }\n \n-# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).\n-# If $1 is 'infinity', output forever or until the receiving pipe stops reading,\n-# whichever comes first.\n-generate_zero_bytes () {\n-\ttest-tool genzeros \"$@\"\n-}\n-\n # In some bourne shell implementations, the \"unset\" builtin returns\n # nonzero status when a variable to be unset was not set in the first\n # place.\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416577","messageId":"20210209214159.22815-13-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:59Z","receivedAt":"2021-02-09T23:02:07Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split out the debug, path and text miscellaneous helpers into their\nown files. The \"test -[efsd]\" etc. helpers were not all in one place\nin test-lib-functions.sh, I think moving them into their own file\nmakes it easier to follow the code.\n\nThe same goes for the miscellaneous text munging helpers, and the\ndebug code that was early in the file.\n\nAs viewing this commit with diff.colorMoved=true will show there's no\nfunctional changes here. The only added/removed lines are comments and\nwhitespace. The rest is all moving of existing code into new files.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib-functions.sh       | 267 +---------------------------------\n t/test-lib-functions/debug.sh |  99 +++++++++++++\n t/test-lib-functions/path.sh  | 137 +++++++++++++++++\n t/test-lib-functions/text.sh  |  33 +++++\n 4 files changed, 275 insertions(+), 261 deletions(-)\n create mode 100644 t/test-lib-functions/debug.sh\n create mode 100644 t/test-lib-functions/path.sh\n create mode 100644 t/test-lib-functions/text.sh\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 8ec06eb67a0..a21ba83d83c 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -16,6 +16,12 @@\n # You should have received a copy of the GNU General Public License\n # along with this program.  If not, see http://www.gnu.org/licenses/ .\n \n+# Include sub-libraries of test-lib-functions.sh, split out for\n+# readability.\n+. \"$TEST_DIRECTORY/test-lib-functions/debug.sh\"\n+. \"$TEST_DIRECTORY/test-lib-functions/path.sh\"\n+. \"$TEST_DIRECTORY/test-lib-functions/text.sh\"\n+\n # The semantics of the editor variables are that of invoking\n # sh -c \"$EDITOR \\\"$@\\\"\" files ...\n #\n@@ -79,37 +85,7 @@ test_decode_color () {\n \t'\n }\n \n-lf_to_nul () {\n-\tperl -pe 'y/\\012/\\000/'\n-}\n-\n-nul_to_q () {\n-\tperl -pe 'y/\\000/Q/'\n-}\n-\n-q_to_nul () {\n-\tperl -pe 'y/Q/\\000/'\n-}\n-\n-q_to_cr () {\n-\ttr Q '\\015'\n-}\n-\n-q_to_tab () {\n-\ttr Q '\\011'\n-}\n-\n-qz_to_tab_space () {\n-\ttr QZ '\\011\\040'\n-}\n-\n-append_cr () {\n-\tsed -e 's/$/Q/' | tr Q '\\015'\n-}\n \n-remove_cr () {\n-\ttr '\\015' Q | sed -e 's/Q$//'\n-}\n \n # In some bourne shell implementations, the \"unset\" builtin returns\n # nonzero status when a variable to be unset was not set in the first\n@@ -134,38 +110,6 @@ test_tick () {\n \texport GIT_COMMITTER_DATE GIT_AUTHOR_DATE\n }\n \n-# Stop execution and start a shell. This is useful for debugging tests.\n-#\n-# Be sure to remove all invocations of this command before submitting.\n-\n-test_pause () {\n-\t\"$SHELL_PATH\" <&6 >&5 2>&7\n-}\n-\n-# Wrap git with a debugger. Adding this to a command can make it easier\n-# to understand what is going on in a failing test.\n-#\n-# Examples:\n-#     debug git checkout master\n-#     debug --debugger=nemiver git $ARGS\n-#     debug -d \"valgrind --tool=memcheck --track-origins=yes\" git $ARGS\n-debug () {\n-\tcase \"$1\" in\n-\t-d)\n-\t\tGIT_DEBUGGER=\"$2\" &&\n-\t\tshift 2\n-\t\t;;\n-\t--debugger=*)\n-\t\tGIT_DEBUGGER=\"${1#*=}\" &&\n-\t\tshift 1\n-\t\t;;\n-\t*)\n-\t\tGIT_DEBUGGER=1\n-\t\t;;\n-\tesac &&\n-\tGIT_DEBUGGER=\"${GIT_DEBUGGER}\" \"$@\" <&6 >&5 2>&7\n-}\n-\n # Usage: test_commit [options] <message> [<file> [<contents> [<tag>]]]\n #   -C <dir>:\n #\tRun all git commands in directory <dir>\n@@ -369,25 +313,6 @@ test_commit_bulk () {\n \n }\n \n-# This function helps systems where core.filemode=false is set.\n-# Use it instead of plain 'chmod +x' to set or unset the executable bit\n-# of a file in the working directory and add it to the index.\n-\n-test_chmod () {\n-\tchmod \"$@\" &&\n-\tgit update-index --add \"--chmod=$@\"\n-}\n-\n-# Get the modebits from a file or directory, ignoring the setgid bit (g+s).\n-# This bit is inherited by subdirectories at their creation. So we remove it\n-# from the returning string to prevent callers from having to worry about the\n-# state of the bit in the test directory.\n-#\n-test_modebits () {\n-\tls -ld \"$1\" | sed -e 's|^\\(..........\\).*|\\1|' \\\n-\t\t\t  -e 's|^\\(......\\)S|\\1-|' -e 's|^\\(......\\)s|\\1x|'\n-}\n-\n # Unset a configuration variable, but don't fail if it doesn't exist.\n test_unconfig () {\n \tconfig_dir=\n@@ -716,99 +641,6 @@ test_external_without_stderr () {\n \tfi\n }\n \n-# debugging-friendly alternatives to \"test [-f|-d|-e]\"\n-# The commands test the existence or non-existence of $1\n-test_path_is_file () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\tif ! test -f \"$1\"\n-\tthen\n-\t\techo \"File $1 doesn't exist\"\n-\t\tfalse\n-\tfi\n-}\n-\n-test_path_is_dir () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\tif ! test -d \"$1\"\n-\tthen\n-\t\techo \"Directory $1 doesn't exist\"\n-\t\tfalse\n-\tfi\n-}\n-\n-test_path_exists () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\tif ! test -e \"$1\"\n-\tthen\n-\t\techo \"Path $1 doesn't exist\"\n-\t\tfalse\n-\tfi\n-}\n-\n-# Check if the directory exists and is empty as expected, barf otherwise.\n-test_dir_is_empty () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\ttest_path_is_dir \"$1\" &&\n-\tif test -n \"$(ls -a1 \"$1\" | egrep -v '^\\.\\.?$')\"\n-\tthen\n-\t\techo \"Directory '$1' is not empty, it contains:\"\n-\t\tls -la \"$1\"\n-\t\treturn 1\n-\tfi\n-}\n-\n-# Check if the file exists and has a size greater than zero\n-test_file_not_empty () {\n-\ttest \"$#\" = 2 && BUG \"2 param\"\n-\tif ! test -s \"$1\"\n-\tthen\n-\t\techo \"'$1' is not a non-empty file.\"\n-\t\tfalse\n-\tfi\n-}\n-\n-test_path_is_missing () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\tif test -e \"$1\"\n-\tthen\n-\t\techo \"Path exists:\"\n-\t\tls -ld \"$1\"\n-\t\tif test $# -ge 1\n-\t\tthen\n-\t\t\techo \"$*\"\n-\t\tfi\n-\t\tfalse\n-\tfi\n-}\n-\n-# test_line_count checks that a file has the number of lines it\n-# ought to. For example:\n-#\n-#\ttest_expect_success 'produce exactly one line of output' '\n-#\t\tdo something >output &&\n-#\t\ttest_line_count = 1 output\n-#\t'\n-#\n-# is like \"test $(wc -l <output) = 1\" except that it passes the\n-# output through when the number of lines is wrong.\n-\n-test_line_count () {\n-\tif test $# != 3\n-\tthen\n-\t\tBUG \"not 3 parameters to test_line_count\"\n-\telif ! test $(wc -l <\"$3\") \"$1\" \"$2\"\n-\tthen\n-\t\techo \"test_line_count: line count for $3 !$1 $2\"\n-\t\tcat \"$3\"\n-\t\treturn 1\n-\tfi\n-}\n-\n-test_file_size () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\ttest-tool path-utils file-size \"$1\"\n-}\n-\n # Returns success if a comma separated string of keywords ($1) contains a\n # given keyword ($2).\n # Examples:\n@@ -1074,20 +906,6 @@ verbose () {\n \treturn 1\n }\n \n-# Check if the file expected to be empty is indeed empty, and barfs\n-# otherwise.\n-\n-test_must_be_empty () {\n-\ttest \"$#\" -ne 1 && BUG \"1 param\"\n-\ttest_path_is_file \"$1\" &&\n-\tif test -s \"$1\"\n-\tthen\n-\t\techo \"'$1' is not empty, it contains:\"\n-\t\tcat \"$1\"\n-\t\treturn 1\n-\tfi\n-}\n-\n # Tests that its two parameters refer to the same revision, or if '!' is\n # provided first, that its other two parameters refer to different\n # revisions.\n@@ -1411,21 +1229,6 @@ test_match_signal () {\n \treturn 1\n }\n \n-# Read up to \"$1\" bytes (or to EOF) from stdin and write them to stdout.\n-test_copy_bytes () {\n-\tperl -e '\n-\t\tmy $len = $ARGV[1];\n-\t\twhile ($len > 0) {\n-\t\t\tmy $s;\n-\t\t\tmy $nread = sysread(STDIN, $s, $len);\n-\t\t\tdie \"cannot read: $!\" unless defined($nread);\n-\t\t\tlast unless $nread;\n-\t\t\tprint $s;\n-\t\t\t$len -= $nread;\n-\t\t}\n-\t' - \"$1\"\n-}\n-\n # run \"$@\" inside a non-git directory\n nongit () {\n \ttest -d non-repo ||\n@@ -1440,54 +1243,6 @@ nongit () {\n \t)\n } 7>&2 2>&4\n \n-# convert function arguments or stdin (if not arguments given) to pktline\n-# representation. If multiple arguments are given, they are separated by\n-# whitespace and put in a single packet. Note that data containing NULs must be\n-# given on stdin, and that empty input becomes an empty packet, not a flush\n-# packet (for that you can just print 0000 yourself).\n-packetize () {\n-\tif test $# -gt 0\n-\tthen\n-\t\tpacket=\"$*\"\n-\t\tprintf '%04x%s' \"$((4 + ${#packet}))\" \"$packet\"\n-\telse\n-\t\tperl -e '\n-\t\t\tmy $packet = do { local $/; <STDIN> };\n-\t\t\tprintf \"%04x%s\", 4 + length($packet), $packet;\n-\t\t'\n-\tfi\n-}\n-\n-# Parse the input as a series of pktlines, writing the result to stdout.\n-# Sideband markers are removed automatically, and the output is routed to\n-# stderr if appropriate.\n-#\n-# NUL bytes are converted to \"\\\\0\" for ease of parsing with text tools.\n-depacketize () {\n-\tperl -e '\n-\t\twhile (read(STDIN, $len, 4) == 4) {\n-\t\t\tif ($len eq \"0000\") {\n-\t\t\t\tprint \"FLUSH\\n\";\n-\t\t\t} else {\n-\t\t\t\tread(STDIN, $buf, hex($len) - 4);\n-\t\t\t\t$buf =~ s/\\0/\\\\0/g;\n-\t\t\t\tif ($buf =~ s/^[\\x2\\x3]//) {\n-\t\t\t\t\tprint STDERR $buf;\n-\t\t\t\t} else {\n-\t\t\t\t\t$buf =~ s/^\\x1//;\n-\t\t\t\t\tprint $buf;\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n-\t'\n-}\n-\n-# Converts base-16 data into base-8. The output is given as a sequence of\n-# escaped octals, suitable for consumption by 'printf'.\n-hex2oct () {\n-\tperl -ne 'printf \"\\\\%03o\", hex for /../g'\n-}\n-\n # Set the hash algorithm in use to $1.  Only useful when testing the testsuite.\n test_set_hash () {\n \ttest_hash_algo=\"$1\"\n@@ -1611,16 +1366,6 @@ test_set_port () {\n \teval $var=$port\n }\n \n-# Tests for the hidden file attribute on Windows\n-test_path_is_hidden () {\n-\ttest_have_prereq MINGW ||\n-\tBUG \"test_path_is_hidden can only be used on Windows\"\n-\n-\t# Use the output of `attrib`, ignore the absolute path\n-\tcase \"$(\"$SYSTEMROOT\"/system32/attrib \"$1\")\" in *H*?:*) return 0;; esac\n-\treturn 1\n-}\n-\n # Check that the given command was invoked as part of the\n # trace2-format trace on stdin.\n #\ndiff --git a/t/test-lib-functions/debug.sh b/t/test-lib-functions/debug.sh\nnew file mode 100644\nindex 00000000000..4393bf82f02\n--- /dev/null\n+++ b/t/test-lib-functions/debug.sh\n@@ -0,0 +1,99 @@\n+# Included by test-lib.sh via test-lib-functions.sh\n+#\n+# Text munging functions, e.g. wrappers for perl, tr, sed\n+# etc. one-liners.\n+\n+lf_to_nul () {\n+\tperl -pe 'y/\\012/\\000/'\n+}\n+\n+nul_to_q () {\n+\tperl -pe 'y/\\000/Q/'\n+}\n+\n+q_to_nul () {\n+\tperl -pe 'y/Q/\\000/'\n+}\n+\n+q_to_cr () {\n+\ttr Q '\\015'\n+}\n+\n+q_to_tab () {\n+\ttr Q '\\011'\n+}\n+\n+qz_to_tab_space () {\n+\ttr QZ '\\011\\040'\n+}\n+\n+append_cr () {\n+\tsed -e 's/$/Q/' | tr Q '\\015'\n+}\n+\n+remove_cr () {\n+\ttr '\\015' Q | sed -e 's/Q$//'\n+}\n+\n+# Converts base-16 data into base-8. The output is given as a sequence of\n+# escaped octals, suitable for consumption by 'printf'.\n+hex2oct () {\n+\tperl -ne 'printf \"\\\\%03o\", hex for /../g'\n+}\n+\n+# convert function arguments or stdin (if not arguments given) to pktline\n+# representation. If multiple arguments are given, they are separated by\n+# whitespace and put in a single packet. Note that data containing NULs must be\n+# given on stdin, and that empty input becomes an empty packet, not a flush\n+# packet (for that you can just print 0000 yourself).\n+packetize () {\n+\tif test $# -gt 0\n+\tthen\n+\t\tpacket=\"$*\"\n+\t\tprintf '%04x%s' \"$((4 + ${#packet}))\" \"$packet\"\n+\telse\n+\t\tperl -e '\n+\t\t\tmy $packet = do { local $/; <STDIN> };\n+\t\t\tprintf \"%04x%s\", 4 + length($packet), $packet;\n+\t\t'\n+\tfi\n+}\n+\n+# Parse the input as a series of pktlines, writing the result to stdout.\n+# Sideband markers are removed automatically, and the output is routed to\n+# stderr if appropriate.\n+#\n+# NUL bytes are converted to \"\\\\0\" for ease of parsing with text tools.\n+depacketize () {\n+\tperl -e '\n+\t\twhile (read(STDIN, $len, 4) == 4) {\n+\t\t\tif ($len eq \"0000\") {\n+\t\t\t\tprint \"FLUSH\\n\";\n+\t\t\t} else {\n+\t\t\t\tread(STDIN, $buf, hex($len) - 4);\n+\t\t\t\t$buf =~ s/\\0/\\\\0/g;\n+\t\t\t\tif ($buf =~ s/^[\\x2\\x3]//) {\n+\t\t\t\t\tprint STDERR $buf;\n+\t\t\t\t} else {\n+\t\t\t\t\t$buf =~ s/^\\x1//;\n+\t\t\t\t\tprint $buf;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t'\n+}\n+\n+# Read up to \"$1\" bytes (or to EOF) from stdin and write them to stdout.\n+test_copy_bytes () {\n+\tperl -e '\n+\t\tmy $len = $ARGV[1];\n+\t\twhile ($len > 0) {\n+\t\t\tmy $s;\n+\t\t\tmy $nread = sysread(STDIN, $s, $len);\n+\t\t\tdie \"cannot read: $!\" unless defined($nread);\n+\t\t\tlast unless $nread;\n+\t\t\tprint $s;\n+\t\t\t$len -= $nread;\n+\t\t}\n+\t' - \"$1\"\n+}\ndiff --git a/t/test-lib-functions/path.sh b/t/test-lib-functions/path.sh\nnew file mode 100644\nindex 00000000000..af1dd140c27\n--- /dev/null\n+++ b/t/test-lib-functions/path.sh\n@@ -0,0 +1,137 @@\n+# Included by test-lib.sh via test-lib-functions.sh\n+#\n+# File functions, e.g. wrappers for \"test [-e|-s|-f|...]\", \"wc -l\"\n+# etc.\n+\n+# ... test -f\n+test_path_is_file () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\tif ! test -f \"$1\"\n+\tthen\n+\t\techo \"File $1 doesn't exist\"\n+\t\tfalse\n+\tfi\n+}\n+\n+# ... test -d\n+test_path_is_dir () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\tif ! test -d \"$1\"\n+\tthen\n+\t\techo \"Directory $1 doesn't exist\"\n+\t\tfalse\n+\tfi\n+}\n+\n+# test -d && is_empty()\n+test_dir_is_empty () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\ttest_path_is_dir \"$1\" &&\n+\tif test -n \"$(ls -a1 \"$1\" | egrep -v '^\\.\\.?$')\"\n+\tthen\n+\t\techo \"Directory '$1' is not empty, it contains:\"\n+\t\tls -la \"$1\"\n+\t\treturn 1\n+\tfi\n+}\n+\n+# ... test -e\n+test_path_exists () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\tif ! test -e \"$1\"\n+\tthen\n+\t\techo \"Path $1 doesn't exist\"\n+\t\tfalse\n+\tfi\n+}\n+\n+# ... ! test -e\n+test_path_is_missing () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\tif test -e \"$1\"\n+\tthen\n+\t\techo \"Path exists:\"\n+\t\tls -ld \"$1\"\n+\t\tif test $# -ge 1\n+\t\tthen\n+\t\t\techo \"$*\"\n+\t\tfi\n+\t\tfalse\n+\tfi\n+}\n+\n+# ... test -s\n+test_must_be_empty () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\ttest_path_is_file \"$1\" &&\n+\tif test -s \"$1\"\n+\tthen\n+\t\techo \"'$1' is not empty, it contains:\"\n+\t\tcat \"$1\"\n+\t\treturn 1\n+\tfi\n+}\n+\n+# ... ! test -s\n+test_file_not_empty () {\n+\ttest \"$#\" = 2 && BUG \"2 param\"\n+\tif ! test -s \"$1\"\n+\tthen\n+\t\techo \"'$1' is not a non-empty file.\"\n+\t\tfalse\n+\tfi\n+}\n+\n+test_file_size () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n+\ttest-tool path-utils file-size \"$1\"\n+}\n+\n+# This function helps systems where core.filemode=false is set.\n+# Use it instead of plain 'chmod +x' to set or unset the executable bit\n+# of a file in the working directory and add it to the index.\n+test_chmod () {\n+\tchmod \"$@\" &&\n+\tgit update-index --add \"--chmod=$@\"\n+}\n+\n+# Get the modebits from a file or directory, ignoring the setgid bit (g+s).\n+# This bit is inherited by subdirectories at their creation. So we remove it\n+# from the returning string to prevent callers from having to worry about the\n+# state of the bit in the test directory.\n+test_modebits () {\n+\tls -ld \"$1\" | sed -e 's|^\\(..........\\).*|\\1|' \\\n+\t\t\t  -e 's|^\\(......\\)S|\\1-|' -e 's|^\\(......\\)s|\\1x|'\n+}\n+\n+# test_line_count checks that a file has the number of lines it\n+# ought to. For example:\n+#\n+#\ttest_expect_success 'produce exactly one line of output' '\n+#\t\tdo something >output &&\n+#\t\ttest_line_count = 1 output\n+#\t'\n+#\n+# is like \"test $(wc -l <output) = 1\" except that it passes the\n+# output through when the number of lines is wrong.\n+test_line_count () {\n+\tif test $# != 3\n+\tthen\n+\t\tBUG \"not 3 parameters to test_line_count\"\n+\telif ! test $(wc -l <\"$3\") \"$1\" \"$2\"\n+\tthen\n+\t\techo \"test_line_count: line count for $3 !$1 $2\"\n+\t\tcat \"$3\"\n+\t\treturn 1\n+\tfi\n+}\n+\n+# Tests for the hidden file attribute on Windows\n+test_path_is_hidden () {\n+\ttest_have_prereq MINGW ||\n+\tBUG \"test_path_is_hidden can only be used on Windows\"\n+\n+\t# Use the output of `attrib`, ignore the absolute path\n+\tcase \"$(\"$SYSTEMROOT\"/system32/attrib \"$1\")\" in *H*?:*) return 0;; esac\n+\treturn 1\n+}\ndiff --git a/t/test-lib-functions/text.sh b/t/test-lib-functions/text.sh\nnew file mode 100644\nindex 00000000000..e5f438ffd31\n--- /dev/null\n+++ b/t/test-lib-functions/text.sh\n@@ -0,0 +1,33 @@\n+# Included by test-lib.sh via test-lib-functions.sh\n+#\n+# Debugging functions, not intended to be present in submitted\n+# patches. Be sure to remove their use before submitting.\n+\n+# Stop execution and start a shell.\n+test_pause () {\n+\t\"$SHELL_PATH\" <&6 >&5 2>&7\n+}\n+\n+# Wrap git with a debugger. Adding this to a command can make it easier\n+# to understand what is going on in a failing test.\n+#\n+# Examples:\n+#     debug git checkout master\n+#     debug --debugger=nemiver git $ARGS\n+#     debug -d \"valgrind --tool=memcheck --track-origins=yes\" git $ARGS\n+debug () {\n+\tcase \"$1\" in\n+\t-d)\n+\t\tGIT_DEBUGGER=\"$2\" &&\n+\t\tshift 2\n+\t\t;;\n+\t--debugger=*)\n+\t\tGIT_DEBUGGER=\"${1#*=}\" &&\n+\t\tshift 1\n+\t\t;;\n+\t*)\n+\t\tGIT_DEBUGGER=1\n+\t\t;;\n+\tesac &&\n+\tGIT_DEBUGGER=\"${GIT_DEBUGGER}\" \"$@\" <&6 >&5 2>&7\n+}\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416578","messageId":"20210209214159.22815-6-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 05/12] test libs: rename bundle helper to \"lib-bundle.sh\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:52Z","receivedAt":"2021-02-09T23:03:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Rename the recently introduced test-bundle-functions.sh to be\nconsistent with other lib-*.sh files, which is the convention for\nthese sorts of shared test library functions.\n\nThe new test-bundle-functions.sh was introduced in 9901164d81d (test:\nadd helper functions for git-bundle, 2021-01-11). It was the only\ntest-*.sh of this nature.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/{test-bundle-functions.sh => lib-bundle.sh} | 0\n t/t5510-fetch.sh                              | 2 +-\n t/t6020-bundle-misc.sh                        | 2 +-\n 3 files changed, 2 insertions(+), 2 deletions(-)\n rename t/{test-bundle-functions.sh => lib-bundle.sh} (100%)\n\ndiff --git a/t/test-bundle-functions.sh b/t/lib-bundle.sh\nsimilarity index 100%\nrename from t/test-bundle-functions.sh\nrename to t/lib-bundle.sh\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 42f55030047..c1e0eb39231 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/test-bundle-functions.sh\n+. \"$TEST_DIRECTORY\"/lib-bundle.sh\n \n D=$(pwd)\n \ndiff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh\nindex 6249420a806..da5fe1ba6de 100755\n--- a/t/t6020-bundle-misc.sh\n+++ b/t/t6020-bundle-misc.sh\n@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/test-bundle-functions.sh\n+. \"$TEST_DIRECTORY\"/lib-bundle.sh\n \n # Create a commit or tag and set the variable with the object ID.\n test_commit_setvar () {\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416579","messageId":"20210209214159.22815-11-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 10/12] test-lib-functions: remove bug-inducing \"diagnostics\" helper param","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:57Z","receivedAt":"2021-02-09T23:03:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the optional \"diagnostics\" parameter of the\ntest_path_is_{file,dir,missing} functions.\n\nWe have a lot of uses of these functions, but the only legitimate use\nof the diagnostics parameter is from when the functions themselves\nwere introduced in 2caf20c52b7 (test-lib: user-friendly alternatives\nto test [-d|-f|-e], 2010-08-10).\n\nBut as the the rest of this diff demonstrates its presence did more to\nsilently introduce bugs in our tests. Fix such bugs in the tests added\nin ae4e89e549b (gc: add --keep-largest-pack option, 2018-04-15), and\nc04ba51739a (t6046: testcases checking whether updates can be skipped\nin a merge, 2018-04-19).\n\nLet's also assert that those functions are called with exactly one\nparameter, a follow-up commit will add similar asserts to other\nfunctions in test-lib-functions.sh that we didn't have existing misuse\nof.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/README                               |  8 ++++----\n t/t3404-rebase-interactive.sh          |  3 ++-\n t/t6426-merge-skip-unneeded-updates.sh | 16 ++++++++++++----\n t/t6500-gc.sh                          |  4 ++--\n t/test-lib-functions.sh                | 11 ++++++-----\n 5 files changed, 26 insertions(+), 16 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex c730a707705..df38d8d6be3 100644\n--- a/t/README\n+++ b/t/README\n@@ -917,13 +917,13 @@ library for your script to use.\n \n    Check whether a file has the length it is expected to.\n \n- - test_path_is_file <path> [<diagnosis>]\n-   test_path_is_dir <path> [<diagnosis>]\n-   test_path_is_missing <path> [<diagnosis>]\n+ - test_path_is_file <path>\n+   test_path_is_dir <path>\n+   test_path_is_missing <path>\n \n    Check if the named path is a file, if the named path is a\n    directory, or if the named path does not exist, respectively,\n-   and fail otherwise, showing the <diagnosis> text.\n+   and fail otherwise.\n \n  - test_when_finished <script>\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 1e738df81d5..28c2d15d807 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -101,7 +101,8 @@ test_expect_success 'rebase -i with the exec command' '\n \t) &&\n \ttest_path_is_file touch-one &&\n \ttest_path_is_file touch-two &&\n-\ttest_path_is_missing touch-three \" (should have stopped before)\" &&\n+\t# Missing because we should have stopped by now.\n+\ttest_path_is_missing touch-three &&\n \ttest_cmp_rev C HEAD &&\n \tgit rebase --continue &&\n \ttest_path_is_file touch-three &&\ndiff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh\nindex d7eeee43106..7b5f1c1dcd1 100755\n--- a/t/t6426-merge-skip-unneeded-updates.sh\n+++ b/t/t6426-merge-skip-unneeded-updates.sh\n@@ -492,7 +492,9 @@ test_expect_success '3a-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \n@@ -522,7 +524,9 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \n@@ -588,7 +592,9 @@ test_expect_success '3b-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \n@@ -618,7 +624,9 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 4a3b8f48ac6..7879a6b8c51 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -78,7 +78,7 @@ test_expect_success 'gc --keep-largest-pack' '\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\tcp pack-list base-pack-list &&\n \t\ttest_commit four &&\n \t\tgit repack -d &&\n \t\ttest_commit five &&\n@@ -90,7 +90,7 @@ test_expect_success 'gc --keep-largest-pack' '\n \t\ttest_line_count = 2 pack-list &&\n \t\tawk \"/^P /{print \\$2}\" <.git/objects/info/packs >pack-info &&\n \t\ttest_line_count = 2 pack-info &&\n-\t\ttest_path_is_file $BASE_PACK &&\n+\t\ttest_path_is_file .git/objects/pack/$(cat base-pack-list) &&\n \t\tgit fsck\n \t)\n '\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex f228647c2b8..109d1b548ce 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -717,12 +717,12 @@ test_external_without_stderr () {\n }\n \n # debugging-friendly alternatives to \"test [-f|-d|-e]\"\n-# The commands test the existence or non-existence of $1. $2 can be\n-# given to provide a more precise diagnosis.\n+# The commands test the existence or non-existence of $1\n test_path_is_file () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif ! test -f \"$1\"\n \tthen\n-\t\techo \"File $1 doesn't exist. $2\"\n+\t\techo \"File $1 doesn't exist\"\n \t\tfalse\n \tfi\n }\n@@ -730,15 +730,16 @@ test_path_is_file () {\n test_path_is_dir () {\n \tif ! test -d \"$1\"\n \tthen\n-\t\techo \"Directory $1 doesn't exist. $2\"\n+\t\techo \"Directory $1 doesn't exist\"\n \t\tfalse\n \tfi\n }\n \n test_path_exists () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif ! test -e \"$1\"\n \tthen\n-\t\techo \"Path $1 doesn't exist. $2\"\n+\t\techo \"Path $1 doesn't exist\"\n \t\tfalse\n \tfi\n }\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416580","messageId":"20210209214159.22815-7-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 06/12] test libs: rename gitweb-lib.sh to lib-gitweb.sh","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:53Z","receivedAt":"2021-02-09T23:05:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Rename gitweb-lib.sh to lib-gitweb.sh for consistency with other test\nlibrary files.\n\nWhen it was introduced in 05526071cb5 (gitweb: split test suite into\nlibrary and tests, 2009-08-27) this naming pattern was more\ncommon.\n\nSince then all but one other such library which didn't start with\n\"lib-*.sh\" such as t6000lib.sh has been been renamed, see\ne.g. 9d488eb40e2 (Move t6000lib.sh to lib-*, 2010-05-07).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/{gitweb-lib.sh => lib-gitweb.sh}        | 0\n t/t9500-gitweb-standalone-no-errors.sh    | 2 +-\n t/t9501-gitweb-standalone-http-status.sh  | 2 +-\n t/t9502-gitweb-standalone-parse-output.sh | 2 +-\n 4 files changed, 3 insertions(+), 3 deletions(-)\n rename t/{gitweb-lib.sh => lib-gitweb.sh} (100%)\n\ndiff --git a/t/gitweb-lib.sh b/t/lib-gitweb.sh\nsimilarity index 100%\nrename from t/gitweb-lib.sh\nrename to t/lib-gitweb.sh\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex ee8c6e30e67..0333065d4d6 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -13,7 +13,7 @@ or warnings to log.'\n GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n-. ./gitweb-lib.sh\n+. ./lib-gitweb.sh\n \n # ----------------------------------------------------------------------\n # no commits (empty, just initialized repository)\ndiff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh\nindex 141610de546..32814e75df5 100755\n--- a/t/t9501-gitweb-standalone-http-status.sh\n+++ b/t/t9501-gitweb-standalone-http-status.sh\n@@ -13,7 +13,7 @@ code and message.'\n GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n-. ./gitweb-lib.sh\n+. ./lib-gitweb.sh\n \n #\n # Gitweb only provides the functionality tested by the 'modification times'\ndiff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh\nindex 9cf7ab30a8d..3167473b303 100755\n--- a/t/t9502-gitweb-standalone-parse-output.sh\n+++ b/t/t9502-gitweb-standalone-parse-output.sh\n@@ -13,7 +13,7 @@ in the HTTP header or the actual script output.'\n GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n-. ./gitweb-lib.sh\n+. ./lib-gitweb.sh\n \n # ----------------------------------------------------------------------\n # snapshot file name and prefix\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416581","messageId":"20210209214159.22815-10-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 09/12] test libs: rename \"diff-lib\" to \"lib-diff\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:56Z","receivedAt":"2021-02-09T23:05:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Rename the \"diff-lib\" to \"lib-diff\". With this rename and preceding\ncommits there is no remaining t/*lib* which doesn't follow the\nconvention of being called t/lib-*.\n---\n t/.gitattributes                      | 2 +-\n t/{diff-lib.sh => lib-diff.sh}        | 0\n t/{diff-lib => lib-diff}/COPYING      | 0\n t/{diff-lib => lib-diff}/README       | 0\n t/t4000-diff-format.sh                | 2 +-\n t/t4001-diff-rename.sh                | 2 +-\n t/t4003-diff-rename-1.sh              | 6 +++---\n t/t4004-diff-rename-symlink.sh        | 2 +-\n t/t4005-diff-rename-2.sh              | 6 +++---\n t/t4007-rename-3.sh                   | 6 +++---\n t/t4008-diff-break-rewrite.sh         | 6 +++---\n t/t4009-diff-rename-4.sh              | 6 +++---\n t/t4010-diff-pathspec.sh              | 2 +-\n t/t4011-diff-symlink.sh               | 2 +-\n t/t4013-diff-various.sh               | 2 +-\n t/t4015-diff-whitespace.sh            | 2 +-\n t/t4027-diff-submodule.sh             | 2 +-\n t/t4034-diff-words.sh                 | 2 +-\n t/t4038-diff-combined.sh              | 2 +-\n t/t4061-diff-indent.sh                | 2 +-\n t/t4206-log-follow-harder-copies.sh   | 2 +-\n t/t7501-commit-basic-functionality.sh | 2 +-\n t/t9300-fast-import.sh                | 2 +-\n 23 files changed, 30 insertions(+), 30 deletions(-)\n rename t/{diff-lib.sh => lib-diff.sh} (100%)\n rename t/{diff-lib => lib-diff}/COPYING (100%)\n rename t/{diff-lib => lib-diff}/README (100%)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex d778bfad052..dafa17c3e61 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -1,6 +1,6 @@\n t[0-9][0-9][0-9][0-9]/* -whitespace\n /chainlint/*.expect eol=lf\n-/diff-lib/* eol=lf\n+/lib-diff/* eol=lf\n /t0110/url-* binary\n /t3206/* eol=lf\n /t3900/*.txt eol=lf\ndiff --git a/t/diff-lib.sh b/t/lib-diff.sh\nsimilarity index 100%\nrename from t/diff-lib.sh\nrename to t/lib-diff.sh\ndiff --git a/t/diff-lib/COPYING b/t/lib-diff/COPYING\nsimilarity index 100%\nrename from t/diff-lib/COPYING\nrename to t/lib-diff/COPYING\ndiff --git a/t/diff-lib/README b/t/lib-diff/README\nsimilarity index 100%\nrename from t/diff-lib/README\nrename to t/lib-diff/README\ndiff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh\nindex e5116a76a1c..cce334981e1 100755\n--- a/t/t4000-diff-format.sh\n+++ b/t/t4000-diff-format.sh\n@@ -7,7 +7,7 @@ test_description='Test built-in diff output engine.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n echo >path0 'Line 1\n Line 2\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex c16486a9d41..2f9700742aa 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -7,7 +7,7 @@ test_description='Test rename detection in diff engine.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success 'setup' '\n \tcat >path0 <<-\\EOF &&\ndiff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\nindex df2accb6555..db07ff3eb19 100755\n--- a/t/t4003-diff-rename-1.sh\n+++ b/t/t4003-diff-rename-1.sh\n@@ -7,11 +7,11 @@ test_description='More rename detection\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success \\\n     'prepare reference tree' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      echo frotz >rezrov &&\n     git update-index --add COPYING rezrov &&\n     tree=$(git write-tree) &&\n@@ -99,7 +99,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'prepare work tree once again' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      git update-index --add --remove COPYING COPYING.1'\n \n # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\ndiff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh\nindex 6e562c80d12..3d495e37bb1 100755\n--- a/t/t4004-diff-rename-symlink.sh\n+++ b/t/t4004-diff-rename-symlink.sh\n@@ -10,7 +10,7 @@ copy of symbolic links, but should not produce rename/copy followed\n by an edit for them.\n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success SYMLINKS \\\n     'prepare reference tree' \\\ndiff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh\nindex d18a80493c2..86479061325 100755\n--- a/t/t4005-diff-rename-2.sh\n+++ b/t/t4005-diff-rename-2.sh\n@@ -6,10 +6,10 @@\n test_description='Same rename detection as t4003 but testing diff-raw.'\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success 'setup reference tree' '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n \techo frotz >rezrov &&\n \tgit update-index --add COPYING rezrov &&\n \ttree=$(git write-tree) &&\n@@ -64,7 +64,7 @@ test_expect_success 'validate output from rename/copy detection (#2)' '\n # nows how to say Copy.\n \n test_expect_success 'validate output from rename/copy detection (#3)' '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n \tgit update-index --add --remove COPYING COPYING.1 &&\n \n \tcat <<-EOF >expected &&\ndiff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\nindex b187b7f6c66..cbb9c62f535 100755\n--- a/t/t4007-rename-3.sh\n+++ b/t/t4007-rename-3.sh\n@@ -7,17 +7,17 @@ test_description='Rename interaction with pathspec.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success 'prepare reference tree' '\n \tmkdir path0 path1 &&\n-\tcp \"$TEST_DIRECTORY\"/diff-lib/COPYING path0/COPYING &&\n+\tcp \"$TEST_DIRECTORY\"/lib-diff/COPYING path0/COPYING &&\n \tgit update-index --add path0/COPYING &&\n \ttree=$(git write-tree) &&\n \techo $tree\n '\n \n-blob=$(git hash-object \"$TEST_DIRECTORY/diff-lib/COPYING\")\n+blob=$(git hash-object \"$TEST_DIRECTORY/lib-diff/COPYING\")\n test_expect_success 'prepare work tree' '\n \tcp path0/COPYING path1/COPYING &&\n \tgit update-index --add --remove path0/COPYING path1/COPYING\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex b1ccd4102e0..2299f27511b 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -22,11 +22,11 @@ With -B, this should be detected as two complete rewrites.\n Further, with -B and -M together, these should turn into two renames.\n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success setup '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/README >file0 &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >file1 &&\n \tblob0_id=$(git hash-object file0) &&\n \tblob1_id=$(git hash-object file1) &&\n \tgit update-index --add file0 file1 &&\ndiff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh\nindex b63bdf031f5..b1da807f169 100755\n--- a/t/t4009-diff-rename-4.sh\n+++ b/t/t4009-diff-rename-4.sh\n@@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success \\\n     'prepare reference tree' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      echo frotz >rezrov &&\n     git update-index --add COPYING rezrov &&\n     orig=$(git hash-object COPYING) &&\n@@ -81,7 +81,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'prepare work tree once again' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      git update-index --add --remove COPYING COPYING.1'\n \n git diff-index -z -C --find-copies-harder $tree >current\ndiff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\nindex 65cc703c659..1bbced79ece 100755\n--- a/t/t4010-diff-pathspec.sh\n+++ b/t/t4010-diff-pathspec.sh\n@@ -10,7 +10,7 @@ Prepare:\n         path1/file1\n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success \\\n     setup \\\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 717034bb50b..5a25c259fe3 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -7,7 +7,7 @@ test_description='Test diff of symlinks.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n # Print the short OID of a symlink with the given name.\n symlink_oid () {\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex ce6aa3914fe..fcc30d8cc26 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success setup '\n \ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 8c574221b27..2c13b62d3c6 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -7,7 +7,7 @@ test_description='Test special whitespace in diff engine.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success \"Ray Lehtiniemi's example\" '\n \tcat <<-\\EOF >x &&\ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex 894a11b224d..94ef77e1dfe 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -3,7 +3,7 @@\n test_description='difference in submodules'\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success setup '\n \ttest_tick &&\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex 0c8fb39ceda..56f1e62a97b 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -3,7 +3,7 @@\n test_description='word diff colors'\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n cat >pre.simple <<-\\EOF\n \th(4)\ndiff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\nindex 09ad491a593..aeac203c424 100755\n--- a/t/t4038-diff-combined.sh\n+++ b/t/t4038-diff-combined.sh\n@@ -6,7 +6,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n setup_helper () {\n \tone=$1 branch=$2 side=$3 &&\ndiff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh\nindex bcf7493740a..7750b87ca16 100755\n--- a/t/t4061-diff-indent.sh\n+++ b/t/t4061-diff-indent.sh\n@@ -7,7 +7,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n # Compare two diff outputs. Ignore \"index\" lines, because we don't\n # care about SHA-1s or file modes.\ndiff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh\nindex ad29e65fcba..4871a5dc92f 100755\n--- a/t/t4206-log-follow-harder-copies.sh\n+++ b/t/t4206-log-follow-harder-copies.sh\n@@ -7,7 +7,7 @@ test_description='Test --follow should always find copies hard in git log.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n echo >path0 'Line 1\n Line 2\ndiff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh\nindex 0f936182e4f..512ae2781fe 100755\n--- a/t/t7501-commit-basic-functionality.sh\n+++ b/t/t7501-commit-basic-functionality.sh\n@@ -11,7 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY/diff-lib.sh\"\n+. \"$TEST_DIRECTORY/lib-diff.sh\"\n \n author='The Real Author <someguy@his.email.org>'\n \ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 3d17e932a0e..3d77701fd4d 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -8,7 +8,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n verify_packs () {\n \tfor p in .git/objects/pack/*.pack\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416582","messageId":"20210209214159.22815-12-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 11/12] test-lib-functions: assert correct parameter count","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:58Z","receivedAt":"2021-02-09T23:07:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add assertions of the correct parameter count of various functions, in\nparticularly the wrappers for the shell \"test\" built-in.\n\nIn an earlier commit we fixed a bug with an incorrect number of\narguments being passed to \"test_path_is_{file,missing}\". Let's also\nguard other similar functions from the same sort of misuse.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib-functions.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 109d1b548ce..8ec06eb67a0 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -728,6 +728,7 @@ test_path_is_file () {\n }\n \n test_path_is_dir () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif ! test -d \"$1\"\n \tthen\n \t\techo \"Directory $1 doesn't exist\"\n@@ -746,6 +747,7 @@ test_path_exists () {\n \n # Check if the directory exists and is empty as expected, barf otherwise.\n test_dir_is_empty () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest_path_is_dir \"$1\" &&\n \tif test -n \"$(ls -a1 \"$1\" | egrep -v '^\\.\\.?$')\"\n \tthen\n@@ -757,6 +759,7 @@ test_dir_is_empty () {\n \n # Check if the file exists and has a size greater than zero\n test_file_not_empty () {\n+\ttest \"$#\" = 2 && BUG \"2 param\"\n \tif ! test -s \"$1\"\n \tthen\n \t\techo \"'$1' is not a non-empty file.\"\n@@ -765,6 +768,7 @@ test_file_not_empty () {\n }\n \n test_path_is_missing () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif test -e \"$1\"\n \tthen\n \t\techo \"Path exists:\"\n@@ -801,6 +805,7 @@ test_line_count () {\n }\n \n test_file_size () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest-tool path-utils file-size \"$1\"\n }\n \n@@ -973,6 +978,7 @@ test_expect_code () {\n # - not all diff versions understand \"-u\"\n \n test_cmp () {\n+\ttest \"$#\" -ne 2 && BUG \"2 param\"\n \teval \"$GIT_TEST_CMP\" '\"$@\"'\n }\n \n@@ -1002,6 +1008,7 @@ test_cmp_config () {\n # test_cmp_bin - helper to compare binary files\n \n test_cmp_bin () {\n+\ttest \"$#\" -ne 2 && BUG \"2 param\"\n \tcmp \"$@\"\n }\n \n@@ -1071,6 +1078,7 @@ verbose () {\n # otherwise.\n \n test_must_be_empty () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest_path_is_file \"$1\" &&\n \tif test -s \"$1\"\n \tthen\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416583","messageId":"20210209214159.22815-9-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 08/12] t/.gitattributes: sort lines","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:55Z","receivedAt":"2021-02-09T23:10:12Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Sort the lines starting with \"/\", the only out-of-place line was added\nalong with most of the file in 614f4f0f350 (Fix the remaining tests\nthat failed with core.autocrlf=true, 2017-05-09).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/.gitattributes | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex df05434d32c..d778bfad052 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -5,9 +5,9 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n /t3206/* eol=lf\n /t3900/*.txt eol=lf\n /t3901/*.txt eol=lf\n-/t4034/*/* eol=lf\n /t4013/* eol=lf\n /t4018/* eol=lf\n+/t4034/*/* eol=lf\n /t4051/* eol=lf\n /t4100/* eol=lf\n /t4101/* eol=lf\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416584","messageId":"20210209214159.22815-8-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH 07/12] test-lib-functions: move function to lib-bitmap.sh","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-09T21:41:54Z","receivedAt":"2021-02-09T23:10:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move a function added to test-lib-functions.sh in ea047a8eb4f (t5310:\nfactor out bitmap traversal comparison, 2020-02-14) into a new\nlib-bitmap.sh.\n\nThe test-lib-functions.sh file should be for functions that are widely\nused across the test suite, if something's only used by a few tests it\nmakes more sense to have it in a lib-*.sh file.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/lib-bitmap.sh                    | 26 ++++++++++++++++++++++++++\n t/t5310-pack-bitmaps.sh            |  2 ++\n t/t6113-rev-list-bitmap-filters.sh |  1 +\n t/test-lib-functions.sh            | 27 ---------------------------\n 4 files changed, 29 insertions(+), 27 deletions(-)\n create mode 100644 t/lib-bitmap.sh\n\ndiff --git a/t/lib-bitmap.sh b/t/lib-bitmap.sh\nnew file mode 100644\nindex 00000000000..fe3f98be24f\n--- /dev/null\n+++ b/t/lib-bitmap.sh\n@@ -0,0 +1,26 @@\n+# Compare a file containing rev-list bitmap traversal output to its non-bitmap\n+# counterpart. You can't just use test_cmp for this, because the two produce\n+# subtly different output:\n+#\n+#   - regular output is in traversal order, whereas bitmap is split by type,\n+#     with non-packed objects at the end\n+#\n+#   - regular output has a space and the pathname appended to non-commit\n+#     objects; bitmap output omits this\n+#\n+# This function normalizes and compares the two. The second file should\n+# always be the bitmap output.\n+test_bitmap_traversal () {\n+\tif test \"$1\" = \"--no-confirm-bitmaps\"\n+\tthen\n+\t\tshift\n+\telif cmp \"$1\" \"$2\"\n+\tthen\n+\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n+\t\treturn 1\n+\tfi &&\n+\tcut -d' ' -f1 \"$1\" | sort >\"$1.normalized\" &&\n+\tsort \"$2\" >\"$2.normalized\" &&\n+\ttest_cmp \"$1.normalized\" \"$2.normalized\" &&\n+\trm -f \"$1.normalized\" \"$2.normalized\"\n+}\ndiff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\nindex 5ba76031090..40b9f632441 100755\n--- a/t/t5310-pack-bitmaps.sh\n+++ b/t/t5310-pack-bitmaps.sh\n@@ -5,6 +5,8 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-bundle.sh\n+. \"$TEST_DIRECTORY\"/lib-bitmap.sh\n \n objpath () {\n \techo \".git/objects/$(echo \"$1\" | sed -e 's|\\(..\\)|\\1/|')\"\ndiff --git a/t/t6113-rev-list-bitmap-filters.sh b/t/t6113-rev-list-bitmap-filters.sh\nindex 2b551e6fd0c..3f889949ca1 100755\n--- a/t/t6113-rev-list-bitmap-filters.sh\n+++ b/t/t6113-rev-list-bitmap-filters.sh\n@@ -2,6 +2,7 @@\n \n test_description='rev-list combining bitmaps and filters'\n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-bitmap.sh\n \n test_expect_success 'set up bitmapped repo' '\n \t# one commit will have bitmaps, the other will not\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 55d58b4a6ac..f228647c2b8 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -1602,33 +1602,6 @@ test_set_port () {\n \teval $var=$port\n }\n \n-# Compare a file containing rev-list bitmap traversal output to its non-bitmap\n-# counterpart. You can't just use test_cmp for this, because the two produce\n-# subtly different output:\n-#\n-#   - regular output is in traversal order, whereas bitmap is split by type,\n-#     with non-packed objects at the end\n-#\n-#   - regular output has a space and the pathname appended to non-commit\n-#     objects; bitmap output omits this\n-#\n-# This function normalizes and compares the two. The second file should\n-# always be the bitmap output.\n-test_bitmap_traversal () {\n-\tif test \"$1\" = \"--no-confirm-bitmaps\"\n-\tthen\n-\t\tshift\n-\telif cmp \"$1\" \"$2\"\n-\tthen\n-\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n-\t\treturn 1\n-\tfi &&\n-\tcut -d' ' -f1 \"$1\" | sort >\"$1.normalized\" &&\n-\tsort \"$2\" >\"$2.normalized\" &&\n-\ttest_cmp \"$1.normalized\" \"$2.normalized\" &&\n-\trm -f \"$1.normalized\" \"$2.normalized\"\n-}\n-\n # Tests for the hidden file attribute on Windows\n test_path_is_hidden () {\n \ttest_have_prereq MINGW ||\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416593","messageId":"YCMcoyDVNnc8Lkdp@generichostname","threadId":"55129","inReplyTo":"20210209214159.22815-13-avarab@gmail.com","subject":"Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2021-02-09T23:37:07Z","receivedAt":"2021-02-10T00:12:14Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Ævar,\n\nJust a quick drive-by comment:\n\nOn Tue, Feb 09, 2021 at 10:41:59PM +0100, Ævar Arnfjörð Bjarmason wrote:\n> diff --git a/t/test-lib-functions/debug.sh b/t/test-lib-functions/debug.sh\n> new file mode 100644\n> index 00000000000..4393bf82f02\n> --- /dev/null\n> +++ b/t/test-lib-functions/debug.sh\n\nIs this supposed to be text.sh?\n\n> @@ -0,0 +1,99 @@\n> +# Included by test-lib.sh via test-lib-functions.sh\n> +#\n> +# Text munging functions, e.g. wrappers for perl, tr, sed\n> +# etc. one-liners.\n\n[...]\n\n> diff --git a/t/test-lib-functions/text.sh b/t/test-lib-functions/text.sh\n> new file mode 100644\n> index 00000000000..e5f438ffd31\n> --- /dev/null\n> +++ b/t/test-lib-functions/text.sh\n\nAnd is this one supposed to be debug.sh?\n\n> @@ -0,0 +1,33 @@\n> +# Included by test-lib.sh via test-lib-functions.sh\n> +#\n> +# Debugging functions, not intended to be present in submitted\n> +# patches. Be sure to remove their use before submitting.\n> +\n> +# Stop execution and start a shell.\n> +test_pause () {\n> +\t\"$SHELL_PATH\" <&6 >&5 2>&7\n> +}\n> +\n> +# Wrap git with a debugger. Adding this to a command can make it easier\n> +# to understand what is going on in a failing test.\n> +#\n> +# Examples:\n> +#     debug git checkout master\n> +#     debug --debugger=nemiver git $ARGS\n> +#     debug -d \"valgrind --tool=memcheck --track-origins=yes\" git $ARGS\n> +debug () {\n> +\tcase \"$1\" in\n> +\t-d)\n> +\t\tGIT_DEBUGGER=\"$2\" &&\n> +\t\tshift 2\n> +\t\t;;\n> +\t--debugger=*)\n> +\t\tGIT_DEBUGGER=\"${1#*=}\" &&\n> +\t\tshift 1\n> +\t\t;;\n> +\t*)\n> +\t\tGIT_DEBUGGER=1\n> +\t\t;;\n> +\tesac &&\n> +\tGIT_DEBUGGER=\"${GIT_DEBUGGER}\" \"$@\" <&6 >&5 2>&7\n> +}\n> -- \n> 2.30.0.284.gd98b1dd5eaa7\n> \n"},{"id":"416595","messageId":"xmqqpn18yee4.fsf@gitster.c.googlers.com","threadId":"55129","inReplyTo":"20210209214159.22815-13-avarab@gmail.com","subject":"Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-10T00:06:59Z","receivedAt":"2021-02-10T00:12:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Split out the debug, path and text miscellaneous helpers into their\n> own files. The \"test -[efsd]\" etc. helpers were not all in one place\n> in test-lib-functions.sh, I think moving them into their own file\n> makes it easier to follow the code.\n\nI'd prefer not to see this done.  It would be fine to move them in\ndifferent sections but still in the same file to group related\nhelpers together, but I am having enough trouble when deciding to\nlook into which between test-lib.sh and test-lib-functions.sh in the\ncurrent organization already.  And it will make the situation even\nworse if we did this, no?\n"},{"id":"416662","messageId":"20210210205645.GE1015009@szeder.dev","threadId":"55129","inReplyTo":"20210209214159.22815-8-avarab@gmail.com","subject":"Re: [PATCH 07/12] test-lib-functions: move function to lib-bitmap.sh","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-02-10T20:56:45Z","receivedAt":"2021-02-10T20:58:02Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Feb 09, 2021 at 10:41:54PM +0100, Ævar Arnfjörð Bjarmason wrote:\n> Move a function added to test-lib-functions.sh in ea047a8eb4f (t5310:\n> factor out bitmap traversal comparison, 2020-02-14) into a new\n> lib-bitmap.sh.\n> \n> The test-lib-functions.sh file should be for functions that are widely\n> used across the test suite, if something's only used by a few tests it\n> makes more sense to have it in a lib-*.sh file.\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  t/lib-bitmap.sh                    | 26 ++++++++++++++++++++++++++\n>  t/t5310-pack-bitmaps.sh            |  2 ++\n>  t/t6113-rev-list-bitmap-filters.sh |  1 +\n>  t/test-lib-functions.sh            | 27 ---------------------------\n>  4 files changed, 29 insertions(+), 27 deletions(-)\n>  create mode 100644 t/lib-bitmap.sh\n> \n> diff --git a/t/lib-bitmap.sh b/t/lib-bitmap.sh\n> new file mode 100644\n> index 00000000000..fe3f98be24f\n> --- /dev/null\n> +++ b/t/lib-bitmap.sh\n> @@ -0,0 +1,26 @@\n> +# Compare a file containing rev-list bitmap traversal output to its non-bitmap\n> +# counterpart. You can't just use test_cmp for this, because the two produce\n> +# subtly different output:\n> +#\n> +#   - regular output is in traversal order, whereas bitmap is split by type,\n> +#     with non-packed objects at the end\n> +#\n> +#   - regular output has a space and the pathname appended to non-commit\n> +#     objects; bitmap output omits this\n> +#\n> +# This function normalizes and compares the two. The second file should\n> +# always be the bitmap output.\n> +test_bitmap_traversal () {\n> +\tif test \"$1\" = \"--no-confirm-bitmaps\"\n> +\tthen\n> +\t\tshift\n> +\telif cmp \"$1\" \"$2\"\n> +\tthen\n> +\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n> +\t\treturn 1\n\nSince you converted two 'error's to BUG earlier in this series...\n\nThis helper function was added in ea047a8eb4 (t5310: factor out bitmap\ntraversal comparison, 2020-02-14), and so I Cc: its author and quote\npart of its commit message:\n\n    While we're at it, let's also try to confirm that the bitmap output did\n    indeed use bitmaps. Since the code internally falls back to the\n    non-bitmap path in some cases, the tests are at risk of becoming trivial\n    noops.\n    \n    This is a bit fragile, as not all outputs will differ (e.g., looking at\n    only the commits from a fully-bitmapped pack will end up exactly the\n    same as the normal traversal order, since it also matches the pack\n    order). So we'll provide an escape hatch by which tests can disable this\n    check (which should only be used after manually confirming that bitmaps\n    kicked in).\n\nShouldn't this be a BUG as well?  I think this should be a BUG.\n\n> +\tfi &&\n> +\tcut -d' ' -f1 \"$1\" | sort >\"$1.normalized\" &&\n> +\tsort \"$2\" >\"$2.normalized\" &&\n> +\ttest_cmp \"$1.normalized\" \"$2.normalized\" &&\n> +\trm -f \"$1.normalized\" \"$2.normalized\"\n> +}\n> diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\n> index 5ba76031090..40b9f632441 100755\n> --- a/t/t5310-pack-bitmaps.sh\n> +++ b/t/t5310-pack-bitmaps.sh\n> @@ -5,6 +5,8 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>  \n>  . ./test-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-bundle.sh\n> +. \"$TEST_DIRECTORY\"/lib-bitmap.sh\n>  \n>  objpath () {\n>  \techo \".git/objects/$(echo \"$1\" | sed -e 's|\\(..\\)|\\1/|')\"\n> diff --git a/t/t6113-rev-list-bitmap-filters.sh b/t/t6113-rev-list-bitmap-filters.sh\n> index 2b551e6fd0c..3f889949ca1 100755\n> --- a/t/t6113-rev-list-bitmap-filters.sh\n> +++ b/t/t6113-rev-list-bitmap-filters.sh\n> @@ -2,6 +2,7 @@\n>  \n>  test_description='rev-list combining bitmaps and filters'\n>  . ./test-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-bitmap.sh\n>  \n>  test_expect_success 'set up bitmapped repo' '\n>  \t# one commit will have bitmaps, the other will not\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> index 55d58b4a6ac..f228647c2b8 100644\n> --- a/t/test-lib-functions.sh\n> +++ b/t/test-lib-functions.sh\n> @@ -1602,33 +1602,6 @@ test_set_port () {\n>  \teval $var=$port\n>  }\n>  \n> -# Compare a file containing rev-list bitmap traversal output to its non-bitmap\n> -# counterpart. You can't just use test_cmp for this, because the two produce\n> -# subtly different output:\n> -#\n> -#   - regular output is in traversal order, whereas bitmap is split by type,\n> -#     with non-packed objects at the end\n> -#\n> -#   - regular output has a space and the pathname appended to non-commit\n> -#     objects; bitmap output omits this\n> -#\n> -# This function normalizes and compares the two. The second file should\n> -# always be the bitmap output.\n> -test_bitmap_traversal () {\n> -\tif test \"$1\" = \"--no-confirm-bitmaps\"\n> -\tthen\n> -\t\tshift\n> -\telif cmp \"$1\" \"$2\"\n> -\tthen\n> -\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n> -\t\treturn 1\n> -\tfi &&\n> -\tcut -d' ' -f1 \"$1\" | sort >\"$1.normalized\" &&\n> -\tsort \"$2\" >\"$2.normalized\" &&\n> -\ttest_cmp \"$1.normalized\" \"$2.normalized\" &&\n> -\trm -f \"$1.normalized\" \"$2.normalized\"\n> -}\n> -\n>  # Tests for the hidden file attribute on Windows\n>  test_path_is_hidden () {\n>  \ttest_have_prereq MINGW ||\n> -- \n> 2.30.0.284.gd98b1dd5eaa7\n> \n"},{"id":"416663","messageId":"YCRL4lq5eQnPLwK1@coredump.intra.peff.net","threadId":"55129","inReplyTo":"20210210205645.GE1015009@szeder.dev","subject":"Re: [PATCH 07/12] test-lib-functions: move function to lib-bitmap.sh","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-02-10T21:10:58Z","receivedAt":"2021-02-10T21:13:18Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 10, 2021 at 09:56:45PM +0100, SZEDER Gábor wrote:\n\n> > +test_bitmap_traversal () {\n> > +\tif test \"$1\" = \"--no-confirm-bitmaps\"\n> > +\tthen\n> > +\t\tshift\n> > +\telif cmp \"$1\" \"$2\"\n> > +\tthen\n> > +\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n> > +\t\treturn 1\n> \n> Since you converted two 'error's to BUG earlier in this series...\n> \n> This helper function was added in ea047a8eb4 (t5310: factor out bitmap\n> traversal comparison, 2020-02-14), and so I Cc: its author and quote\n> part of its commit message:\n> \n>     While we're at it, let's also try to confirm that the bitmap output did\n>     indeed use bitmaps. Since the code internally falls back to the\n>     non-bitmap path in some cases, the tests are at risk of becoming trivial\n>     noops.\n>     \n>     This is a bit fragile, as not all outputs will differ (e.g., looking at\n>     only the commits from a fully-bitmapped pack will end up exactly the\n>     same as the normal traversal order, since it also matches the pack\n>     order). So we'll provide an escape hatch by which tests can disable this\n>     check (which should only be used after manually confirming that bitmaps\n>     kicked in).\n> \n> Shouldn't this be a BUG as well?  I think this should be a BUG.\n\nI dunno. I guess you are thinking of the case where somebody adds a new\ncaller but fails to invoke Git correctly. Which would be a bug in the\ntest script.\n\nBut it could also easily be due to Git changing how it behaves in a\ncertain circumstance. And maybe the solution is changing the test to\nadapt, or maybe we just found a bug in Git.\n\nTBH, I do not care that much either way. Either way, I think somebody\nwould notice the problem.\n\n-Peff\n"},{"id":"416668","messageId":"xmqqeehn1t9c.fsf@gitster.c.googlers.com","threadId":"55129","inReplyTo":"20210209214159.22815-10-avarab@gmail.com","subject":"Re: [PATCH 09/12] test libs: rename \"diff-lib\" to \"lib-diff\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-10T21:56:47Z","receivedAt":"2021-02-10T21:57:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Rename the \"diff-lib\" to \"lib-diff\". With this rename and preceding\n> commits there is no remaining t/*lib* which doesn't follow the\n> convention of being called t/lib-*.\n> ---\n\nSeeing nothing (other than the OID length abstraction that prepares\nus for SHA-256 world) has happened since 2009, I have no issue with\nthis change and no in-flight topics would, either.\n\nNeeds a sign-off, though.\n"},{"id":"416669","messageId":"xmqqa6sb1ssw.fsf@gitster.c.googlers.com","threadId":"55129","inReplyTo":"20210209214159.22815-2-avarab@gmail.com","subject":"Re: [PATCH 01/12] test-lib: remove check_var_migration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-10T22:06:39Z","receivedAt":"2021-02-10T22:07:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Remove the check_var_migration() migration helper. This was added back\n> in [1], [2] and [3] to warn users to migrate from e.g. the\n> \"GIT_FSMONITOR_TEST\" name to \"GIT_TEST_FSMONITOR\".\n>\n> I daresay that having been warning about this since late 2018 (or\n> v2.20.0) was sufficient time to give everyone interested a heads-up\n> about moving to the new names.\n\nAs this is not end-user facing backward-compatibility issue, I am\nperfectly fine with the abbreviated schedule.\n\nQueued.\n\n"},{"id":"416756","messageId":"20210211192724.GF1015009@szeder.dev","threadId":"55129","inReplyTo":"xmqqpn18yee4.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-02-11T19:27:24Z","receivedAt":"2021-02-11T19:28:26Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Feb 09, 2021 at 04:06:59PM -0800, Junio C Hamano wrote:\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n> \n> > Split out the debug, path and text miscellaneous helpers into their\n> > own files. The \"test -[efsd]\" etc. helpers were not all in one place\n> > in test-lib-functions.sh, I think moving them into their own file\n> > makes it easier to follow the code.\n> \n> I'd prefer not to see this done.  It would be fine to move them in\n> different sections but still in the same file to group related\n> helpers together, but I am having enough trouble when deciding to\n> look into which between test-lib.sh and test-lib-functions.sh in the\n> current organization already.  And it will make the situation even\n> worse if we did this, no?\n\nIndeed, I'd rather not see this one, either.\n\n"},{"id":"416758","messageId":"20210211193820.GH1015009@szeder.dev","threadId":"55129","inReplyTo":"YCRL4lq5eQnPLwK1@coredump.intra.peff.net","subject":"Re: [PATCH 07/12] test-lib-functions: move function to lib-bitmap.sh","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-02-11T19:38:20Z","receivedAt":"2021-02-11T19:39:17Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Wed, Feb 10, 2021 at 04:10:58PM -0500, Jeff King wrote:\n> On Wed, Feb 10, 2021 at 09:56:45PM +0100, SZEDER Gábor wrote:\n> \n> > > +test_bitmap_traversal () {\n> > > +\tif test \"$1\" = \"--no-confirm-bitmaps\"\n> > > +\tthen\n> > > +\t\tshift\n> > > +\telif cmp \"$1\" \"$2\"\n> > > +\tthen\n> > > +\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n> > > +\t\treturn 1\n> > \n> > Since you converted two 'error's to BUG earlier in this series...\n> > \n> > This helper function was added in ea047a8eb4 (t5310: factor out bitmap\n> > traversal comparison, 2020-02-14), and so I Cc: its author and quote\n> > part of its commit message:\n> > \n> >     While we're at it, let's also try to confirm that the bitmap output did\n> >     indeed use bitmaps. Since the code internally falls back to the\n> >     non-bitmap path in some cases, the tests are at risk of becoming trivial\n> >     noops.\n> >     \n> >     This is a bit fragile, as not all outputs will differ (e.g., looking at\n> >     only the commits from a fully-bitmapped pack will end up exactly the\n> >     same as the normal traversal order, since it also matches the pack\n> >     order). So we'll provide an escape hatch by which tests can disable this\n> >     check (which should only be used after manually confirming that bitmaps\n> >     kicked in).\n> > \n> > Shouldn't this be a BUG as well?  I think this should be a BUG.\n> \n> I dunno. I guess you are thinking of the case where somebody adds a new\n> caller but fails to invoke Git correctly. Which would be a bug in the\n> test script.\n> \n> But it could also easily be due to Git changing how it behaves in a\n> certain circumstance. And maybe the solution is changing the test to\n> adapt, or maybe we just found a bug in Git.\n\nWell, I though that if the raw output is the same with and without\npack bitmaps, then the missing '--no-confirm-bitmaps' option is the\nbug in the test script.\n\n> TBH, I do not care that much either way. Either way, I think somebody\n> would notice the problem.\n\nMe neither, I just don't like test helper functions that simply return\nin the middle, becauase that makes suppressing their trace output even\nmore awkward than it already is :)\n\n"},{"id":"416775","messageId":"nycvar.QRO.7.76.6.2102112312400.29765@tvgsbejvaqbjf.bet","threadId":"55129","inReplyTo":"20210209214159.22815-10-avarab@gmail.com","subject":"Re: [PATCH 09/12] test libs: rename \"diff-lib\" to \"lib-diff\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-02-11T22:13:56Z","receivedAt":"2021-02-11T22:15:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Ævar,\n\nOn Tue, 9 Feb 2021, Ævar Arnfjörð Bjarmason wrote:\n\n> diff --git a/t/.gitattributes b/t/.gitattributes\n> index d778bfad052..dafa17c3e61 100644\n> --- a/t/.gitattributes\n> +++ b/t/.gitattributes\n> @@ -1,6 +1,6 @@\n>  t[0-9][0-9][0-9][0-9]/* -whitespace\n>  /chainlint/*.expect eol=lf\n> -/diff-lib/* eol=lf\n> +/lib-diff/* eol=lf\n>  /t0110/url-* binary\n>  /t3206/* eol=lf\n>  /t3900/*.txt eol=lf\n\nLucky coincidence that this is still sorted ;-)\n\nThe patch looks good to me. Thanks!\nDscho\n\n> diff --git a/t/diff-lib.sh b/t/lib-diff.sh\n> similarity index 100%\n> rename from t/diff-lib.sh\n> rename to t/lib-diff.sh\n> diff --git a/t/diff-lib/COPYING b/t/lib-diff/COPYING\n> similarity index 100%\n> rename from t/diff-lib/COPYING\n> rename to t/lib-diff/COPYING\n> diff --git a/t/diff-lib/README b/t/lib-diff/README\n> similarity index 100%\n> rename from t/diff-lib/README\n> rename to t/lib-diff/README\n> diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh\n> index e5116a76a1c..cce334981e1 100755\n> --- a/t/t4000-diff-format.sh\n> +++ b/t/t4000-diff-format.sh\n> @@ -7,7 +7,7 @@ test_description='Test built-in diff output engine.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  echo >path0 'Line 1\n>  Line 2\n> diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\n> index c16486a9d41..2f9700742aa 100755\n> --- a/t/t4001-diff-rename.sh\n> +++ b/t/t4001-diff-rename.sh\n> @@ -7,7 +7,7 @@ test_description='Test rename detection in diff engine.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  test_expect_success 'setup' '\n>  \tcat >path0 <<-\\EOF &&\n> diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\n> index df2accb6555..db07ff3eb19 100755\n> --- a/t/t4003-diff-rename-1.sh\n> +++ b/t/t4003-diff-rename-1.sh\n> @@ -7,11 +7,11 @@ test_description='More rename detection\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  test_expect_success \\\n>      'prepare reference tree' \\\n> -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n>       echo frotz >rezrov &&\n>      git update-index --add COPYING rezrov &&\n>      tree=$(git write-tree) &&\n> @@ -99,7 +99,7 @@ test_expect_success \\\n>\n>  test_expect_success \\\n>      'prepare work tree once again' \\\n> -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n>       git update-index --add --remove COPYING COPYING.1'\n>\n>  # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\n> diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh\n> index 6e562c80d12..3d495e37bb1 100755\n> --- a/t/t4004-diff-rename-symlink.sh\n> +++ b/t/t4004-diff-rename-symlink.sh\n> @@ -10,7 +10,7 @@ copy of symbolic links, but should not produce rename/copy followed\n>  by an edit for them.\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  test_expect_success SYMLINKS \\\n>      'prepare reference tree' \\\n> diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh\n> index d18a80493c2..86479061325 100755\n> --- a/t/t4005-diff-rename-2.sh\n> +++ b/t/t4005-diff-rename-2.sh\n> @@ -6,10 +6,10 @@\n>  test_description='Same rename detection as t4003 but testing diff-raw.'\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  test_expect_success 'setup reference tree' '\n> -\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n>  \techo frotz >rezrov &&\n>  \tgit update-index --add COPYING rezrov &&\n>  \ttree=$(git write-tree) &&\n> @@ -64,7 +64,7 @@ test_expect_success 'validate output from rename/copy detection (#2)' '\n>  # nows how to say Copy.\n>\n>  test_expect_success 'validate output from rename/copy detection (#3)' '\n> -\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n>  \tgit update-index --add --remove COPYING COPYING.1 &&\n>\n>  \tcat <<-EOF >expected &&\n> diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\n> index b187b7f6c66..cbb9c62f535 100755\n> --- a/t/t4007-rename-3.sh\n> +++ b/t/t4007-rename-3.sh\n> @@ -7,17 +7,17 @@ test_description='Rename interaction with pathspec.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  test_expect_success 'prepare reference tree' '\n>  \tmkdir path0 path1 &&\n> -\tcp \"$TEST_DIRECTORY\"/diff-lib/COPYING path0/COPYING &&\n> +\tcp \"$TEST_DIRECTORY\"/lib-diff/COPYING path0/COPYING &&\n>  \tgit update-index --add path0/COPYING &&\n>  \ttree=$(git write-tree) &&\n>  \techo $tree\n>  '\n>\n> -blob=$(git hash-object \"$TEST_DIRECTORY/diff-lib/COPYING\")\n> +blob=$(git hash-object \"$TEST_DIRECTORY/lib-diff/COPYING\")\n>  test_expect_success 'prepare work tree' '\n>  \tcp path0/COPYING path1/COPYING &&\n>  \tgit update-index --add --remove path0/COPYING path1/COPYING\n> diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\n> index b1ccd4102e0..2299f27511b 100755\n> --- a/t/t4008-diff-break-rewrite.sh\n> +++ b/t/t4008-diff-break-rewrite.sh\n> @@ -22,11 +22,11 @@ With -B, this should be detected as two complete rewrites.\n>  Further, with -B and -M together, these should turn into two renames.\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  test_expect_success setup '\n> -\tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n> -\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n> +\tcat \"$TEST_DIRECTORY\"/lib-diff/README >file0 &&\n> +\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >file1 &&\n>  \tblob0_id=$(git hash-object file0) &&\n>  \tblob1_id=$(git hash-object file1) &&\n>  \tgit update-index --add file0 file1 &&\n> diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh\n> index b63bdf031f5..b1da807f169 100755\n> --- a/t/t4009-diff-rename-4.sh\n> +++ b/t/t4009-diff-rename-4.sh\n> @@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  test_expect_success \\\n>      'prepare reference tree' \\\n> -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n>       echo frotz >rezrov &&\n>      git update-index --add COPYING rezrov &&\n>      orig=$(git hash-object COPYING) &&\n> @@ -81,7 +81,7 @@ test_expect_success \\\n>\n>  test_expect_success \\\n>      'prepare work tree once again' \\\n> -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n>       git update-index --add --remove COPYING COPYING.1'\n>\n>  git diff-index -z -C --find-copies-harder $tree >current\n> diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\n> index 65cc703c659..1bbced79ece 100755\n> --- a/t/t4010-diff-pathspec.sh\n> +++ b/t/t4010-diff-pathspec.sh\n> @@ -10,7 +10,7 @@ Prepare:\n>          path1/file1\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  test_expect_success \\\n>      setup \\\n> diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\n> index 717034bb50b..5a25c259fe3 100755\n> --- a/t/t4011-diff-symlink.sh\n> +++ b/t/t4011-diff-symlink.sh\n> @@ -7,7 +7,7 @@ test_description='Test diff of symlinks.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  # Print the short OID of a symlink with the given name.\n>  symlink_oid () {\n> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\n> index ce6aa3914fe..fcc30d8cc26 100755\n> --- a/t/t4013-diff-various.sh\n> +++ b/t/t4013-diff-various.sh\n> @@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  test_expect_success setup '\n>\n> diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\n> index 8c574221b27..2c13b62d3c6 100755\n> --- a/t/t4015-diff-whitespace.sh\n> +++ b/t/t4015-diff-whitespace.sh\n> @@ -7,7 +7,7 @@ test_description='Test special whitespace in diff engine.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  test_expect_success \"Ray Lehtiniemi's example\" '\n>  \tcat <<-\\EOF >x &&\n> diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\n> index 894a11b224d..94ef77e1dfe 100755\n> --- a/t/t4027-diff-submodule.sh\n> +++ b/t/t4027-diff-submodule.sh\n> @@ -3,7 +3,7 @@\n>  test_description='difference in submodules'\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  test_expect_success setup '\n>  \ttest_tick &&\n> diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\n> index 0c8fb39ceda..56f1e62a97b 100755\n> --- a/t/t4034-diff-words.sh\n> +++ b/t/t4034-diff-words.sh\n> @@ -3,7 +3,7 @@\n>  test_description='word diff colors'\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  cat >pre.simple <<-\\EOF\n>  \th(4)\n> diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\n> index 09ad491a593..aeac203c424 100755\n> --- a/t/t4038-diff-combined.sh\n> +++ b/t/t4038-diff-combined.sh\n> @@ -6,7 +6,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  setup_helper () {\n>  \tone=$1 branch=$2 side=$3 &&\n> diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh\n> index bcf7493740a..7750b87ca16 100755\n> --- a/t/t4061-diff-indent.sh\n> +++ b/t/t4061-diff-indent.sh\n> @@ -7,7 +7,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  # Compare two diff outputs. Ignore \"index\" lines, because we don't\n>  # care about SHA-1s or file modes.\n> diff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh\n> index ad29e65fcba..4871a5dc92f 100755\n> --- a/t/t4206-log-follow-harder-copies.sh\n> +++ b/t/t4206-log-follow-harder-copies.sh\n> @@ -7,7 +7,7 @@ test_description='Test --follow should always find copies hard in git log.\n>\n>  '\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh\n>\n>  echo >path0 'Line 1\n>  Line 2\n> diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh\n> index 0f936182e4f..512ae2781fe 100755\n> --- a/t/t7501-commit-basic-functionality.sh\n> +++ b/t/t7501-commit-basic-functionality.sh\n> @@ -11,7 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY/diff-lib.sh\"\n> +. \"$TEST_DIRECTORY/lib-diff.sh\"\n>\n>  author='The Real Author <someguy@his.email.org>'\n>\n> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\n> index 3d17e932a0e..3d77701fd4d 100755\n> --- a/t/t9300-fast-import.sh\n> +++ b/t/t9300-fast-import.sh\n> @@ -8,7 +8,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>\n>  . ./test-lib.sh\n> -. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n> +. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n>\n>  verify_packs () {\n>  \tfor p in .git/objects/pack/*.pack\n> --\n> 2.30.0.284.gd98b1dd5eaa7\n>\n>\n"},{"id":"416776","messageId":"nycvar.QRO.7.76.6.2102112317330.29765@tvgsbejvaqbjf.bet","threadId":"55129","inReplyTo":"xmqqpn18yee4.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-02-11T22:18:40Z","receivedAt":"2021-02-11T22:20:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 9 Feb 2021, Junio C Hamano wrote:\n\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n> > Split out the debug, path and text miscellaneous helpers into their\n> > own files. The \"test -[efsd]\" etc. helpers were not all in one place\n> > in test-lib-functions.sh, I think moving them into their own file\n> > makes it easier to follow the code.\n>\n> I'd prefer not to see this done.  It would be fine to move them in\n> different sections but still in the same file to group related\n> helpers together, but I am having enough trouble when deciding to\n> look into which between test-lib.sh and test-lib-functions.sh in the\n> current organization already.  And it will make the situation even\n> worse if we did this, no?\n\nAs much as I would love to see a better organization, I agree with Junio\nthat this split would make it more tedious to find the correct function.\n\nI had a look over the rest of the series and like what I saw, leaving only\none or two comments.\n\nThanks,\nDscho\n"},{"id":"416780","messageId":"xmqq7dnew7eg.fsf@gitster.c.googlers.com","threadId":"55129","inReplyTo":"nycvar.QRO.7.76.6.2102112312400.29765@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 09/12] test libs: rename \"diff-lib\" to \"lib-diff\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-11T22:45:27Z","receivedAt":"2021-02-11T22:46:18Z","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> Hi Ævar,\n>\n> On Tue, 9 Feb 2021, Ævar Arnfjörð Bjarmason wrote:\n>\n>> diff --git a/t/.gitattributes b/t/.gitattributes\n>> index d778bfad052..dafa17c3e61 100644\n>> --- a/t/.gitattributes\n>> +++ b/t/.gitattributes\n>> @@ -1,6 +1,6 @@\n>>  t[0-9][0-9][0-9][0-9]/* -whitespace\n>>  /chainlint/*.expect eol=lf\n>> -/diff-lib/* eol=lf\n>> +/lib-diff/* eol=lf\n>>  /t0110/url-* binary\n>>  /t3206/* eol=lf\n>>  /t3900/*.txt eol=lf\n>\n> Lucky coincidence that this is still sorted ;-)\n>\n> The patch looks good to me. Thanks!\n> Dscho\n\nYup.  It still needs to be signed off.\n"},{"id":"416786","messageId":"20210212132942.17325-1-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 00/11] test-lib: misc improvements","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:31Z","receivedAt":"2021-02-12T13:30:56Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Fixed a missing SOB and dropped the 12th patch.\n\nÆvar Arnfjörð Bjarmason (11):\n  test-lib: remove check_var_migration\n  test lib: change \"error\" to \"BUG\" as appropriate\n  test-lib-functions: move test_set_index_version() to its user\n  test-lib-functions: remove generate_zero_bytes() wrapper\n  test libs: rename bundle helper to \"lib-bundle.sh\"\n  test libs: rename gitweb-lib.sh to lib-gitweb.sh\n  test-lib-functions: move function to lib-bitmap.sh\n  t/.gitattributes: sort lines\n  test libs: rename \"diff-lib\" to \"lib-diff\"\n  test-lib-functions: remove bug-inducing \"diagnostics\" helper param\n  test-lib-functions: assert correct parameter count\n\n t/.gitattributes                              |  4 +-\n t/README                                      |  8 +--\n t/lib-bitmap.sh                               | 26 ++++++++\n t/{test-bundle-functions.sh => lib-bundle.sh} |  0\n t/{diff-lib.sh => lib-diff.sh}                |  0\n t/{diff-lib => lib-diff}/COPYING              |  0\n t/{diff-lib => lib-diff}/README               |  0\n t/{gitweb-lib.sh => lib-gitweb.sh}            |  0\n t/t2104-update-index-skip-worktree.sh         |  5 ++\n t/t3404-rebase-interactive.sh                 |  3 +-\n t/t4000-diff-format.sh                        |  2 +-\n t/t4001-diff-rename.sh                        |  2 +-\n t/t4003-diff-rename-1.sh                      |  6 +-\n t/t4004-diff-rename-symlink.sh                |  2 +-\n t/t4005-diff-rename-2.sh                      |  6 +-\n t/t4007-rename-3.sh                           |  6 +-\n t/t4008-diff-break-rewrite.sh                 |  6 +-\n t/t4009-diff-rename-4.sh                      |  6 +-\n t/t4010-diff-pathspec.sh                      |  2 +-\n t/t4011-diff-symlink.sh                       |  2 +-\n t/t4013-diff-various.sh                       |  2 +-\n t/t4015-diff-whitespace.sh                    |  2 +-\n t/t4027-diff-submodule.sh                     |  2 +-\n t/t4034-diff-words.sh                         |  2 +-\n t/t4038-diff-combined.sh                      |  2 +-\n t/t4061-diff-indent.sh                        |  2 +-\n t/t4206-log-follow-harder-copies.sh           |  2 +-\n t/t5310-pack-bitmaps.sh                       |  2 +\n t/t5318-commit-graph.sh                       |  2 +-\n t/t5510-fetch.sh                              |  2 +-\n t/t6020-bundle-misc.sh                        |  2 +-\n t/t6113-rev-list-bitmap-filters.sh            |  1 +\n t/t6426-merge-skip-unneeded-updates.sh        | 16 +++--\n t/t6500-gc.sh                                 |  4 +-\n t/t7501-commit-basic-functionality.sh         |  2 +-\n t/t9300-fast-import.sh                        |  2 +-\n t/t9500-gitweb-standalone-no-errors.sh        |  2 +-\n t/t9501-gitweb-standalone-http-status.sh      |  2 +-\n t/t9502-gitweb-standalone-parse-output.sh     |  2 +-\n t/test-lib-functions.sh                       | 62 +++++--------------\n t/test-lib.sh                                 | 30 ---------\n 41 files changed, 107 insertions(+), 124 deletions(-)\n create mode 100644 t/lib-bitmap.sh\n rename t/{test-bundle-functions.sh => lib-bundle.sh} (100%)\n rename t/{diff-lib.sh => lib-diff.sh} (100%)\n rename t/{diff-lib => lib-diff}/COPYING (100%)\n rename t/{diff-lib => lib-diff}/README (100%)\n rename t/{gitweb-lib.sh => lib-gitweb.sh} (100%)\n\nRange-diff:\n 1:  422ffbfd16a =  1:  5243499bf03 test-lib: remove check_var_migration\n 2:  47b4bf0e49d =  2:  aa67ff1e6b9 test lib: change \"error\" to \"BUG\" as appropriate\n 3:  e8cb488e124 =  3:  56cff1fb482 test-lib-functions: move test_set_index_version() to its user\n 4:  d4ef2a8fd5b =  4:  8960a2578da test-lib-functions: remove generate_zero_bytes() wrapper\n 5:  9a164f4d49b =  5:  8bb54931234 test libs: rename bundle helper to \"lib-bundle.sh\"\n 6:  d91be650b42 =  6:  a72b1d02225 test libs: rename gitweb-lib.sh to lib-gitweb.sh\n 7:  0ffc90200f8 =  7:  ab8769ca71f test-lib-functions: move function to lib-bitmap.sh\n 8:  57a258c1414 =  8:  0dfe871261d t/.gitattributes: sort lines\n 9:  843a8718658 !  9:  ffde3c43099 test libs: rename \"diff-lib\" to \"lib-diff\"\n    @@ Commit message\n         commits there is no remaining t/*lib* which doesn't follow the\n         convention of being called t/lib-*.\n     \n    +    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n    +\n      ## t/.gitattributes ##\n     @@\n      t[0-9][0-9][0-9][0-9]/* -whitespace\n10:  65b2a41a784 = 10:  ea732f64704 test-lib-functions: remove bug-inducing \"diagnostics\" helper param\n11:  9424b533f02 = 11:  3932ed40712 test-lib-functions: assert correct parameter count\n12:  c649939196d <  -:  ----------- test-lib-functions: split out {debug,path,text} helpers\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416787","messageId":"20210212132942.17325-3-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 02/11] test lib: change \"error\" to \"BUG\" as appropriate","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:33Z","receivedAt":"2021-02-12T13:30:57Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change two uses of \"error\" in test-lib-functions.sh to \"BUG\".\n\nIn the first instance in \"test_cmp_rev\" the author of the \"BUG\"\nfunction added in [1] had another in-flight patch adding this in [2],\nand the two were never consolidated.\n\nIn the second case in \"test_atexit\" added in [3] that we could have\ninstead used \"BUG\" appears to have been missed.\n\n1. 165293af3ce (tests: send \"bug in the test script\" errors to the\n   script's stderr, 2018-11-19)\n\n2. 30d0b6dccbc (test-lib-functions: make 'test_cmp_rev' more\n   informative on failure, 2018-11-19)\n\n3. 900721e15c4 (test-lib: introduce 'test_atexit', 2019-03-13)\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib-functions.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 07976af81c8..4b7e09db63a 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -1096,7 +1096,7 @@ test_cmp_rev () {\n \tfi\n \tif test $# != 2\n \tthen\n-\t\terror \"bug in the test script: test_cmp_rev requires two revisions, but got $#\"\n+\t\tBUG \"test_cmp_rev requires two revisions, but got $#\"\n \telse\n \t\tlocal r1 r2\n \t\tr1=$(git rev-parse --verify \"$1\") &&\n@@ -1207,7 +1207,7 @@ test_atexit () {\n \t# doing so on Bash is better than nothing (the test will\n \t# silently pass on other shells).\n \ttest \"${BASH_SUBSHELL-0}\" = 0 ||\n-\terror \"bug in test script: test_atexit does nothing in a subshell\"\n+\tBUG \"test_atexit does nothing in a subshell\"\n \ttest_atexit_cleanup=\"{ $*\n \t\t} && (exit \\\"\\$eval_ret\\\"); eval_ret=\\$?; $test_atexit_cleanup\"\n }\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416788","messageId":"20210212132942.17325-2-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 01/11] test-lib: remove check_var_migration","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:32Z","receivedAt":"2021-02-12T13:30:57Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the check_var_migration() migration helper. This was added back\nin [1], [2] and [3] to warn users to migrate from e.g. the\n\"GIT_FSMONITOR_TEST\" name to \"GIT_TEST_FSMONITOR\".\n\nI daresay that having been warning about this since late 2018 (or\nv2.20.0) was sufficient time to give everyone interested a heads-up\nabout moving to the new names.\n\nI don't see the need for going through the \"do this later\" codepath\nanticipated in [1], let's just remove this instead.\n\n1. 4cb54d0aa8e (fsmonitor: update GIT_TEST_FSMONITOR support,\n   2018-09-18)\n2. 1f357b045b5 (read-cache: update TEST_GIT_INDEX_VERSION support,\n   2018-09-18)\n3. 5765d97b71d (preload-index: update GIT_FORCE_PRELOAD_TEST support,\n   2018-09-18)\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib.sh | 30 ------------------------------\n 1 file changed, 30 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 431adba0fb3..987a6c1936d 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -453,36 +453,6 @@ export GIT_DEFAULT_HASH\n GIT_TRACE_BARE=1\n export GIT_TRACE_BARE\n \n-check_var_migration () {\n-\t# the warnings and hints given from this helper depends\n-\t# on end-user settings, which will disrupt the self-test\n-\t# done on the test framework itself.\n-\tcase \"$GIT_TEST_FRAMEWORK_SELFTEST\" in\n-\tt)\treturn ;;\n-\tesac\n-\n-\told_name=$1 new_name=$2\n-\teval \"old_isset=\\${${old_name}:+isset}\"\n-\teval \"new_isset=\\${${new_name}:+isset}\"\n-\n-\tcase \"$old_isset,$new_isset\" in\n-\tisset,)\n-\t\techo >&2 \"warning: $old_name is now $new_name\"\n-\t\techo >&2 \"hint: set $new_name too during the transition period\"\n-\t\teval \"$new_name=\\$$old_name\"\n-\t\t;;\n-\tisset,isset)\n-\t\t# do this later\n-\t\t# echo >&2 \"warning: $old_name is now $new_name\"\n-\t\t# echo >&2 \"hint: remove $old_name\"\n-\t\t;;\n-\tesac\n-}\n-\n-check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR\n-check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION\n-check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX\n-\n # Use specific version of the index file format\n if test -n \"${GIT_TEST_INDEX_VERSION:+isset}\"\n then\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416789","messageId":"20210212132942.17325-4-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 03/11] test-lib-functions: move test_set_index_version() to its user","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:34Z","receivedAt":"2021-02-12T13:31:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move the test_set_index_version() function to its only user. This\nfunction has only been used in one place since its addition in\n5d9fc888b48 (test-lib: allow setting the index format version,\n2014-02-23). Let's have that test script define it.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t2104-update-index-skip-worktree.sh | 5 +++++\n t/test-lib-functions.sh               | 5 -----\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh\nindex 7e2e7dd4ae5..30666fc70d2 100755\n--- a/t/t2104-update-index-skip-worktree.sh\n+++ b/t/t2104-update-index-skip-worktree.sh\n@@ -9,6 +9,11 @@ test_description='skip-worktree bit test'\n \n sane_unset GIT_TEST_SPLIT_INDEX\n \n+test_set_index_version () {\n+    GIT_INDEX_VERSION=\"$1\"\n+    export GIT_INDEX_VERSION\n+}\n+\n test_set_index_version 3\n \n cat >expect.full <<EOF\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 4b7e09db63a..82ad0b91743 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -32,11 +32,6 @@ test_set_editor () {\n \texport EDITOR\n }\n \n-test_set_index_version () {\n-    GIT_INDEX_VERSION=\"$1\"\n-    export GIT_INDEX_VERSION\n-}\n-\n test_decode_color () {\n \tawk '\n \t\tfunction name(n) {\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416790","messageId":"20210212132942.17325-5-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 04/11] test-lib-functions: remove generate_zero_bytes() wrapper","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:35Z","receivedAt":"2021-02-12T13:31:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Since d5cfd142ec1 (tests: teach the test-tool to generate NUL bytes\nand use it, 2019-02-14) the generate_zero_bytes() functions has been a\nthin wrapper for \"test-tool genzeros\". Let's have its only user call\nthat directly instead.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5318-commit-graph.sh | 2 +-\n t/test-lib-functions.sh | 7 -------\n 2 files changed, 1 insertion(+), 8 deletions(-)\n\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 2ed0c1544da..368d1cfb448 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -529,7 +529,7 @@ corrupt_graph_and_verify() {\n \tzero_pos=${4:-${orig_size}} &&\n \tprintf \"$data\" | dd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$pos\" conv=notrunc &&\n \tdd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" if=/dev/null &&\n-\tgenerate_zero_bytes $(($orig_size - $zero_pos)) >>\"$objdir/info/commit-graph\" &&\n+\ttest-tool genzeros $(($orig_size - $zero_pos)) >>\"$objdir/info/commit-graph\" &&\n \tcorrupt_graph_verify \"$grepstr\"\n \n }\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 82ad0b91743..71d4e806f6d 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -111,13 +111,6 @@ remove_cr () {\n \ttr '\\015' Q | sed -e 's/Q$//'\n }\n \n-# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).\n-# If $1 is 'infinity', output forever or until the receiving pipe stops reading,\n-# whichever comes first.\n-generate_zero_bytes () {\n-\ttest-tool genzeros \"$@\"\n-}\n-\n # In some bourne shell implementations, the \"unset\" builtin returns\n # nonzero status when a variable to be unset was not set in the first\n # place.\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416791","messageId":"20210212132942.17325-6-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 05/11] test libs: rename bundle helper to \"lib-bundle.sh\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:36Z","receivedAt":"2021-02-12T13:31:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Rename the recently introduced test-bundle-functions.sh to be\nconsistent with other lib-*.sh files, which is the convention for\nthese sorts of shared test library functions.\n\nThe new test-bundle-functions.sh was introduced in 9901164d81d (test:\nadd helper functions for git-bundle, 2021-01-11). It was the only\ntest-*.sh of this nature.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/{test-bundle-functions.sh => lib-bundle.sh} | 0\n t/t5510-fetch.sh                              | 2 +-\n t/t6020-bundle-misc.sh                        | 2 +-\n 3 files changed, 2 insertions(+), 2 deletions(-)\n rename t/{test-bundle-functions.sh => lib-bundle.sh} (100%)\n\ndiff --git a/t/test-bundle-functions.sh b/t/lib-bundle.sh\nsimilarity index 100%\nrename from t/test-bundle-functions.sh\nrename to t/lib-bundle.sh\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 42f55030047..c1e0eb39231 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/test-bundle-functions.sh\n+. \"$TEST_DIRECTORY\"/lib-bundle.sh\n \n D=$(pwd)\n \ndiff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh\nindex 6249420a806..da5fe1ba6de 100755\n--- a/t/t6020-bundle-misc.sh\n+++ b/t/t6020-bundle-misc.sh\n@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/test-bundle-functions.sh\n+. \"$TEST_DIRECTORY\"/lib-bundle.sh\n \n # Create a commit or tag and set the variable with the object ID.\n test_commit_setvar () {\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416792","messageId":"20210212132942.17325-7-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 06/11] test libs: rename gitweb-lib.sh to lib-gitweb.sh","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:37Z","receivedAt":"2021-02-12T13:32:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Rename gitweb-lib.sh to lib-gitweb.sh for consistency with other test\nlibrary files.\n\nWhen it was introduced in 05526071cb5 (gitweb: split test suite into\nlibrary and tests, 2009-08-27) this naming pattern was more\ncommon.\n\nSince then all but one other such library which didn't start with\n\"lib-*.sh\" such as t6000lib.sh has been been renamed, see\ne.g. 9d488eb40e2 (Move t6000lib.sh to lib-*, 2010-05-07).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/{gitweb-lib.sh => lib-gitweb.sh}        | 0\n t/t9500-gitweb-standalone-no-errors.sh    | 2 +-\n t/t9501-gitweb-standalone-http-status.sh  | 2 +-\n t/t9502-gitweb-standalone-parse-output.sh | 2 +-\n 4 files changed, 3 insertions(+), 3 deletions(-)\n rename t/{gitweb-lib.sh => lib-gitweb.sh} (100%)\n\ndiff --git a/t/gitweb-lib.sh b/t/lib-gitweb.sh\nsimilarity index 100%\nrename from t/gitweb-lib.sh\nrename to t/lib-gitweb.sh\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex ee8c6e30e67..0333065d4d6 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -13,7 +13,7 @@ or warnings to log.'\n GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n-. ./gitweb-lib.sh\n+. ./lib-gitweb.sh\n \n # ----------------------------------------------------------------------\n # no commits (empty, just initialized repository)\ndiff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh\nindex 141610de546..32814e75df5 100755\n--- a/t/t9501-gitweb-standalone-http-status.sh\n+++ b/t/t9501-gitweb-standalone-http-status.sh\n@@ -13,7 +13,7 @@ code and message.'\n GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n-. ./gitweb-lib.sh\n+. ./lib-gitweb.sh\n \n #\n # Gitweb only provides the functionality tested by the 'modification times'\ndiff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh\nindex 9cf7ab30a8d..3167473b303 100755\n--- a/t/t9502-gitweb-standalone-parse-output.sh\n+++ b/t/t9502-gitweb-standalone-parse-output.sh\n@@ -13,7 +13,7 @@ in the HTTP header or the actual script output.'\n GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n-. ./gitweb-lib.sh\n+. ./lib-gitweb.sh\n \n # ----------------------------------------------------------------------\n # snapshot file name and prefix\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416793","messageId":"20210212132942.17325-8-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 07/11] test-lib-functions: move function to lib-bitmap.sh","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:38Z","receivedAt":"2021-02-12T13:32:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move a function added to test-lib-functions.sh in ea047a8eb4f (t5310:\nfactor out bitmap traversal comparison, 2020-02-14) into a new\nlib-bitmap.sh.\n\nThe test-lib-functions.sh file should be for functions that are widely\nused across the test suite, if something's only used by a few tests it\nmakes more sense to have it in a lib-*.sh file.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/lib-bitmap.sh                    | 26 ++++++++++++++++++++++++++\n t/t5310-pack-bitmaps.sh            |  2 ++\n t/t6113-rev-list-bitmap-filters.sh |  1 +\n t/test-lib-functions.sh            | 27 ---------------------------\n 4 files changed, 29 insertions(+), 27 deletions(-)\n create mode 100644 t/lib-bitmap.sh\n\ndiff --git a/t/lib-bitmap.sh b/t/lib-bitmap.sh\nnew file mode 100644\nindex 00000000000..fe3f98be24f\n--- /dev/null\n+++ b/t/lib-bitmap.sh\n@@ -0,0 +1,26 @@\n+# Compare a file containing rev-list bitmap traversal output to its non-bitmap\n+# counterpart. You can't just use test_cmp for this, because the two produce\n+# subtly different output:\n+#\n+#   - regular output is in traversal order, whereas bitmap is split by type,\n+#     with non-packed objects at the end\n+#\n+#   - regular output has a space and the pathname appended to non-commit\n+#     objects; bitmap output omits this\n+#\n+# This function normalizes and compares the two. The second file should\n+# always be the bitmap output.\n+test_bitmap_traversal () {\n+\tif test \"$1\" = \"--no-confirm-bitmaps\"\n+\tthen\n+\t\tshift\n+\telif cmp \"$1\" \"$2\"\n+\tthen\n+\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n+\t\treturn 1\n+\tfi &&\n+\tcut -d' ' -f1 \"$1\" | sort >\"$1.normalized\" &&\n+\tsort \"$2\" >\"$2.normalized\" &&\n+\ttest_cmp \"$1.normalized\" \"$2.normalized\" &&\n+\trm -f \"$1.normalized\" \"$2.normalized\"\n+}\ndiff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\nindex 5ba76031090..40b9f632441 100755\n--- a/t/t5310-pack-bitmaps.sh\n+++ b/t/t5310-pack-bitmaps.sh\n@@ -5,6 +5,8 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-bundle.sh\n+. \"$TEST_DIRECTORY\"/lib-bitmap.sh\n \n objpath () {\n \techo \".git/objects/$(echo \"$1\" | sed -e 's|\\(..\\)|\\1/|')\"\ndiff --git a/t/t6113-rev-list-bitmap-filters.sh b/t/t6113-rev-list-bitmap-filters.sh\nindex 2b551e6fd0c..3f889949ca1 100755\n--- a/t/t6113-rev-list-bitmap-filters.sh\n+++ b/t/t6113-rev-list-bitmap-filters.sh\n@@ -2,6 +2,7 @@\n \n test_description='rev-list combining bitmaps and filters'\n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-bitmap.sh\n \n test_expect_success 'set up bitmapped repo' '\n \t# one commit will have bitmaps, the other will not\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 71d4e806f6d..473d2e283e6 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -1593,33 +1593,6 @@ test_set_port () {\n \teval $var=$port\n }\n \n-# Compare a file containing rev-list bitmap traversal output to its non-bitmap\n-# counterpart. You can't just use test_cmp for this, because the two produce\n-# subtly different output:\n-#\n-#   - regular output is in traversal order, whereas bitmap is split by type,\n-#     with non-packed objects at the end\n-#\n-#   - regular output has a space and the pathname appended to non-commit\n-#     objects; bitmap output omits this\n-#\n-# This function normalizes and compares the two. The second file should\n-# always be the bitmap output.\n-test_bitmap_traversal () {\n-\tif test \"$1\" = \"--no-confirm-bitmaps\"\n-\tthen\n-\t\tshift\n-\telif cmp \"$1\" \"$2\"\n-\tthen\n-\t\techo >&2 \"identical raw outputs; are you sure bitmaps were used?\"\n-\t\treturn 1\n-\tfi &&\n-\tcut -d' ' -f1 \"$1\" | sort >\"$1.normalized\" &&\n-\tsort \"$2\" >\"$2.normalized\" &&\n-\ttest_cmp \"$1.normalized\" \"$2.normalized\" &&\n-\trm -f \"$1.normalized\" \"$2.normalized\"\n-}\n-\n # Tests for the hidden file attribute on Windows\n test_path_is_hidden () {\n \ttest_have_prereq MINGW ||\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416794","messageId":"20210212132942.17325-9-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 08/11] t/.gitattributes: sort lines","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:39Z","receivedAt":"2021-02-12T13:32:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Sort the lines starting with \"/\", the only out-of-place line was added\nalong with most of the file in 614f4f0f350 (Fix the remaining tests\nthat failed with core.autocrlf=true, 2017-05-09).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/.gitattributes | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex df05434d32c..d778bfad052 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -5,9 +5,9 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n /t3206/* eol=lf\n /t3900/*.txt eol=lf\n /t3901/*.txt eol=lf\n-/t4034/*/* eol=lf\n /t4013/* eol=lf\n /t4018/* eol=lf\n+/t4034/*/* eol=lf\n /t4051/* eol=lf\n /t4100/* eol=lf\n /t4101/* eol=lf\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416795","messageId":"20210212132942.17325-10-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 09/11] test libs: rename \"diff-lib\" to \"lib-diff\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:40Z","receivedAt":"2021-02-12T13:32:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Rename the \"diff-lib\" to \"lib-diff\". With this rename and preceding\ncommits there is no remaining t/*lib* which doesn't follow the\nconvention of being called t/lib-*.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/.gitattributes                      | 2 +-\n t/{diff-lib.sh => lib-diff.sh}        | 0\n t/{diff-lib => lib-diff}/COPYING      | 0\n t/{diff-lib => lib-diff}/README       | 0\n t/t4000-diff-format.sh                | 2 +-\n t/t4001-diff-rename.sh                | 2 +-\n t/t4003-diff-rename-1.sh              | 6 +++---\n t/t4004-diff-rename-symlink.sh        | 2 +-\n t/t4005-diff-rename-2.sh              | 6 +++---\n t/t4007-rename-3.sh                   | 6 +++---\n t/t4008-diff-break-rewrite.sh         | 6 +++---\n t/t4009-diff-rename-4.sh              | 6 +++---\n t/t4010-diff-pathspec.sh              | 2 +-\n t/t4011-diff-symlink.sh               | 2 +-\n t/t4013-diff-various.sh               | 2 +-\n t/t4015-diff-whitespace.sh            | 2 +-\n t/t4027-diff-submodule.sh             | 2 +-\n t/t4034-diff-words.sh                 | 2 +-\n t/t4038-diff-combined.sh              | 2 +-\n t/t4061-diff-indent.sh                | 2 +-\n t/t4206-log-follow-harder-copies.sh   | 2 +-\n t/t7501-commit-basic-functionality.sh | 2 +-\n t/t9300-fast-import.sh                | 2 +-\n 23 files changed, 30 insertions(+), 30 deletions(-)\n rename t/{diff-lib.sh => lib-diff.sh} (100%)\n rename t/{diff-lib => lib-diff}/COPYING (100%)\n rename t/{diff-lib => lib-diff}/README (100%)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex d778bfad052..dafa17c3e61 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -1,6 +1,6 @@\n t[0-9][0-9][0-9][0-9]/* -whitespace\n /chainlint/*.expect eol=lf\n-/diff-lib/* eol=lf\n+/lib-diff/* eol=lf\n /t0110/url-* binary\n /t3206/* eol=lf\n /t3900/*.txt eol=lf\ndiff --git a/t/diff-lib.sh b/t/lib-diff.sh\nsimilarity index 100%\nrename from t/diff-lib.sh\nrename to t/lib-diff.sh\ndiff --git a/t/diff-lib/COPYING b/t/lib-diff/COPYING\nsimilarity index 100%\nrename from t/diff-lib/COPYING\nrename to t/lib-diff/COPYING\ndiff --git a/t/diff-lib/README b/t/lib-diff/README\nsimilarity index 100%\nrename from t/diff-lib/README\nrename to t/lib-diff/README\ndiff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh\nindex e5116a76a1c..cce334981e1 100755\n--- a/t/t4000-diff-format.sh\n+++ b/t/t4000-diff-format.sh\n@@ -7,7 +7,7 @@ test_description='Test built-in diff output engine.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n echo >path0 'Line 1\n Line 2\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex c16486a9d41..2f9700742aa 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -7,7 +7,7 @@ test_description='Test rename detection in diff engine.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success 'setup' '\n \tcat >path0 <<-\\EOF &&\ndiff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\nindex df2accb6555..db07ff3eb19 100755\n--- a/t/t4003-diff-rename-1.sh\n+++ b/t/t4003-diff-rename-1.sh\n@@ -7,11 +7,11 @@ test_description='More rename detection\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success \\\n     'prepare reference tree' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      echo frotz >rezrov &&\n     git update-index --add COPYING rezrov &&\n     tree=$(git write-tree) &&\n@@ -99,7 +99,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'prepare work tree once again' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      git update-index --add --remove COPYING COPYING.1'\n \n # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\ndiff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh\nindex 6e562c80d12..3d495e37bb1 100755\n--- a/t/t4004-diff-rename-symlink.sh\n+++ b/t/t4004-diff-rename-symlink.sh\n@@ -10,7 +10,7 @@ copy of symbolic links, but should not produce rename/copy followed\n by an edit for them.\n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success SYMLINKS \\\n     'prepare reference tree' \\\ndiff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh\nindex d18a80493c2..86479061325 100755\n--- a/t/t4005-diff-rename-2.sh\n+++ b/t/t4005-diff-rename-2.sh\n@@ -6,10 +6,10 @@\n test_description='Same rename detection as t4003 but testing diff-raw.'\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success 'setup reference tree' '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n \techo frotz >rezrov &&\n \tgit update-index --add COPYING rezrov &&\n \ttree=$(git write-tree) &&\n@@ -64,7 +64,7 @@ test_expect_success 'validate output from rename/copy detection (#2)' '\n # nows how to say Copy.\n \n test_expect_success 'validate output from rename/copy detection (#3)' '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n \tgit update-index --add --remove COPYING COPYING.1 &&\n \n \tcat <<-EOF >expected &&\ndiff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\nindex b187b7f6c66..cbb9c62f535 100755\n--- a/t/t4007-rename-3.sh\n+++ b/t/t4007-rename-3.sh\n@@ -7,17 +7,17 @@ test_description='Rename interaction with pathspec.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success 'prepare reference tree' '\n \tmkdir path0 path1 &&\n-\tcp \"$TEST_DIRECTORY\"/diff-lib/COPYING path0/COPYING &&\n+\tcp \"$TEST_DIRECTORY\"/lib-diff/COPYING path0/COPYING &&\n \tgit update-index --add path0/COPYING &&\n \ttree=$(git write-tree) &&\n \techo $tree\n '\n \n-blob=$(git hash-object \"$TEST_DIRECTORY/diff-lib/COPYING\")\n+blob=$(git hash-object \"$TEST_DIRECTORY/lib-diff/COPYING\")\n test_expect_success 'prepare work tree' '\n \tcp path0/COPYING path1/COPYING &&\n \tgit update-index --add --remove path0/COPYING path1/COPYING\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex b1ccd4102e0..2299f27511b 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -22,11 +22,11 @@ With -B, this should be detected as two complete rewrites.\n Further, with -B and -M together, these should turn into two renames.\n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success setup '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/README >file0 &&\n+\tcat \"$TEST_DIRECTORY\"/lib-diff/COPYING >file1 &&\n \tblob0_id=$(git hash-object file0) &&\n \tblob1_id=$(git hash-object file1) &&\n \tgit update-index --add file0 file1 &&\ndiff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh\nindex b63bdf031f5..b1da807f169 100755\n--- a/t/t4009-diff-rename-4.sh\n+++ b/t/t4009-diff-rename-4.sh\n@@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success \\\n     'prepare reference tree' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      echo frotz >rezrov &&\n     git update-index --add COPYING rezrov &&\n     orig=$(git hash-object COPYING) &&\n@@ -81,7 +81,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'prepare work tree once again' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'cat \"$TEST_DIRECTORY\"/lib-diff/COPYING >COPYING &&\n      git update-index --add --remove COPYING COPYING.1'\n \n git diff-index -z -C --find-copies-harder $tree >current\ndiff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\nindex 65cc703c659..1bbced79ece 100755\n--- a/t/t4010-diff-pathspec.sh\n+++ b/t/t4010-diff-pathspec.sh\n@@ -10,7 +10,7 @@ Prepare:\n         path1/file1\n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n test_expect_success \\\n     setup \\\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 717034bb50b..5a25c259fe3 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -7,7 +7,7 @@ test_description='Test diff of symlinks.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n # Print the short OID of a symlink with the given name.\n symlink_oid () {\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex ce6aa3914fe..fcc30d8cc26 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success setup '\n \ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 8c574221b27..2c13b62d3c6 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -7,7 +7,7 @@ test_description='Test special whitespace in diff engine.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success \"Ray Lehtiniemi's example\" '\n \tcat <<-\\EOF >x &&\ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex 894a11b224d..94ef77e1dfe 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -3,7 +3,7 @@\n test_description='difference in submodules'\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n test_expect_success setup '\n \ttest_tick &&\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex 0c8fb39ceda..56f1e62a97b 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -3,7 +3,7 @@\n test_description='word diff colors'\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n cat >pre.simple <<-\\EOF\n \th(4)\ndiff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\nindex 09ad491a593..aeac203c424 100755\n--- a/t/t4038-diff-combined.sh\n+++ b/t/t4038-diff-combined.sh\n@@ -6,7 +6,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n setup_helper () {\n \tone=$1 branch=$2 side=$3 &&\ndiff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh\nindex bcf7493740a..7750b87ca16 100755\n--- a/t/t4061-diff-indent.sh\n+++ b/t/t4061-diff-indent.sh\n@@ -7,7 +7,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n # Compare two diff outputs. Ignore \"index\" lines, because we don't\n # care about SHA-1s or file modes.\ndiff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh\nindex ad29e65fcba..4871a5dc92f 100755\n--- a/t/t4206-log-follow-harder-copies.sh\n+++ b/t/t4206-log-follow-harder-copies.sh\n@@ -7,7 +7,7 @@ test_description='Test --follow should always find copies hard in git log.\n \n '\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-diff.sh\n \n echo >path0 'Line 1\n Line 2\ndiff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh\nindex 0f936182e4f..512ae2781fe 100755\n--- a/t/t7501-commit-basic-functionality.sh\n+++ b/t/t7501-commit-basic-functionality.sh\n@@ -11,7 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY/diff-lib.sh\"\n+. \"$TEST_DIRECTORY/lib-diff.sh\"\n \n author='The Real Author <someguy@his.email.org>'\n \ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 3d17e932a0e..3d77701fd4d 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -8,7 +8,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n+. \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n verify_packs () {\n \tfor p in .git/objects/pack/*.pack\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416797","messageId":"20210212132942.17325-11-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 10/11] test-lib-functions: remove bug-inducing \"diagnostics\" helper param","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:41Z","receivedAt":"2021-02-12T13:32:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the optional \"diagnostics\" parameter of the\ntest_path_is_{file,dir,missing} functions.\n\nWe have a lot of uses of these functions, but the only legitimate use\nof the diagnostics parameter is from when the functions themselves\nwere introduced in 2caf20c52b7 (test-lib: user-friendly alternatives\nto test [-d|-f|-e], 2010-08-10).\n\nBut as the the rest of this diff demonstrates its presence did more to\nsilently introduce bugs in our tests. Fix such bugs in the tests added\nin ae4e89e549b (gc: add --keep-largest-pack option, 2018-04-15), and\nc04ba51739a (t6046: testcases checking whether updates can be skipped\nin a merge, 2018-04-19).\n\nLet's also assert that those functions are called with exactly one\nparameter, a follow-up commit will add similar asserts to other\nfunctions in test-lib-functions.sh that we didn't have existing misuse\nof.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/README                               |  8 ++++----\n t/t3404-rebase-interactive.sh          |  3 ++-\n t/t6426-merge-skip-unneeded-updates.sh | 16 ++++++++++++----\n t/t6500-gc.sh                          |  4 ++--\n t/test-lib-functions.sh                | 11 ++++++-----\n 5 files changed, 26 insertions(+), 16 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 1d80fb70041..98d4164a4e6 100644\n--- a/t/README\n+++ b/t/README\n@@ -911,13 +911,13 @@ library for your script to use.\n \n    Check whether a file has the length it is expected to.\n \n- - test_path_is_file <path> [<diagnosis>]\n-   test_path_is_dir <path> [<diagnosis>]\n-   test_path_is_missing <path> [<diagnosis>]\n+ - test_path_is_file <path>\n+   test_path_is_dir <path>\n+   test_path_is_missing <path>\n \n    Check if the named path is a file, if the named path is a\n    directory, or if the named path does not exist, respectively,\n-   and fail otherwise, showing the <diagnosis> text.\n+   and fail otherwise.\n \n  - test_when_finished <script>\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 1e738df81d5..28c2d15d807 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -101,7 +101,8 @@ test_expect_success 'rebase -i with the exec command' '\n \t) &&\n \ttest_path_is_file touch-one &&\n \ttest_path_is_file touch-two &&\n-\ttest_path_is_missing touch-three \" (should have stopped before)\" &&\n+\t# Missing because we should have stopped by now.\n+\ttest_path_is_missing touch-three &&\n \ttest_cmp_rev C HEAD &&\n \tgit rebase --continue &&\n \ttest_path_is_file touch-three &&\ndiff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh\nindex d7eeee43106..7b5f1c1dcd1 100755\n--- a/t/t6426-merge-skip-unneeded-updates.sh\n+++ b/t/t6426-merge-skip-unneeded-updates.sh\n@@ -492,7 +492,9 @@ test_expect_success '3a-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \n@@ -522,7 +524,9 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \n@@ -588,7 +592,9 @@ test_expect_success '3b-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \n@@ -618,7 +624,9 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '\n \t\ttest_cmp expect actual &&\n \n \t\ttest_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&\n-\t\ttest_path_is_missing bq foo/bq foo/whatever\n+\t\ttest_path_is_missing bq &&\n+\t\ttest_path_is_missing foo/bq &&\n+\t\ttest_path_is_missing foo/whatever\n \t)\n '\n \ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 4a3b8f48ac6..7879a6b8c51 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -78,7 +78,7 @@ test_expect_success 'gc --keep-largest-pack' '\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\tcp pack-list base-pack-list &&\n \t\ttest_commit four &&\n \t\tgit repack -d &&\n \t\ttest_commit five &&\n@@ -90,7 +90,7 @@ test_expect_success 'gc --keep-largest-pack' '\n \t\ttest_line_count = 2 pack-list &&\n \t\tawk \"/^P /{print \\$2}\" <.git/objects/info/packs >pack-info &&\n \t\ttest_line_count = 2 pack-info &&\n-\t\ttest_path_is_file $BASE_PACK &&\n+\t\ttest_path_is_file .git/objects/pack/$(cat base-pack-list) &&\n \t\tgit fsck\n \t)\n '\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 473d2e283e6..a5f63c0af6b 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -717,12 +717,12 @@ test_external_without_stderr () {\n }\n \n # debugging-friendly alternatives to \"test [-f|-d|-e]\"\n-# The commands test the existence or non-existence of $1. $2 can be\n-# given to provide a more precise diagnosis.\n+# The commands test the existence or non-existence of $1\n test_path_is_file () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif ! test -f \"$1\"\n \tthen\n-\t\techo \"File $1 doesn't exist. $2\"\n+\t\techo \"File $1 doesn't exist\"\n \t\tfalse\n \tfi\n }\n@@ -730,15 +730,16 @@ test_path_is_file () {\n test_path_is_dir () {\n \tif ! test -d \"$1\"\n \tthen\n-\t\techo \"Directory $1 doesn't exist. $2\"\n+\t\techo \"Directory $1 doesn't exist\"\n \t\tfalse\n \tfi\n }\n \n test_path_exists () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif ! test -e \"$1\"\n \tthen\n-\t\techo \"Path $1 doesn't exist. $2\"\n+\t\techo \"Path $1 doesn't exist\"\n \t\tfalse\n \tfi\n }\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416796","messageId":"20210212132942.17325-12-avarab@gmail.com","threadId":"55129","inReplyTo":"20210209214159.22815-1-avarab@gmail.com","subject":"[PATCH v2 11/11] test-lib-functions: assert correct parameter count","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-12T13:29:42Z","receivedAt":"2021-02-12T13:32:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add assertions of the correct parameter count of various functions, in\nparticularly the wrappers for the shell \"test\" built-in.\n\nIn an earlier commit we fixed a bug with an incorrect number of\narguments being passed to \"test_path_is_{file,missing}\". Let's also\nguard other similar functions from the same sort of misuse.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib-functions.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex a5f63c0af6b..a52eb16846c 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -728,6 +728,7 @@ test_path_is_file () {\n }\n \n test_path_is_dir () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif ! test -d \"$1\"\n \tthen\n \t\techo \"Directory $1 doesn't exist\"\n@@ -746,6 +747,7 @@ test_path_exists () {\n \n # Check if the directory exists and is empty as expected, barf otherwise.\n test_dir_is_empty () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest_path_is_dir \"$1\" &&\n \tif test -n \"$(ls -a1 \"$1\" | egrep -v '^\\.\\.?$')\"\n \tthen\n@@ -757,6 +759,7 @@ test_dir_is_empty () {\n \n # Check if the file exists and has a size greater than zero\n test_file_not_empty () {\n+\ttest \"$#\" = 2 && BUG \"2 param\"\n \tif ! test -s \"$1\"\n \tthen\n \t\techo \"'$1' is not a non-empty file.\"\n@@ -765,6 +768,7 @@ test_file_not_empty () {\n }\n \n test_path_is_missing () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \tif test -e \"$1\"\n \tthen\n \t\techo \"Path exists:\"\n@@ -801,6 +805,7 @@ test_line_count () {\n }\n \n test_file_size () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest-tool path-utils file-size \"$1\"\n }\n \n@@ -973,6 +978,7 @@ test_expect_code () {\n # - not all diff versions understand \"-u\"\n \n test_cmp () {\n+\ttest \"$#\" -ne 2 && BUG \"2 param\"\n \teval \"$GIT_TEST_CMP\" '\"$@\"'\n }\n \n@@ -1002,6 +1008,7 @@ test_cmp_config () {\n # test_cmp_bin - helper to compare binary files\n \n test_cmp_bin () {\n+\ttest \"$#\" -ne 2 && BUG \"2 param\"\n \tcmp \"$@\"\n }\n \n@@ -1062,6 +1069,7 @@ verbose () {\n # otherwise.\n \n test_must_be_empty () {\n+\ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest_path_is_file \"$1\" &&\n \tif test -s \"$1\"\n \tthen\n-- \n2.30.0.284.gd98b1dd5eaa7\n\n"},{"id":"416806","messageId":"xmqqim6wvrr5.fsf@gitster.c.googlers.com","threadId":"55129","inReplyTo":"20210212132942.17325-1-avarab@gmail.com","subject":"Re: [PATCH v2 00/11] test-lib: misc improvements","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-12T22:35:42Z","receivedAt":"2021-02-12T22:38:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Fixed a missing SOB and dropped the 12th patch.\n>\n> Ævar Arnfjörð Bjarmason (11):\n>   test-lib: remove check_var_migration\n>   test lib: change \"error\" to \"BUG\" as appropriate\n>   test-lib-functions: move test_set_index_version() to its user\n>   test-lib-functions: remove generate_zero_bytes() wrapper\n>   test libs: rename bundle helper to \"lib-bundle.sh\"\n>   test libs: rename gitweb-lib.sh to lib-gitweb.sh\n>   test-lib-functions: move function to lib-bitmap.sh\n>   t/.gitattributes: sort lines\n>   test libs: rename \"diff-lib\" to \"lib-diff\"\n>   test-lib-functions: remove bug-inducing \"diagnostics\" helper param\n>   test-lib-functions: assert correct parameter count\n\nWill replace and queue.  Let's declare a victory and move on.\n"},{"id":"416840","messageId":"87zh08av7a.fsf@evledraar.gmail.com","threadId":"55129","inReplyTo":"nycvar.QRO.7.76.6.2102112317330.29765@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-02-13T14:39:05Z","receivedAt":"2021-02-13T14:39:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Feb 11 2021, Johannes Schindelin wrote:\n\n> Hi,\n>\n> On Tue, 9 Feb 2021, Junio C Hamano wrote:\n>\n>> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>>\n>> > Split out the debug, path and text miscellaneous helpers into their\n>> > own files. The \"test -[efsd]\" etc. helpers were not all in one place\n>> > in test-lib-functions.sh, I think moving them into their own file\n>> > makes it easier to follow the code.\n>>\n>> I'd prefer not to see this done.  It would be fine to move them in\n>> different sections but still in the same file to group related\n>> helpers together, but I am having enough trouble when deciding to\n>> look into which between test-lib.sh and test-lib-functions.sh in the\n>> current organization already.  And it will make the situation even\n>> worse if we did this, no?\n>\n> As much as I would love to see a better organization, I agree with Junio\n> that this split would make it more tedious to find the correct function.\n>\n> I had a look over the rest of the series and like what I saw, leaving only\n> one or two comments.\n\nJunio / SZEDER / Johannes: Yeah I agree that that 12/12 sucked in its\ncurrent form.\n\nHaving eyeballed test-lib.sh and test-lib-functions.sh as part of this\nthough there seems to be a pretty obvious way to split this up which I\nthink would increase the readability:\n\n * test-lib.sh: main entry, reading/setting global vars/state,\n   command-line parsing (and other CLI / Makefile interface), loading\n   test-lib-functions.sh, set global prereqs, actual setup for the test\n   about to be run.\n\n * test-lib-functions.sh: the top-level \"library\" used everywhere,\n   i.e. test_expect_success/test_expect_failure etc, Hopefully we could\n   move the internal functions like test_ok_, test_failure_ etc. from\n   test-lib.sh to test-lib-functions.sh (they need some global variables\n   in test-lib.sh now).\n\n   Also things part of core test \"flow\" like test_config,\n   test_when_finished, nongit etc.\n\n * lib-common.sh: what I was trying to start with in this 12/12,\n   i.e. utility functions common enough that we want them\n   \"everywhere\". We'd just have test-lib-functions.sh load this.\n\nThat seems like a much more obvious split & organization to me than the\nmis-match with a bit of everything everyhere we have right now.\n"}]}