{"thread":{"id":"48477","subject":"[PATCH v2 01/28] t/test-lib: add an SHA1 prerequisite","startedAt":"2018-05-13T02:25:03Z","lastAt":"2018-05-13T17:46:14Z","messageCount":31,"participants":["brian m. carlson","Johannes Sixt"],"isPatch":true,"patchVersion":2,"patchTotal":28},"messages":[{"id":"347483","messageId":"20180513022438.60003-2-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 01/28] t/test-lib: add an SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:11Z","receivedAt":"2018-05-13T02:25:03Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"There are some basic tests in our codebase that test that we get fixed\nSHA-1 values.  These are valuable because they make sure that our SHA-1\nimplementation is free of bugs, but obviously these tests will fail with\na different hash.\n\nThere are also tests which intentionally produce objects that have\ncollisions when truncated to a certain length to test our handling of\nthese cases.  These tests, too, will fail with a different hash.\n\nAdd an SHA1 prerequisite to annotate both of these types of tests and\ndisable them when we're using a different hash.  In the future, we will\ncreate versions of these tests which handle both SHA-1 and NewHash.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/test-lib.sh | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex ea2bbaaa7a..fce728d2ea 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1212,3 +1212,10 @@ test_lazy_prereq TIME_T_IS_64BIT 'test-tool date time_t-is64bit'\n test_lazy_prereq CURL '\n \tcurl --version\n '\n+\n+# SHA1 is a test if the hash algorithm in use is SHA-1.  This is both for tests\n+# which will not work with other hash algorithms and tests that work but don't\n+# test anything meaningful (e.g. special values which cause short collisions).\n+test_lazy_prereq SHA1 '\n+\ttest $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n+'\n"},{"id":"347484","messageId":"20180513022438.60003-1-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":null,"subject":"[PATCH v2 00/28] Hash-independent tests (part 2)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:10Z","receivedAt":"2018-05-13T02:25:04Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This is part 2 in the series to make tests hash independent.\n\nThis series introduces an SHA1 prerequisite which checks if the hash in\nuse is SHA-1, and can be used to skip the test if it is not.\nAdditionally, because NewHash will be 256-bit, I introduced aliases for\nthe test constants $_x40 and $_z40 which will be less confusing when the\nhash isn't 40 hex characters long.  I opted to leave the old names in\nplace for the moment to prevent any potential conflicts with other\nseries and will clean up any stragglers later.\n\nTo address any concerns that might be present, I do plan to retrofit\ntests marked with the SHA1 prerequisite and ensure that they are passing\nor are not applicable (e.g. for pack formats supporting only SHA-1).  I\nagree with concerns that shipping a NewHash-capable Git without a\ncomplete, functional testsuite would be a bad idea.\n\nChanges from v1:\n* Amend commit message to indicate that we *will* be updating tests\n  annotated with the SHA1 prerequisite to work with NewHash.\n* Rename FULL_HEX to OID_REGEX.\n* Regenerate patch for OID_REGEX.\n* Update variable name from \"link_oid\" to \"slink_id\" for consistency\n  while still preserving alignment.\n* Restore blank line between tests.\n\ntbdiff output below.\n\nbrian m. carlson (28):\n  t/test-lib: add an SHA1 prerequisite\n  t/test-lib: introduce ZERO_OID\n  t: switch $_z40 to $ZERO_OID\n  t/test-lib: introduce OID_REGEX\n  t: switch $_x40 to $OID_REGEX\n  t0000: annotate with SHA1 prerequisite\n  t1007: annotate with SHA1 prerequisite\n  t1512: skip test if not using SHA-1\n  t4044: skip test if not using SHA-1\n  t: skip pack tests if not using SHA-1\n  t2203: abstract away SHA-1-specific constants\n  t3103: abstract away SHA-1-specific constants\n  t3702: abstract away SHA-1-specific constants\n  t3905: abstract away SHA-1-specific constants\n  t4007: abstract away SHA-1-specific constants\n  t4008: abstract away SHA-1-specific constants\n  t4014: abstract away SHA-1-specific constants\n  t4020: abstract away SHA-1-specific constants\n  t4022: abstract away SHA-1-specific constants\n  t4029: fix test indentation\n  t4029: abstract away SHA-1-specific constants\n  t4030: abstract away SHA-1-specific constants\n  t/lib-diff-alternative: abstract away SHA-1-specific constants\n  t4205: sort log output in a hash-independent way\n  t4042: abstract away SHA-1-specific constants\n  t4045: abstract away SHA-1-specific constants\n  t4208: abstract away SHA-1-specific constants\n  t5300: abstract away SHA-1-specific constants\n\n t/diff-lib.sh                       |  4 +-\n t/lib-diff-alternative.sh           | 12 ++++--\n t/t0000-basic.sh                    | 24 ++++++------\n t/t0090-cache-tree.sh               |  2 +-\n t/t1000-read-tree-m-3way.sh         |  2 +-\n t/t1001-read-tree-m-2way.sh         |  2 +-\n t/t1002-read-tree-m-u-2way.sh       |  2 +-\n t/t1006-cat-file.sh                 |  8 ++--\n t/t1007-hash-object.sh              | 16 ++++----\n t/t1012-read-tree-df.sh             |  2 +-\n t/t1400-update-ref.sh               |  2 +-\n t/t1407-worktree-ref-store.sh       |  8 ++--\n t/t1450-fsck.sh                     |  4 +-\n t/t1501-work-tree.sh                |  6 +--\n t/t1512-rev-parse-disambiguation.sh |  6 +++\n t/t1601-index-bogus.sh              |  2 +-\n t/t1700-split-index.sh              |  2 +-\n t/t2011-checkout-invalid-head.sh    |  2 +-\n t/t2025-worktree-add.sh             |  8 ++--\n t/t2027-worktree-list.sh            |  2 +-\n t/t2107-update-index-basic.sh       |  4 +-\n t/t2201-add-update-typechange.sh    | 16 ++++----\n t/t2203-add-intent.sh               | 14 +++----\n t/t3100-ls-tree-restrict.sh         |  2 +-\n t/t3101-ls-tree-dirname.sh          |  2 +-\n t/t3103-ls-tree-misc.sh             |  3 +-\n t/t3200-branch.sh                   |  4 +-\n t/t3510-cherry-pick-sequence.sh     |  8 ++--\n t/t3702-add-edit.sh                 |  7 ++--\n t/t3905-stash-include-untracked.sh  | 11 ++++--\n t/t4002-diff-basic.sh               |  2 +-\n t/t4006-diff-mode.sh                |  2 +-\n t/t4007-rename-3.sh                 | 17 +++++----\n t/t4008-diff-break-rewrite.sh       | 59 ++++++++++++++++-------------\n t/t4014-format-patch.sh             | 11 +++---\n t/t4020-diff-external.sh            | 18 +++++----\n t/t4022-diff-rewrite.sh             |  5 ++-\n t/t4027-diff-submodule.sh           |  6 +--\n t/t4029-diff-trailing-space.sh      | 38 ++++++++++---------\n t/t4030-diff-textconv.sh            |  5 ++-\n t/t4042-diff-textconv-caching.sh    | 16 +++++---\n t/t4044-diff-index-unique-abbrev.sh |  6 +++\n t/t4045-diff-relative.sh            |  6 ++-\n t/t4046-diff-unmerged.sh            | 14 +++----\n t/t4054-diff-bogus-tree.sh          | 12 +++---\n t/t4058-diff-duplicates.sh          | 12 +++---\n t/t4150-am.sh                       |  4 +-\n t/t4200-rerere.sh                   |  2 +-\n t/t4201-shortlog.sh                 |  2 +-\n t/t4205-log-pretty-formats.sh       |  8 ++--\n t/t4208-log-magic-pathspec.sh       |  3 +-\n t/t5150-request-pull.sh             |  2 +-\n t/t5300-pack-object.sh              |  8 ++--\n t/t5308-pack-detect-duplicates.sh   |  6 +++\n t/t5309-pack-delta-cycles.sh        |  6 +++\n t/t5516-fetch-push.sh               | 22 +++++------\n t/t5527-fetch-odd-refs.sh           |  2 +-\n t/t5571-pre-push-hook.sh            |  8 ++--\n t/t6006-rev-list-format.sh          |  4 +-\n t/t6012-rev-list-simplify.sh        |  2 +-\n t/t6111-rev-list-treesame.sh        |  2 +-\n t/t6120-describe.sh                 |  2 +-\n t/t6300-for-each-ref.sh             |  2 +-\n t/t6301-for-each-ref-errors.sh      |  2 +-\n t/t7009-filter-branch-null-sha1.sh  |  2 +-\n t/t7011-skip-worktree-reading.sh    |  2 +-\n t/t7064-wtstatus-pv2.sh             | 58 ++++++++++++++--------------\n t/t7506-status-submodule.sh         |  2 +-\n t/t9010-svn-fe.sh                   | 14 +++----\n t/t9300-fast-import.sh              |  6 +--\n t/test-lib.sh                       | 11 +++++-\n 71 files changed, 331 insertions(+), 267 deletions(-)\n\ntbdiff output:\n\n 1: 03ad090b53 !  1: 1a2e23b4f8 t/test-lib: add an SHA1 prerequisite\n    @@ -12,7 +12,7 @@\n         these cases.  These tests, too, will fail with a different hash.\n         \n         Add an SHA1 prerequisite to annotate both of these types of tests and\n    -    disable them when we're using a different hash.  In the future, we can\n    +    disable them when we're using a different hash.  In the future, we will\n         create versions of these tests which handle both SHA-1 and NewHash.\n         \n         Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n 2: 6b39476f58 =  2: 809ac7d7c3 t/test-lib: introduce ZERO_OID\n 3: 45ac938b66 =  3: 1394616579 t: switch $_z40 to $ZERO_OID\n 4: a8677dbf35 !  4: adbbf8af80 t/test-lib: introduce OID_REGEX\n    @@ -1,13 +1,13 @@\n     Author: brian m. carlson <sandals@crustytoothpaste.net>\n     \n    -    t/test-lib: introduce FULL_HEX\n    +    t/test-lib: introduce OID_REGEX\n         \n         Currently we have a variable, $_x40, which contains a regex that matches\n         a full 40-character hex constant.  However, with NewHash, we'll have\n         object IDs that are longer than 40 characters.  In such a case, $_x40\n    -    will be a confusing name.  Create a $FULL_HEX variable which will always\n    -    reflect a regex matching the appropriate object ID, regardless of the\n    -    length of the current hash.\n    +    will be a confusing name.  Create a $OID_REGEX variable which will\n    +    always reflect a regex matching the appropriate object ID, regardless of\n    +    the length of the current hash.\n         \n         Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n     \n    @@ -18,7 +18,7 @@\n      # Zero SHA-1\n      _z40=0000000000000000000000000000000000000000\n      \n    -+FULL_HEX=\"$_x40\"\n    ++OID_REGEX=\"$_x40\"\n      ZERO_OID=$_z40\n      EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n      EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n    @@ -27,7 +27,7 @@\n      u200c=$(printf '\\342\\200\\214')\n      \n     -export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID\n    -+export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID FULL_HEX\n    ++export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX\n      \n      # Each test should start with something like this, after copyright notices:\n      #\n 5: e9e9c1fa49 !  5: 77877cd04e t: switch $_x40 to $OID_REGEX\n    @@ -1,12 +1,12 @@\n     Author: brian m. carlson <sandals@crustytoothpaste.net>\n     \n    -    t: switch $_x40 to $FULL_HEX\n    +    t: switch $_x40 to $OID_REGEX\n         \n    -    Switch all uses of $_x40 to $FULL_HEX so that they work correctly with\n    +    Switch all uses of $_x40 to $OID_REGEX so that they work correctly with\n         larger hashes.  This commit was created by using the following sed\n         command to modify all files in the t directory except t/test-lib.sh:\n         \n    -      sed -i 's/\\$_x40/$FULL_HEX/g'\n    +      sed -i 's/\\$_x40/$OID_REGEX/g'\n         \n         Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n     \n    @@ -17,7 +17,7 @@\n      :\n      \n     -sanitize_diff_raw='/^:/s/ '\"\\($_x40\\)\"' '\"\\($_x40\\)\"' \\([A-Z]\\)[0-9]*\t/ \\1 \\2 \\3#\t/'\n    -+sanitize_diff_raw='/^:/s/ '\"\\($FULL_HEX\\)\"' '\"\\($FULL_HEX\\)\"' \\([A-Z]\\)[0-9]*\t/ \\1 \\2 \\3#\t/'\n    ++sanitize_diff_raw='/^:/s/ '\"\\($OID_REGEX\\)\"' '\"\\($OID_REGEX\\)\"' \\([A-Z]\\)[0-9]*\t/ \\1 \\2 \\3#\t/'\n      compare_diff_raw () {\n          # When heuristics are improved, the score numbers would change.\n          # Ignore them while comparing.\n    @@ -26,7 +26,7 @@\n      }\n      \n     -sanitize_diff_raw_z='/^:/s/ '\"$_x40\"' '\"$_x40\"' \\([A-Z]\\)[0-9]*$/ X X \\1#/'\n    -+sanitize_diff_raw_z='/^:/s/ '\"$FULL_HEX\"' '\"$FULL_HEX\"' \\([A-Z]\\)[0-9]*$/ X X \\1#/'\n    ++sanitize_diff_raw_z='/^:/s/ '\"$OID_REGEX\"' '\"$OID_REGEX\"' \\([A-Z]\\)[0-9]*$/ X X \\1#/'\n      compare_diff_raw_z () {\n          # When heuristics are improved, the score numbers would change.\n          # Ignore them while comparing.\n    @@ -39,7 +39,7 @@\n      cmp_cache_tree () {\n      \ttest-tool dump-cache-tree | sed -e '/#(ref)/d' >actual &&\n     -\tsed \"s/$_x40/SHA/\" <actual >filtered &&\n    -+\tsed \"s/$FULL_HEX/SHA/\" <actual >filtered &&\n    ++\tsed \"s/$OID_REGEX/SHA/\" <actual >filtered &&\n      \ttest_cmp \"$1\" filtered\n      }\n      \n    @@ -52,7 +52,7 @@\n      \n      check_result () {\n     -\tgit ls-files --stage | sed -e 's/ '\"$_x40\"' / X /' >current &&\n    -+\tgit ls-files --stage | sed -e 's/ '\"$FULL_HEX\"' / X /' >current &&\n    ++\tgit ls-files --stage | sed -e 's/ '\"$OID_REGEX\"' / X /' >current &&\n      \ttest_cmp expected current\n      }\n      \n    @@ -65,7 +65,7 @@\n      \tsed -n >current \\\n      \t    -e '/^--- /d; /^+++ /d; /^@@ /d;' \\\n     -\t    -e 's/^\\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$_x40\"' /\\1 X /p' \\\n    -+\t    -e 's/^\\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$FULL_HEX\"' /\\1 X /p' \\\n    ++\t    -e 's/^\\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$OID_REGEX\"' /\\1 X /p' \\\n      \t    \"$1\"\n      \ttest_cmp expected current\n      }\n    @@ -78,7 +78,7 @@\n      \t    -e '2{/^index /d;}' \\\n      \t    -e '/^--- /d; /^+++ /d; /^@@ /d;' \\\n     -\t    -e 's/^\\(.[0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$_x40\"' /\\1 X /' \"$1\"\n    -+\t    -e 's/^\\(.[0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$FULL_HEX\"' /\\1 X /' \"$1\"\n    ++\t    -e 's/^\\(.[0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$OID_REGEX\"' /\\1 X /' \"$1\"\n      \ttest_cmp expected current\n      }\n      \n    @@ -91,7 +91,7 @@\n      checkindex () {\n      \tgit ls-files -s |\n     -\tsed \"s|^[0-7][0-7]* $_x40 \\([0-3]\\)\t|\\1 |\" >current &&\n    -+\tsed \"s|^[0-7][0-7]* $FULL_HEX \\([0-3]\\)\t|\\1 |\" >current &&\n    ++\tsed \"s|^[0-7][0-7]* $OID_REGEX \\([0-3]\\)\t|\\1 |\" >current &&\n      \tcat >expect &&\n      \ttest_cmp expect current\n      }\n    @@ -104,7 +104,7 @@\n      \n      test_output () {\n     -    sed -e \"s/ $_x40\t/ X\t/\" <current >check\n    -+    sed -e \"s/ $FULL_HEX\t/ X\t/\" <current >check\n    ++    sed -e \"s/ $OID_REGEX\t/ X\t/\" <current >check\n          test_cmp expected check\n      }\n      \n    @@ -117,7 +117,7 @@\n      \n      test_output () {\n     -\tsed -e \"s/ $_x40\t/ X\t/\" <current >check &&\n    -+\tsed -e \"s/ $FULL_HEX\t/ X\t/\" <current >check &&\n    ++\tsed -e \"s/ $OID_REGEX\t/ X\t/\" <current >check &&\n      \ttest_cmp expected check\n      }\n      \n    @@ -130,16 +130,16 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    - \t} >actual &&\n    - \ttest_cmp expect actual\n    - '\n    -@@\n    - \t{\n    - \t\tgit rev-list HEAD |\n    - \t\tgit diff-tree --root --stdin |\n    --\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n    + \t} >actual &&\n    + \ttest_cmp expect actual\n    + '\n    +@@\n    + \t{\n    + \t\tgit rev-list HEAD |\n    + \t\tgit diff-tree --root --stdin |\n    +-\t\tsed \"s/$_x40/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \tcat >expect <<-\\EOF &&\n      \tOBJID\n    @@ -148,7 +148,7 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual.log &&\n      \ttest_cmp expect foo &&\n      \ttest_cmp expect.log actual.log\n    @@ -157,7 +157,7 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \tcat >expect <<-\\EOF &&\n      \tOBJID\n    @@ -170,7 +170,7 @@\n          # filesystem.\n          sed <\"$2\" >.test-tmp \\\n     -\t-e '/^:000000 /d;s/'$_x40'\\( [MCRNDU][0-9]*\\)\t/'$ZERO_OID'\\1\t/' &&\n    -+\t-e '/^:000000 /d;s/'$FULL_HEX'\\( [MCRNDU][0-9]*\\)\t/'$ZERO_OID'\\1\t/' &&\n    ++\t-e '/^:000000 /d;s/'$OID_REGEX'\\( [MCRNDU][0-9]*\\)\t/'$ZERO_OID'\\1\t/' &&\n          test_cmp \"$1\" .test-tmp\n      }\n      \n    @@ -183,7 +183,7 @@\n      . ./test-lib.sh\n      \n     -sed_script='s/\\(:100644 100755\\) \\('\"$_x40\"'\\) \\2 /\\1 X X /'\n    -+sed_script='s/\\(:100644 100755\\) \\('\"$FULL_HEX\"'\\) \\2 /\\1 X X /'\n    ++sed_script='s/\\(:100644 100755\\) \\('\"$OID_REGEX\"'\\) \\2 /\\1 X X /'\n      \n      test_expect_success 'setup' '\n      \techo frotz >rezrov &&\n    @@ -196,7 +196,7 @@\n      \tgit format-patch --stdout v2..v1 >patch2 &&\n      \tgrep \"^From \" patch2 >from &&\n     -\tgrep \"^From $_x40 Mon Sep 17 00:00:00 2001$\" patch2 >filtered &&\n    -+\tgrep \"^From $FULL_HEX Mon Sep 17 00:00:00 2001$\" patch2 >filtered &&\n    ++\tgrep \"^From $OID_REGEX Mon Sep 17 00:00:00 2001$\" patch2 >filtered &&\n      \ttest_cmp from filtered\n      '\n      \n    @@ -209,7 +209,7 @@\n      \tfile=$1 &&\n      \tsed \"\n     -\t\t\ts/$_x40/OBJECT_NAME/g\n    -+\t\t\ts/$FULL_HEX/OBJECT_NAME/g\n    ++\t\t\ts/$OID_REGEX/OBJECT_NAME/g\n      \t\t\ts/$_x35/OBJID/g\n      \t\t\ts/^ \\{6\\}[CTa].*/      SUBJECT/g\n      \t\t\ts/^ \\{8\\}[^ ].*/        CONTINUATION/g\n    @@ -222,7 +222,7 @@\n      \t#!/bin/sed -nf\n      \ts/$downstream_url_for_sed/URL/g\n     -\ts/$_x40/OBJECT_NAME/g\n    -+\ts/$FULL_HEX/OBJECT_NAME/g\n    ++\ts/$OID_REGEX/OBJECT_NAME/g\n      \ts/A U Thor/AUTHOR/g\n      \ts/[-0-9]\\{10\\} [:0-9]\\{8\\} [-+][0-9]\\{4\\}/DATE/g\n      \ts/        [^ ].*/        SUBJECT/g\n    @@ -236,8 +236,8 @@\n      \tgit log -1 --abbrev=5 --format=\"%H %H %H\" HEAD >actual3 &&\n     -\tsed -e \"s/$_x40/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual2 >fuzzy2 &&\n     -\tsed -e \"s/$_x40/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual3 >fuzzy3 &&\n    -+\tsed -e \"s/$FULL_HEX/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual2 >fuzzy2 &&\n    -+\tsed -e \"s/$FULL_HEX/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual3 >fuzzy3 &&\n    ++\tsed -e \"s/$OID_REGEX/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual2 >fuzzy2 &&\n    ++\tsed -e \"s/$OID_REGEX/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual3 >fuzzy3 &&\n      \ttest_cmp expect2 fuzzy2 &&\n      \ttest_cmp expect3 fuzzy3 &&\n      \t! test_cmp actual1 actual2\n    @@ -250,7 +250,7 @@\n      \n      unnote () {\n     -\tgit name-rev --tags --stdin | sed -e \"s|$_x40 (tags/\\([^)]*\\)) |\\1 |g\"\n    -+\tgit name-rev --tags --stdin | sed -e \"s|$FULL_HEX (tags/\\([^)]*\\)) |\\1 |g\"\n    ++\tgit name-rev --tags --stdin | sed -e \"s|$OID_REGEX (tags/\\([^)]*\\)) |\\1 |g\"\n      }\n      \n      test_expect_success setup '\n    @@ -263,7 +263,7 @@\n      \n      unnote () {\n     -\tgit name-rev --tags --stdin | sed -e \"s|$_x40 (tags/\\([^)]*\\))\\([ \t]\\)|\\1\\2|g\"\n    -+\tgit name-rev --tags --stdin | sed -e \"s|$FULL_HEX (tags/\\([^)]*\\))\\([ \t]\\)|\\1\\2|g\"\n    ++\tgit name-rev --tags --stdin | sed -e \"s|$OID_REGEX (tags/\\([^)]*\\))\\([ \t]\\)|\\1\\2|g\"\n      }\n      \n      test_expect_success setup '\n    @@ -276,7 +276,7 @@\n      \n      sanitize_output () {\n     -\tsed -e \"s/$_x40/HASH/\" -e \"s/$_x40/HASH/\" output >output2 &&\n    -+\tsed -e \"s/$FULL_HEX/HASH/\" -e \"s/$FULL_HEX/HASH/\" output >output2 &&\n    ++\tsed -e \"s/$OID_REGEX/HASH/\" -e \"s/$OID_REGEX/HASH/\" output >output2 &&\n      \tmv output2 output\n      }\n      \n    @@ -289,7 +289,7 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \tgit show HEAD:greeting >actual.blob &&\n      \tgit show HEAD^:greeting >actual.target &&\n    @@ -298,7 +298,7 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \t{\n      \t\tgit cat-file commit HEAD | nul_to_q &&\n    @@ -307,7 +307,7 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \tgit show HEAD:greeting >actual.blob &&\n      \tgit show HEAD^:greeting >actual.target &&\n    @@ -316,7 +316,7 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \ttest_cmp expect actual\n      '\n    @@ -325,25 +325,25 @@\n      \t\tgit rev-list HEAD |\n      \t\tgit diff-tree --root --always --stdin |\n     -\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    - \t} >actual &&\n    - \ttest_cmp expect actual\n    - '\n    -@@\n    - \t{\n    - \t\tgit rev-list HEAD |\n    - \t\tgit diff-tree --root --stdin |\n    --\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    - \t} >actual &&\n    - \ttest_cmp expect actual\n    - '\n    -@@\n    - \t{\n    - \t\tgit rev-list HEAD |\n    - \t\tgit diff-tree --root --stdin |\n    --\t\tsed \"s/$_x40/OBJID/g\"\n    -+\t\tsed \"s/$FULL_HEX/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n    + \t} >actual &&\n    + \ttest_cmp expect actual\n    + '\n    +@@\n    + \t{\n    + \t\tgit rev-list HEAD |\n    + \t\tgit diff-tree --root --stdin |\n    +-\t\tsed \"s/$_x40/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n    + \t} >actual &&\n    + \ttest_cmp expect actual\n    + '\n    +@@\n    + \t{\n    + \t\tgit rev-list HEAD |\n    + \t\tgit diff-tree --root --stdin |\n    +-\t\tsed \"s/$_x40/OBJID/g\"\n    ++\t\tsed \"s/$OID_REGEX/OBJID/g\"\n      \t} >actual &&\n      \ttest_cmp expect actual &&\n      \tgit show HEAD:postimage >actual.3 &&\n    @@ -356,7 +356,7 @@\n      \tgit rev-list read-empty |\n      \tgit diff-tree -r --root --stdin |\n     -\tsed \"s/$_x40/OBJNAME/g\" >actual &&\n    -+\tsed \"s/$FULL_HEX/OBJNAME/g\" >actual &&\n    ++\tsed \"s/$OID_REGEX/OBJNAME/g\" >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ -365,7 +365,7 @@\n      \tgit rev-list N-delete |\n      \t\tgit diff-tree -r --stdin --root --always |\n     -\t\tsed -e \"s/$_x40/OBJID/g\" >actual &&\n    -+\t\tsed -e \"s/$FULL_HEX/OBJID/g\" >actual &&\n    ++\t\tsed -e \"s/$OID_REGEX/OBJID/g\" >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ -374,7 +374,7 @@\n      \tgit rev-list done-ends |\n      \tgit diff-tree -r --stdin --root --always |\n     -\tsed -e \"s/$_x40/OBJID/g\" >actual &&\n    -+\tsed -e \"s/$FULL_HEX/OBJID/g\" >actual &&\n    - \ttest_cmp expect actual\n    - '\n    - \n    ++\tsed -e \"s/$OID_REGEX/OBJID/g\" >actual &&\n    + \ttest_cmp expect actual\n    + '\n    + \n 6: 266d018808 =  6: 41c01b5fcf t0000: annotate with SHA1 prerequisite\n 7: 6fea58fcc2 =  7: c175f5d565 t1007: annotate with SHA1 prerequisite\n 8: 57722629fa =  8: 936a8d90fd t1512: skip test if not using SHA-1\n 9: e17c66bbb0 =  9: 18a2c50777 t4044: skip test if not using SHA-1\n10: 2d2baa9729 = 10: bdb27df589 t: skip pack tests if not using SHA-1\n11: 0b50c02784 = 11: d09b454988 t2203: abstract away SHA-1-specific constants\n12: 6de266bf25 = 12: 61c93d4d8a t3103: abstract away SHA-1-specific constants\n13: a36512bfed = 13: 2fdf7883c2 t3702: abstract away SHA-1-specific constants\n14: edc0e12cca ! 14: 9e99a40aa1 t3905: abstract away SHA-1-specific constants\n    @@ -11,10 +11,9 @@\n     --- a/t/t3905-stash-include-untracked.sh\n     +++ b/t/t3905-stash-include-untracked.sh\n     @@\n    - \tgit status --porcelain >actual &&\n      \ttest_cmp expect actual\n      '\n    --\n    + \n     +tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))\n     +untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))\n      cat > expect.diff <<EOF\n15: cd84d00f27 = 15: ad45ab6bed t4007: abstract away SHA-1-specific constants\n16: 5b49fc4b62 ! 16: 56a69fbe23 t4008: abstract away SHA-1-specific constants\n    @@ -77,7 +77,7 @@\n      test_expect_success 'make file0 into something completely different' '\n      \trm -f file0 &&\n      \ttest_ln_s_add frotz file0 &&\n    -+\tlink_oid=$(printf frotz | git hash-object --stdin) &&\n    ++\tslink_id=$(printf frotz | git hash-object --stdin) &&\n      \tgit update-index file1\n      '\n      \n    @@ -87,7 +87,7 @@\n     -\t:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T\tfile0\n     -\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100\tfile1\n     +\tcat >expect <<-EOF &&\n    -+\t:100644 120000 $blob0_id $link_oid T\tfile0\n    ++\t:100644 120000 $blob0_id $slink_id T\tfile0\n     +\t:100644 100644 $blob1_id $blob0_id M100\tfile1\n      \tEOF\n      \tcompare_diff_raw expect current\n    @@ -100,7 +100,7 @@\n     -\t:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T\tfile0\n     -\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 C\tfile0\tfile1\n     +\tcat >expect <<-EOF &&\n    -+\t:100644 120000 $blob0_id $link_oid T\tfile0\n    ++\t:100644 120000 $blob0_id $slink_id T\tfile0\n     +\t:100644 100644 $blob0_id $blob0_id C\tfile0\tfile1\n      \tEOF\n      \tcompare_diff_raw expect current\n    @@ -113,7 +113,7 @@\n     -\t:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T\tfile0\n     -\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M\tfile1\n     +\tcat >expect <<-EOF &&\n    -+\t:100644 120000 $blob0_id $link_oid T\tfile0\n    ++\t:100644 120000 $blob0_id $slink_id T\tfile0\n     +\t:100644 100644 $blob1_id $blob0_id M\tfile1\n      \tEOF\n      \tcompare_diff_raw expect current\n17: a723e189cd = 17: 11c545cd51 t4014: abstract away SHA-1-specific constants\n18: 970a3016ed = 18: fcca4074e6 t4020: abstract away SHA-1-specific constants\n19: 4640ef9170 = 19: ad252e46c4 t4022: abstract away SHA-1-specific constants\n20: f1f66b513b = 20: 4046eecebd t4029: fix test indentation\n21: 9a8a9b6762 = 21: 56896e45f0 t4029: abstract away SHA-1-specific constants\n22: 6573352174 = 22: 27609ec546 t4030: abstract away SHA-1-specific constants\n23: e79d9ab24e = 23: 8c782009bf t/lib-diff-alternative: abstract away SHA-1-specific constants\n24: d0bab817d4 = 24: 2f0da3e1b8 t4205: sort log output in a hash-independent way\n25: 3b2719de86 = 25: 3e913f2526 t4042: abstract away SHA-1-specific constants\n26: f3034dd64a = 26: 2261c64650 t4045: abstract away SHA-1-specific constants\n27: fbf4568271 = 27: 458006036a t4208: abstract away SHA-1-specific constants\n28: a1c8324b74 = 28: 8da8c65428 t5300: abstract away SHA-1-specific constants\n"},{"id":"347485","messageId":"20180513022438.60003-3-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 02/28] t/test-lib: introduce ZERO_OID","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:12Z","receivedAt":"2018-05-13T02:25:06Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Currently we have a variable, $_z40, which contains the all-zero object\nID.  However, with NewHash, we'll have an all-zero object ID which is\nlonger than 40 hex characters.  In such a case, $_z40 will be a\nconfusing name.  Create a $ZERO_OID variable which will always reflect\nthe all-zeros object ID, regardless of the length of the current hash.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/test-lib.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex fce728d2ea..58c2ea52c6 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -184,6 +184,7 @@ _x40=\"$_x35$_x05\"\n # Zero SHA-1\n _z40=0000000000000000000000000000000000000000\n \n+ZERO_OID=$_z40\n EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n \n@@ -195,7 +196,7 @@ LF='\n # when case-folding filenames\n u200c=$(printf '\\342\\200\\214')\n \n-export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB\n+export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID\n \n # Each test should start with something like this, after copyright notices:\n #\n"},{"id":"347486","messageId":"20180513022438.60003-4-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 03/28] t: switch $_z40 to $ZERO_OID","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:13Z","receivedAt":"2018-05-13T02:25:14Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Switch all uses of $_z40 to $ZERO_OID so that they work correctly with\nlarger hashes.  This commit was created by using the following sed\ncommand to modify all files in the t directory except t/test-lib.sh:\n\n  sed -i 's/\\$_z40/$ZERO_OID/g'\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t1006-cat-file.sh                |  8 ++---\n t/t1400-update-ref.sh              |  2 +-\n t/t1407-worktree-ref-store.sh      |  8 ++---\n t/t1450-fsck.sh                    |  4 +--\n t/t1501-work-tree.sh               |  6 ++--\n t/t1601-index-bogus.sh             |  2 +-\n t/t1700-split-index.sh             |  2 +-\n t/t2011-checkout-invalid-head.sh   |  2 +-\n t/t2025-worktree-add.sh            |  8 ++---\n t/t2027-worktree-list.sh           |  2 +-\n t/t2107-update-index-basic.sh      |  4 +--\n t/t2201-add-update-typechange.sh   | 16 ++++-----\n t/t2203-add-intent.sh              |  6 ++--\n t/t3200-branch.sh                  |  4 +--\n t/t4002-diff-basic.sh              |  2 +-\n t/t4014-format-patch.sh            |  2 +-\n t/t4020-diff-external.sh           | 10 +++---\n t/t4027-diff-submodule.sh          |  6 ++--\n t/t4046-diff-unmerged.sh           | 14 ++++----\n t/t4054-diff-bogus-tree.sh         | 12 +++----\n t/t4058-diff-duplicates.sh         | 12 +++----\n t/t4150-am.sh                      |  4 +--\n t/t4200-rerere.sh                  |  2 +-\n t/t5516-fetch-push.sh              | 22 ++++++------\n t/t5527-fetch-odd-refs.sh          |  2 +-\n t/t5571-pre-push-hook.sh           |  8 ++---\n t/t6120-describe.sh                |  2 +-\n t/t6300-for-each-ref.sh            |  2 +-\n t/t6301-for-each-ref-errors.sh     |  2 +-\n t/t7009-filter-branch-null-sha1.sh |  2 +-\n t/t7011-skip-worktree-reading.sh   |  2 +-\n t/t7064-wtstatus-pv2.sh            | 58 +++++++++++++++---------------\n 32 files changed, 119 insertions(+), 119 deletions(-)\n\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 2ac3b940c6..13dd510b2e 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -236,8 +236,8 @@ test_expect_success \"--batch-check for an empty line\" '\n '\n \n test_expect_success 'empty --batch-check notices missing object' '\n-\techo \"$_z40 missing\" >expect &&\n-\techo \"$_z40\" | git cat-file --batch-check=\"\" >actual &&\n+\techo \"$ZERO_OID missing\" >expect &&\n+\techo \"$ZERO_OID\" | git cat-file --batch-check=\"\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -294,8 +294,8 @@ test_expect_success 'setup blobs which are likely to delta' '\n \n test_expect_success 'confirm that neither loose blob is a delta' '\n \tcat >expect <<-EOF &&\n-\t$_z40\n-\t$_z40\n+\t$ZERO_OID\n+\t$ZERO_OID\n \tEOF\n \tgit cat-file --batch-check=\"%(deltabase)\" <blobs >actual &&\n \ttest_cmp expect actual\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex 664a3a4e4e..f6dc05654e 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -6,7 +6,7 @@\n test_description='Test git update-ref and basic ref logging'\n . ./test-lib.sh\n \n-Z=$_z40\n+Z=$ZERO_OID\n \n m=refs/heads/master\n n_dir=refs/heads/gu\ndiff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\nindex 2211f9831f..4623ae15c4 100755\n--- a/t/t1407-worktree-ref-store.sh\n+++ b/t/t1407-worktree-ref-store.sh\n@@ -50,13 +50,13 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' '\n '\n \n test_expect_success 'for_each_reflog()' '\n-\techo $_z40 > .git/logs/PSEUDO-MAIN &&\n+\techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n \tmkdir -p     .git/logs/refs/bisect &&\n-\techo $_z40 > .git/logs/refs/bisect/random &&\n+\techo $ZERO_OID > .git/logs/refs/bisect/random &&\n \n-\techo $_z40 > .git/worktrees/wt/logs/PSEUDO-WT &&\n+\techo $ZERO_OID > .git/worktrees/wt/logs/PSEUDO-WT &&\n \tmkdir -p     .git/worktrees/wt/logs/refs/bisect &&\n-\techo $_z40 > .git/worktrees/wt/logs/refs/bisect/wt-random &&\n+\techo $ZERO_OID > .git/worktrees/wt/logs/refs/bisect/wt-random &&\n \n \t$RWT for-each-reflog | cut -c 42- | sort >actual &&\n \tcat >expected <<-\\EOF &&\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex cb4b66e29d..91fd71444d 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -713,7 +713,7 @@ test_expect_success 'fsck notices dangling objects' '\n \n test_expect_success 'fsck $name notices bogus $name' '\n \ttest_must_fail git fsck bogus &&\n-\ttest_must_fail git fsck $_z40\n+\ttest_must_fail git fsck $ZERO_OID\n '\n \n test_expect_success 'bogus head does not fallback to all heads' '\n@@ -723,7 +723,7 @@ test_expect_success 'bogus head does not fallback to all heads' '\n \tblob=$(git rev-parse :foo) &&\n \ttest_when_finished \"git rm --cached foo\" &&\n \tremove_object $blob &&\n-\ttest_must_fail git fsck $_z40 >out 2>&1 &&\n+\ttest_must_fail git fsck $ZERO_OID >out 2>&1 &&\n \t! grep $blob out\n '\n \ndiff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh\nindex 9c0bc65250..afcdfafe45 100755\n--- a/t/t1501-work-tree.sh\n+++ b/t/t1501-work-tree.sh\n@@ -238,10 +238,10 @@ test_expect_success '_gently() groks relative GIT_DIR & GIT_WORK_TREE' '\n \n test_expect_success 'diff-index respects work tree under .git dir' '\n \tcat >diff-index-cached.expected <<-EOF &&\n-\t:000000 100644 $_z40 $EMPTY_BLOB A\tsub/dir/tracked\n+\t:000000 100644 $ZERO_OID $EMPTY_BLOB A\tsub/dir/tracked\n \tEOF\n \tcat >diff-index.expected <<-EOF &&\n-\t:000000 100644 $_z40 $_z40 A\tsub/dir/tracked\n+\t:000000 100644 $ZERO_OID $ZERO_OID A\tsub/dir/tracked\n \tEOF\n \n \t(\n@@ -257,7 +257,7 @@ test_expect_success 'diff-index respects work tree under .git dir' '\n \n test_expect_success 'diff-files respects work tree under .git dir' '\n \tcat >diff-files.expected <<-EOF &&\n-\t:100644 100644 $EMPTY_BLOB $_z40 M\tsub/dir/tracked\n+\t:100644 100644 $EMPTY_BLOB $ZERO_OID M\tsub/dir/tracked\n \tEOF\n \n \t(\ndiff --git a/t/t1601-index-bogus.sh b/t/t1601-index-bogus.sh\nindex 73cc9323cd..4171f1e141 100755\n--- a/t/t1601-index-bogus.sh\n+++ b/t/t1601-index-bogus.sh\n@@ -4,7 +4,7 @@ test_description='test handling of bogus index entries'\n . ./test-lib.sh\n \n test_expect_success 'create tree with null sha1' '\n-\ttree=$(printf \"160000 commit $_z40\\\\tbroken\\\\n\" | git mktree)\n+\ttree=$(printf \"160000 commit $ZERO_OID\\\\tbroken\\\\n\" | git mktree)\n '\n \n test_expect_success 'read-tree refuses to read null sha1' '\ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex e4f4c4df4e..1e81b33b2e 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -426,7 +426,7 @@ test_expect_success 'writing split index with null sha1 does not write cache tre\n \tgit commit -m \"commit\" &&\n \t{\n \t\tgit ls-tree HEAD &&\n-\t\tprintf \"160000 commit $_z40\\\\tbroken\\\\n\"\n+\t\tprintf \"160000 commit $ZERO_OID\\\\tbroken\\\\n\"\n \t} >broken-tree &&\n \techo \"add broken entry\" >msg &&\n \ndiff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh\nindex c5501b008c..0e8d56aa76 100755\n--- a/t/t2011-checkout-invalid-head.sh\n+++ b/t/t2011-checkout-invalid-head.sh\n@@ -15,7 +15,7 @@ test_expect_success 'checkout should not start branch from a tree' '\n '\n \n test_expect_success 'checkout master from invalid HEAD' '\n-\techo $_z40 >.git/HEAD &&\n+\techo $ZERO_OID >.git/HEAD &&\n \tgit checkout master --\n '\n \ndiff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh\nindex d0d2e4f7ec..beaed5e7a1 100755\n--- a/t/t2025-worktree-add.sh\n+++ b/t/t2025-worktree-add.sh\n@@ -465,7 +465,7 @@ post_checkout_hook () {\n test_expect_success '\"add\" invokes post-checkout hook (branch)' '\n \tpost_checkout_hook &&\n \t{\n-\t\techo $_z40 $(git rev-parse HEAD) 1 &&\n+\t\techo $ZERO_OID $(git rev-parse HEAD) 1 &&\n \t\techo $(pwd)/.git/worktrees/gumby &&\n \t\techo $(pwd)/gumby\n \t} >hook.expect &&\n@@ -476,7 +476,7 @@ test_expect_success '\"add\" invokes post-checkout hook (branch)' '\n test_expect_success '\"add\" invokes post-checkout hook (detached)' '\n \tpost_checkout_hook &&\n \t{\n-\t\techo $_z40 $(git rev-parse HEAD) 1 &&\n+\t\techo $ZERO_OID $(git rev-parse HEAD) 1 &&\n \t\techo $(pwd)/.git/worktrees/grumpy &&\n \t\techo $(pwd)/grumpy\n \t} >hook.expect &&\n@@ -494,7 +494,7 @@ test_expect_success '\"add --no-checkout\" suppresses post-checkout hook' '\n test_expect_success '\"add\" in other worktree invokes post-checkout hook' '\n \tpost_checkout_hook &&\n \t{\n-\t\techo $_z40 $(git rev-parse HEAD) 1 &&\n+\t\techo $ZERO_OID $(git rev-parse HEAD) 1 &&\n \t\techo $(pwd)/.git/worktrees/guppy &&\n \t\techo $(pwd)/guppy\n \t} >hook.expect &&\n@@ -506,7 +506,7 @@ test_expect_success '\"add\" in bare repo invokes post-checkout hook' '\n \trm -rf bare &&\n \tgit clone --bare . bare &&\n \t{\n-\t\techo $_z40 $(git --git-dir=bare rev-parse HEAD) 1 &&\n+\t\techo $ZERO_OID $(git --git-dir=bare rev-parse HEAD) 1 &&\n \t\techo $(pwd)/bare/worktrees/goozy &&\n \t\techo $(pwd)/goozy\n \t} >hook.expect &&\ndiff --git a/t/t2027-worktree-list.sh b/t/t2027-worktree-list.sh\nindex 720063bf0d..bb6fb9b12c 100755\n--- a/t/t2027-worktree-list.sh\n+++ b/t/t2027-worktree-list.sh\n@@ -116,7 +116,7 @@ test_expect_success 'broken main worktree still at the top' '\n \t\tgit worktree add linked &&\n \t\tcat >expected <<-EOF &&\n \t\tworktree $(pwd)\n-\t\tHEAD $_z40\n+\t\tHEAD $ZERO_OID\n \n \t\tEOF\n \t\tcd linked &&\ndiff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh\nindex 1db7e6a1ab..2242cd098e 100755\n--- a/t/t2107-update-index-basic.sh\n+++ b/t/t2107-update-index-basic.sh\n@@ -37,7 +37,7 @@ test_expect_success '--cacheinfo does not accept blob null sha1' '\n \techo content >file &&\n \tgit add file &&\n \tgit rev-parse :file >expect &&\n-\ttest_must_fail git update-index --cacheinfo 100644 $_z40 file &&\n+\ttest_must_fail git update-index --cacheinfo 100644 $ZERO_OID file &&\n \tgit rev-parse :file >actual &&\n \ttest_cmp expect actual\n '\n@@ -47,7 +47,7 @@ test_expect_success '--cacheinfo does not accept gitlink null sha1' '\n \t(cd submodule && test_commit foo) &&\n \tgit add submodule &&\n \tgit rev-parse :submodule >expect &&\n-\ttest_must_fail git update-index --cacheinfo 160000 $_z40 submodule &&\n+\ttest_must_fail git update-index --cacheinfo 160000 $ZERO_OID submodule &&\n \tgit rev-parse :submodule >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t2201-add-update-typechange.sh b/t/t2201-add-update-typechange.sh\nindex 954fc51e5b..a4eec0a346 100755\n--- a/t/t2201-add-update-typechange.sh\n+++ b/t/t2201-add-update-typechange.sh\n@@ -75,35 +75,35 @@ test_expect_success modify '\n \t\tgit ls-tree -r HEAD |\n \t\tsed -e \"s/^/:/\" -e \"\n \t\t\t/\tcaskly/{\n-\t\t\t\ts/\tcaskly/ $_z40 D&/\n+\t\t\t\ts/\tcaskly/ $ZERO_OID D&/\n \t\t\t\ts/blob/000000/\n \t\t\t}\n \t\t\t/\tnitfol/{\n-\t\t\t\ts/\tnitfol/ $_z40 $T_letter&/\n+\t\t\t\ts/\tnitfol/ $ZERO_OID $T_letter&/\n \t\t\t\ts/blob/100644/\n \t\t\t}\n \t\t\t/\trezrov.bozbar/{\n-\t\t\t\ts/\trezrov.bozbar/ $_z40 D&/\n+\t\t\t\ts/\trezrov.bozbar/ $ZERO_OID D&/\n \t\t\t\ts/blob/000000/\n \t\t\t}\n \t\t\t/\txyzzy/{\n-\t\t\t\ts/\txyzzy/ $_z40 D&/\n+\t\t\t\ts/\txyzzy/ $ZERO_OID D&/\n \t\t\t\ts/blob/000000/\n \t\t\t}\n \t\t\t/\tyomin/{\n-\t\t\t    s/\tyomin/ $_z40 T&/\n+\t\t\t    s/\tyomin/ $ZERO_OID T&/\n \t\t\t\ts/blob/160000/\n \t\t\t}\n \t\t\"\n \t} >expect &&\n \t{\n \t\tcat expect\n-\t\techo \":100644 160000 $_empty $_z40 T\tyonk\"\n-\t\techo \":100644 000000 $_empty $_z40 D\tzifmia\"\n+\t\techo \":100644 160000 $_empty $ZERO_OID T\tyonk\"\n+\t\techo \":100644 000000 $_empty $ZERO_OID D\tzifmia\"\n \t} >expect-files &&\n \t{\n \t\tcat expect\n-\t\techo \":000000 160000 $_z40 $_z40 A\tyonk\"\n+\t\techo \":000000 160000 $ZERO_OID $ZERO_OID A\tyonk\"\n \t} >expect-index &&\n \t{\n \t\techo \"100644 $_empty 0\tnitfol\"\ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex 78236dc7d8..1797f946b9 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -30,9 +30,9 @@ test_expect_success 'git status with porcelain v2' '\n \tnam1=d00491fd7e5bb6fa28c517a0bb32b8b506539d4d &&\n \tnam2=ce013625030ba8dba906f756967f9e9ca394464a &&\n \tcat >expect <<-EOF &&\n-\t1 DA N... 100644 000000 100644 $nam1 $_z40 1.t\n-\t1 A. N... 000000 100644 100644 $_z40 $nam2 elif\n-\t1 .A N... 000000 000000 100644 $_z40 $_z40 file\n+\t1 DA N... 100644 000000 100644 $nam1 $ZERO_OID 1.t\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $nam2 elif\n+\t1 .A N... 000000 000000 100644 $ZERO_OID $ZERO_OID file\n \tEOF\n \ttest_cmp expect actual\n '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex c0ef946811..b52c655c37 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -47,7 +47,7 @@ test_expect_success 'git branch HEAD should fail' '\n '\n \n cat >expect <<EOF\n-$_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n EOF\n test_expect_success 'git branch -l d/e/f should create a branch and a log' '\n \tGIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\n@@ -901,7 +901,7 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups\n \n # Keep this test last, as it changes the current branch\n cat >expect <<EOF\n-$_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n EOF\n test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '\n \tGIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex a5e8b83083..5af773d6f7 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -131,7 +131,7 @@ cmp_diff_files_output () {\n     # object ID for the changed files because it wants you to look at the\n     # filesystem.\n     sed <\"$2\" >.test-tmp \\\n-\t-e '/^:000000 /d;s/'$_x40'\\( [MCRNDU][0-9]*\\)\t/'$_z40'\\1\t/' &&\n+\t-e '/^:000000 /d;s/'$_x40'\\( [MCRNDU][0-9]*\\)\t/'$ZERO_OID'\\1\t/' &&\n     test_cmp \"$1\" .test-tmp\n }\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 482112ca33..0dbf7d5b4b 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -1523,7 +1523,7 @@ test_expect_success 'cover letter auto user override' '\n test_expect_success 'format-patch --zero-commit' '\n \tgit format-patch --zero-commit --stdout v2..v1 >patch2 &&\n \tgrep \"^From \" patch2 | sort | uniq >actual &&\n-\techo \"From $_z40 Mon Sep 17 00:00:00 2001\" >expect &&\n+\techo \"From $ZERO_OID Mon Sep 17 00:00:00 2001\" >expect &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\nindex 044620186d..49d3f54b29 100755\n--- a/t/t4020-diff-external.sh\n+++ b/t/t4020-diff-external.sh\n@@ -26,7 +26,7 @@ test_expect_success 'GIT_EXTERNAL_DIFF environment' '\n \t\tread path oldfile oldhex oldmode newfile newhex newmode &&\n \t\ttest \"z$path\" = zfile &&\n \t\ttest \"z$oldmode\" = z100644 &&\n-\t\ttest \"z$newhex\" = \"z$_z40\" &&\n+\t\ttest \"z$newhex\" = \"z$ZERO_OID\" &&\n \t\ttest \"z$newmode\" = z100644 &&\n \t\toh=$(git rev-parse --verify HEAD:file) &&\n \t\ttest \"z$oh\" = \"z$oldhex\"\n@@ -55,7 +55,7 @@ test_expect_success SYMLINKS 'typechange diff' '\n \t\tread path oldfile oldhex oldmode newfile newhex newmode &&\n \t\ttest \"z$path\" = zfile &&\n \t\ttest \"z$oldmode\" = z100644 &&\n-\t\ttest \"z$newhex\" = \"z$_z40\" &&\n+\t\ttest \"z$newhex\" = \"z$ZERO_OID\" &&\n \t\ttest \"z$newmode\" = z120000 &&\n \t\toh=$(git rev-parse --verify HEAD:file) &&\n \t\ttest \"z$oh\" = \"z$oldhex\"\n@@ -73,7 +73,7 @@ test_expect_success 'diff.external' '\n \t\tread path oldfile oldhex oldmode newfile newhex newmode &&\n \t\ttest \"z$path\" = zfile &&\n \t\ttest \"z$oldmode\" = z100644 &&\n-\t\ttest \"z$newhex\" = \"z$_z40\" &&\n+\t\ttest \"z$newhex\" = \"z$ZERO_OID\" &&\n \t\ttest \"z$newmode\" = z100644 &&\n \t\toh=$(git rev-parse --verify HEAD:file) &&\n \t\ttest \"z$oh\" = \"z$oldhex\"\n@@ -104,7 +104,7 @@ test_expect_success 'diff attribute' '\n \t\tread path oldfile oldhex oldmode newfile newhex newmode &&\n \t\ttest \"z$path\" = zfile &&\n \t\ttest \"z$oldmode\" = z100644 &&\n-\t\ttest \"z$newhex\" = \"z$_z40\" &&\n+\t\ttest \"z$newhex\" = \"z$ZERO_OID\" &&\n \t\ttest \"z$newmode\" = z100644 &&\n \t\toh=$(git rev-parse --verify HEAD:file) &&\n \t\ttest \"z$oh\" = \"z$oldhex\"\n@@ -137,7 +137,7 @@ test_expect_success 'diff attribute' '\n \t\tread path oldfile oldhex oldmode newfile newhex newmode &&\n \t\ttest \"z$path\" = zfile &&\n \t\ttest \"z$oldmode\" = z100644 &&\n-\t\ttest \"z$newhex\" = \"z$_z40\" &&\n+\t\ttest \"z$newhex\" = \"z$ZERO_OID\" &&\n \t\ttest \"z$newmode\" = z100644 &&\n \t\toh=$(git rev-parse --verify HEAD:file) &&\n \t\ttest \"z$oh\" = \"z$oldhex\"\ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex 2ffd11a142..6304130ad4 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -31,7 +31,7 @@ test_expect_success setup '\n \t\tcd sub &&\n \t\tgit rev-list HEAD\n \t) &&\n-\techo \":160000 160000 $3 $_z40 M\tsub\" >expect &&\n+\techo \":160000 160000 $3 $ZERO_OID M\tsub\" >expect &&\n \tsubtip=$3 subprev=$2\n '\n \n@@ -250,7 +250,7 @@ test_expect_success 'conflicted submodule setup' '\n \t# 39 efs\n \tc=fffffffffffffffffffffffffffffffffffffff &&\n \t(\n-\t\techo \"000000 $_z40 0\tsub\" &&\n+\t\techo \"000000 $ZERO_OID 0\tsub\" &&\n \t\techo \"160000 1$c 1\tsub\" &&\n \t\techo \"160000 2$c 2\tsub\" &&\n \t\techo \"160000 3$c 3\tsub\"\n@@ -265,7 +265,7 @@ index 2ffffff,3ffffff..0000000\n ++Subproject commit 0000000000000000000000000000000000000000'\\'' &&\n \n \thh=$(git rev-parse HEAD) &&\n-\tsed -e \"s/$_z40/$hh/\" expect.nosub >expect.withsub\n+\tsed -e \"s/$ZERO_OID/$hh/\" expect.nosub >expect.withsub\n \n '\n \ndiff --git a/t/t4046-diff-unmerged.sh b/t/t4046-diff-unmerged.sh\nindex d0f14475ca..ff7cfd884a 100755\n--- a/t/t4046-diff-unmerged.sh\n+++ b/t/t4046-diff-unmerged.sh\n@@ -37,7 +37,7 @@ test_expect_success 'diff-files -0' '\n \tfor path in $paths\n \tdo\n \t\t>\"$path\" &&\n-\t\techo \":000000 100644 $_z40 $_z40 U\t$path\"\n+\t\techo \":000000 100644 $ZERO_OID $ZERO_OID U\t$path\"\n \tdone >diff-files-0.expect &&\n \tgit diff-files -0 >diff-files-0.actual &&\n \ttest_cmp diff-files-0.expect diff-files-0.actual\n@@ -47,9 +47,9 @@ test_expect_success 'diff-files -1' '\n \tfor path in $paths\n \tdo\n \t\t>\"$path\" &&\n-\t\techo \":000000 100644 $_z40 $_z40 U\t$path\" &&\n+\t\techo \":000000 100644 $ZERO_OID $ZERO_OID U\t$path\" &&\n \t\tcase \"$path\" in\n-\t\tx??) echo \":100644 100644 $blob1 $_z40 M\t$path\"\n+\t\tx??) echo \":100644 100644 $blob1 $ZERO_OID M\t$path\"\n \t\tesac\n \tdone >diff-files-1.expect &&\n \tgit diff-files -1 >diff-files-1.actual &&\n@@ -60,9 +60,9 @@ test_expect_success 'diff-files -2' '\n \tfor path in $paths\n \tdo\n \t\t>\"$path\" &&\n-\t\techo \":000000 100644 $_z40 $_z40 U\t$path\" &&\n+\t\techo \":000000 100644 $ZERO_OID $ZERO_OID U\t$path\" &&\n \t\tcase \"$path\" in\n-\t\t?x?) echo \":100644 100644 $blob2 $_z40 M\t$path\"\n+\t\t?x?) echo \":100644 100644 $blob2 $ZERO_OID M\t$path\"\n \t\tesac\n \tdone >diff-files-2.expect &&\n \tgit diff-files -2 >diff-files-2.actual &&\n@@ -75,9 +75,9 @@ test_expect_success 'diff-files -3' '\n \tfor path in $paths\n \tdo\n \t\t>\"$path\" &&\n-\t\techo \":000000 100644 $_z40 $_z40 U\t$path\" &&\n+\t\techo \":000000 100644 $ZERO_OID $ZERO_OID U\t$path\" &&\n \t\tcase \"$path\" in\n-\t\t??x) echo \":100644 100644 $blob3 $_z40 M\t$path\"\n+\t\t??x) echo \":100644 100644 $blob3 $ZERO_OID M\t$path\"\n \t\tesac\n \tdone >diff-files-3.expect &&\n \tgit diff-files -3 >diff-files-3.actual &&\ndiff --git a/t/t4054-diff-bogus-tree.sh b/t/t4054-diff-bogus-tree.sh\nindex 18f42c5fff..fcae82fffa 100755\n--- a/t/t4054-diff-bogus-tree.sh\n+++ b/t/t4054-diff-bogus-tree.sh\n@@ -19,37 +19,37 @@ test_expect_success 'create tree with matching file' '\n '\n \n test_expect_success 'raw diff shows null sha1 (addition)' '\n-\techo \":000000 100644 $_z40 $_z40 A\tfoo\" >expect &&\n+\techo \":000000 100644 $ZERO_OID $ZERO_OID A\tfoo\" >expect &&\n \tgit diff-tree $EMPTY_TREE $bogus_tree >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'raw diff shows null sha1 (removal)' '\n-\techo \":100644 000000 $_z40 $_z40 D\tfoo\" >expect &&\n+\techo \":100644 000000 $ZERO_OID $ZERO_OID D\tfoo\" >expect &&\n \tgit diff-tree $bogus_tree $EMPTY_TREE >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'raw diff shows null sha1 (modification)' '\n-\techo \":100644 100644 $blob $_z40 M\tfoo\" >expect &&\n+\techo \":100644 100644 $blob $ZERO_OID M\tfoo\" >expect &&\n \tgit diff-tree $good_tree $bogus_tree >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'raw diff shows null sha1 (other direction)' '\n-\techo \":100644 100644 $_z40 $blob M\tfoo\" >expect &&\n+\techo \":100644 100644 $ZERO_OID $blob M\tfoo\" >expect &&\n \tgit diff-tree $bogus_tree $good_tree >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'raw diff shows null sha1 (reverse)' '\n-\techo \":100644 100644 $_z40 $blob M\tfoo\" >expect &&\n+\techo \":100644 100644 $ZERO_OID $blob M\tfoo\" >expect &&\n \tgit diff-tree -R $good_tree $bogus_tree >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'raw diff shows null sha1 (index)' '\n-\techo \":100644 100644 $_z40 $blob M\tfoo\" >expect &&\n+\techo \":100644 100644 $ZERO_OID $blob M\tfoo\" >expect &&\n \tgit diff-index $bogus_tree >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t4058-diff-duplicates.sh b/t/t4058-diff-duplicates.sh\nindex 0a23242cb6..c24ee175ef 100755\n--- a/t/t4058-diff-duplicates.sh\n+++ b/t/t4058-diff-duplicates.sh\n@@ -59,12 +59,12 @@ test_expect_success 'create trees with duplicate entries' '\n \n test_expect_success 'diff-tree between trees' '\n \t{\n-\t\tprintf \":000000 100644 $_z40 $blob_two A\\touter/inner\\n\" &&\n-\t\tprintf \":000000 100644 $_z40 $blob_two A\\touter/inner\\n\" &&\n-\t\tprintf \":000000 100644 $_z40 $blob_two A\\touter/inner\\n\" &&\n-\t\tprintf \":100644 000000 $blob_two $_z40 D\\touter/inner\\n\" &&\n-\t\tprintf \":100644 000000 $blob_two $_z40 D\\touter/inner\\n\" &&\n-\t\tprintf \":100644 000000 $blob_two $_z40 D\\touter/inner\\n\"\n+\t\tprintf \":000000 100644 $ZERO_OID $blob_two A\\touter/inner\\n\" &&\n+\t\tprintf \":000000 100644 $ZERO_OID $blob_two A\\touter/inner\\n\" &&\n+\t\tprintf \":000000 100644 $ZERO_OID $blob_two A\\touter/inner\\n\" &&\n+\t\tprintf \":100644 000000 $blob_two $ZERO_OID D\\touter/inner\\n\" &&\n+\t\tprintf \":100644 000000 $blob_two $ZERO_OID D\\touter/inner\\n\" &&\n+\t\tprintf \":100644 000000 $blob_two $ZERO_OID D\\touter/inner\\n\"\n \t} >expect &&\n \tgit diff-tree -r --no-abbrev one two >actual &&\n \ttest_cmp expect actual\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 1eccfb71d0..1ebc587f8f 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -140,8 +140,8 @@ test_expect_success setup '\n \t\techo \"# User $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\" &&\n \t\techo \"# Date $test_tick 25200\" &&\n \t\techo \"#      $(git show --pretty=\"%aD\" -s second)\" &&\n-\t\techo \"# Node ID $_z40\" &&\n-\t\techo \"# Parent  $_z40\" &&\n+\t\techo \"# Node ID $ZERO_OID\" &&\n+\t\techo \"# Parent  $ZERO_OID\" &&\n \t\tcat msg &&\n \t\techo &&\n \t\tgit diff-tree --no-commit-id -p second\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex eaf18c81cb..8417e5a4b1 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -243,7 +243,7 @@ rerere_gc_custom_expiry_test () {\n \tfive_days=\"$1\" right_now=\"$2\"\n \ttest_expect_success \"rerere gc with custom expiry ($five_days, $right_now)\" '\n \t\trm -fr .git/rr-cache &&\n-\t\trr=.git/rr-cache/$_z40 &&\n+\t\trr=.git/rr-cache/$ZERO_OID &&\n \t\tmkdir -p \"$rr\" &&\n \t\t>\"$rr/preimage\" &&\n \t\t>\"$rr/postimage\" &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 82239138d5..d9c90f2ba5 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -634,7 +634,7 @@ test_expect_success 'pushing valid refs triggers post-receive and post-update ho\n \torgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&\n \tnewmaster=$(git show-ref -s --verify refs/heads/master) &&\n \torgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&\n-\tnewnext=$_z40 &&\n+\tnewnext=$ZERO_OID &&\n \tgit push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&\n \t(\n \t\tcd testrepo/.git &&\n@@ -672,15 +672,15 @@ test_expect_success 'deleting dangling ref triggers hooks with correct args' '\n \t(\n \t\tcd testrepo/.git &&\n \t\tcat >pre-receive.expect <<-EOF &&\n-\t\t$_z40 $_z40 refs/heads/master\n+\t\t$ZERO_OID $ZERO_OID refs/heads/master\n \t\tEOF\n \n \t\tcat >update.expect <<-EOF &&\n-\t\trefs/heads/master $_z40 $_z40\n+\t\trefs/heads/master $ZERO_OID $ZERO_OID\n \t\tEOF\n \n \t\tcat >post-receive.expect <<-EOF &&\n-\t\t$_z40 $_z40 refs/heads/master\n+\t\t$ZERO_OID $ZERO_OID refs/heads/master\n \t\tEOF\n \n \t\tcat >post-update.expect <<-EOF &&\n@@ -703,12 +703,12 @@ test_expect_success 'deletion of a non-existent ref is not fed to post-receive a\n \t\tcd testrepo/.git &&\n \t\tcat >pre-receive.expect <<-EOF &&\n \t\t$orgmaster $newmaster refs/heads/master\n-\t\t$_z40 $_z40 refs/heads/nonexistent\n+\t\t$ZERO_OID $ZERO_OID refs/heads/nonexistent\n \t\tEOF\n \n \t\tcat >update.expect <<-EOF &&\n \t\trefs/heads/master $orgmaster $newmaster\n-\t\trefs/heads/nonexistent $_z40 $_z40\n+\t\trefs/heads/nonexistent $ZERO_OID $ZERO_OID\n \t\tEOF\n \n \t\tcat >post-receive.expect <<-EOF &&\n@@ -732,11 +732,11 @@ test_expect_success 'deletion of a non-existent ref alone does trigger post-rece\n \t(\n \t\tcd testrepo/.git &&\n \t\tcat >pre-receive.expect <<-EOF &&\n-\t\t$_z40 $_z40 refs/heads/nonexistent\n+\t\t$ZERO_OID $ZERO_OID refs/heads/nonexistent\n \t\tEOF\n \n \t\tcat >update.expect <<-EOF &&\n-\t\trefs/heads/nonexistent $_z40 $_z40\n+\t\trefs/heads/nonexistent $ZERO_OID $ZERO_OID\n \t\tEOF\n \n \t\ttest_cmp pre-receive.expect pre-receive.actual &&\n@@ -751,7 +751,7 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w\n \torgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&\n \tnewmaster=$(git show-ref -s --verify refs/heads/master) &&\n \torgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&\n-\tnewnext=$_z40 &&\n+\tnewnext=$ZERO_OID &&\n \torgpu=$(cd testrepo && git show-ref -s --verify refs/heads/pu) &&\n \tnewpu=$(git show-ref -s --verify refs/heads/master) &&\n \tgit push testrepo refs/heads/master:refs/heads/master \\\n@@ -763,14 +763,14 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w\n \t\t$orgmaster $newmaster refs/heads/master\n \t\t$orgnext $newnext refs/heads/next\n \t\t$orgpu $newpu refs/heads/pu\n-\t\t$_z40 $_z40 refs/heads/nonexistent\n+\t\t$ZERO_OID $ZERO_OID refs/heads/nonexistent\n \t\tEOF\n \n \t\tcat >update.expect <<-EOF &&\n \t\trefs/heads/master $orgmaster $newmaster\n \t\trefs/heads/next $orgnext $newnext\n \t\trefs/heads/pu $orgpu $newpu\n-\t\trefs/heads/nonexistent $_z40 $_z40\n+\t\trefs/heads/nonexistent $ZERO_OID $ZERO_OID\n \t\tEOF\n \n \t\tcat >post-receive.expect <<-EOF &&\ndiff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh\nindex 207899a99f..3b0cb98422 100755\n--- a/t/t5527-fetch-odd-refs.sh\n+++ b/t/t5527-fetch-odd-refs.sh\n@@ -27,7 +27,7 @@ test_expect_success 'suffix ref is ignored during fetch' '\n '\n \n test_expect_success 'try to create repo with absurdly long refname' '\n-\tref240=$_z40/$_z40/$_z40/$_z40/$_z40/$_z40 &&\n+\tref240=$ZERO_OID/$ZERO_OID/$ZERO_OID/$ZERO_OID/$ZERO_OID/$ZERO_OID &&\n \tref1440=$ref240/$ref240/$ref240/$ref240/$ref240/$ref240 &&\n \tgit init long &&\n \t(\ndiff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh\nindex ba975bb355..ac53d63869 100755\n--- a/t/t5571-pre-push-hook.sh\n+++ b/t/t5571-pre-push-hook.sh\n@@ -78,8 +78,8 @@ test_expect_success 'push to default' '\n cat >expected <<EOF\n parent1\n repo1\n-refs/tags/one $COMMIT1 refs/tags/tag1 $_z40\n-HEAD~ $COMMIT2 refs/heads/prev $_z40\n+refs/tags/one $COMMIT1 refs/tags/tag1 $ZERO_OID\n+HEAD~ $COMMIT2 refs/heads/prev $ZERO_OID\n EOF\n \n test_expect_success 'push non-branches' '\n@@ -90,7 +90,7 @@ test_expect_success 'push non-branches' '\n cat >expected <<EOF\n parent1\n repo1\n-(delete) $_z40 refs/heads/prev $COMMIT2\n+(delete) $ZERO_OID refs/heads/prev $COMMIT2\n EOF\n \n test_expect_success 'push delete' '\n@@ -101,7 +101,7 @@ test_expect_success 'push delete' '\n cat >expected <<EOF\n repo1\n repo1\n-HEAD $COMMIT3 refs/heads/other $_z40\n+HEAD $COMMIT3 refs/heads/other $ZERO_OID\n EOF\n \n test_expect_success 'push to URL' '\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex bae78c4e89..84dd1cb690 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -383,7 +383,7 @@ test_expect_success 'describe complains about tree object' '\n '\n \n test_expect_success 'describe complains about missing object' '\n-\ttest_must_fail git describe $_z40\n+\ttest_must_fail git describe $ZERO_OID\n '\n \n test_done\ndiff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh\nindex 295d1475bd..48379aa0ee 100755\n--- a/t/t6300-for-each-ref.sh\n+++ b/t/t6300-for-each-ref.sh\n@@ -310,7 +310,7 @@ test_expect_success 'exercise strftime with odd fields' '\n \techo >expected &&\n \tgit for-each-ref --format=\"%(authordate:format:)\" refs/heads >actual &&\n \ttest_cmp expected actual &&\n-\tlong=\"long format -- $_z40$_z40$_z40$_z40$_z40$_z40$_z40\" &&\n+\tlong=\"long format -- $ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID\" &&\n \techo $long >expected &&\n \tgit for-each-ref --format=\"%(authordate:format:$long)\" refs/heads >actual &&\n \ttest_cmp expected actual\ndiff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh\nindex c734ce2388..49cc65bb58 100755\n--- a/t/t6301-for-each-ref-errors.sh\n+++ b/t/t6301-for-each-ref-errors.sh\n@@ -4,7 +4,7 @@ test_description='for-each-ref errors for broken refs'\n \n . ./test-lib.sh\n \n-ZEROS=$_z40\n+ZEROS=$ZERO_OID\n MISSING=abababababababababababababababababababab\n \n test_expect_success setup '\ndiff --git a/t/t7009-filter-branch-null-sha1.sh b/t/t7009-filter-branch-null-sha1.sh\nindex a8d9ec4987..9ba9f24ad2 100755\n--- a/t/t7009-filter-branch-null-sha1.sh\n+++ b/t/t7009-filter-branch-null-sha1.sh\n@@ -12,7 +12,7 @@ test_expect_success 'setup: base commits' '\n test_expect_success 'setup: a commit with a bogus null sha1 in the tree' '\n \t{\n \t\tgit ls-tree HEAD &&\n-\t\tprintf \"160000 commit $_z40\\\\tbroken\\\\n\"\n+\t\tprintf \"160000 commit $ZERO_OID\\\\tbroken\\\\n\"\n \t} >broken-tree &&\n \techo \"add broken entry\" >msg &&\n \ndiff --git a/t/t7011-skip-worktree-reading.sh b/t/t7011-skip-worktree-reading.sh\nindex 84f41451ec..37525cae3a 100755\n--- a/t/t7011-skip-worktree-reading.sh\n+++ b/t/t7011-skip-worktree-reading.sh\n@@ -118,7 +118,7 @@ test_expect_success 'grep with skip-worktree file' '\n \ttest \"$(git grep --no-ext-grep test)\" = \"1:test\"\n '\n \n-echo \":000000 100644 $_z40 $EMPTY_BLOB A\t1\" > expected\n+echo \":000000 100644 $ZERO_OID $EMPTY_BLOB A\t1\" > expected\n test_expect_success 'diff-index does not examine skip-worktree absent entries' '\n \tsetup_absent &&\n \tgit diff-index HEAD -- 1 > result &&\ndiff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh\nindex 8f795327a0..b9a86d3347 100755\n--- a/t/t7064-wtstatus-pv2.sh\n+++ b/t/t7064-wtstatus-pv2.sh\n@@ -46,11 +46,11 @@ test_expect_success 'before initial commit, things added' '\n \tcat >expect <<-EOF &&\n \t# branch.oid (initial)\n \t# branch.head master\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_A dir1/file_a\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_B dir1/file_b\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_X file_x\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_Y file_y\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_Z file_z\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_Y file_y\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_Z file_z\n \t? actual\n \t? expect\n \tEOF\n@@ -63,11 +63,11 @@ test_expect_success 'before initial commit, things added (-z)' '\n \tlf_to_nul >expect <<-EOF &&\n \t# branch.oid (initial)\n \t# branch.head master\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_A dir1/file_a\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_B dir1/file_b\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_X file_x\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_Y file_y\n-\t1 A. N... 000000 100644 100644 $_z40 $OID_Z file_z\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_Y file_y\n+\t1 A. N... 000000 100644 100644 $ZERO_OID $OID_Z file_z\n \t? actual\n \t? expect\n \tEOF\n@@ -128,7 +128,7 @@ test_expect_success 'after first commit, stage existing changes' '\n \t# branch.oid $H0\n \t# branch.head master\n \t1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x\n-\t1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z\n+\t1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z\n \t? actual\n \t? expect\n \tEOF\n@@ -145,7 +145,7 @@ test_expect_success 'rename causes 2 path lines' '\n \t# branch.oid $H0\n \t# branch.head master\n \t1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x\n-\t1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z\n+\t1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z\n \t2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y\n \t? actual\n \t? expect\n@@ -163,7 +163,7 @@ test_expect_success 'rename causes 2 path lines (-z)' '\n \t# branch.oid $H0\n \t# branch.head master\n \t1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x\n-\t1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z\n+\t1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z\n \t2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y\n \t? actual\n \t? expect\n@@ -246,8 +246,8 @@ test_expect_success 'verify --intent-to-add output' '\n \tgit add --intent-to-add intent1.add intent2.add &&\n \n \tcat >expect <<-EOF &&\n-\t1 .A N... 000000 000000 100644 $_z40 $_z40 intent1.add\n-\t1 .A N... 000000 000000 100644 $_z40 $_z40 intent2.add\n+\t1 .A N... 000000 000000 100644 $ZERO_OID $ZERO_OID intent1.add\n+\t1 .A N... 000000 000000 100644 $ZERO_OID $ZERO_OID intent2.add\n \tEOF\n \n \tgit status --porcelain=v2 >actual &&\n@@ -280,7 +280,7 @@ test_expect_success 'verify AA (add-add) conflict' '\n \tcat >expect <<-EOF &&\n \t# branch.oid $HM\n \t# branch.head AA_M\n-\tu AA N... 000000 100644 100644 100644 $_z40 $OID_AA_B $OID_AA_A conflict.txt\n+\tu AA N... 000000 100644 100644 100644 $ZERO_OID $OID_AA_B $OID_AA_A conflict.txt\n \tEOF\n \n \tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n@@ -373,7 +373,7 @@ test_expect_success 'verify upstream fields in branch header' '\n \t\t## Test upstream-gone case. Fake this by pointing origin/master at\n \t\t## a non-existing commit.\n \t\tOLD=$(git rev-parse origin/master) &&\n-\t\tNEW=$_z40 &&\n+\t\tNEW=$ZERO_OID &&\n \t\tmv .git/packed-refs .git/old-packed-refs &&\n \t\tsed \"s/$OLD/$NEW/g\" <.git/old-packed-refs >.git/packed-refs &&\n \n@@ -469,8 +469,8 @@ test_expect_success 'create and add submodule, submodule appears clean (A. S...)\n \t\t# branch.head master\n \t\t# branch.upstream origin/master\n \t\t# branch.ab +0 -0\n-\t\t1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules\n-\t\t1 A. S... 000000 160000 160000 $_z40 $HSUB sub1\n+\t\t1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules\n+\t\t1 A. S... 000000 160000 160000 $ZERO_OID $HSUB sub1\n \t\tEOF\n \n \t\tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n@@ -494,8 +494,8 @@ test_expect_success 'untracked changes in added submodule (AM S..U)' '\n \t\t# branch.head master\n \t\t# branch.upstream origin/master\n \t\t# branch.ab +0 -0\n-\t\t1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules\n-\t\t1 AM S..U 000000 160000 160000 $_z40 $HSUB sub1\n+\t\t1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules\n+\t\t1 AM S..U 000000 160000 160000 $ZERO_OID $HSUB sub1\n \t\tEOF\n \n \t\tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n@@ -519,8 +519,8 @@ test_expect_success 'staged changes in added submodule (AM S.M.)' '\n \t\t# branch.head master\n \t\t# branch.upstream origin/master\n \t\t# branch.ab +0 -0\n-\t\t1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules\n-\t\t1 AM S.M. 000000 160000 160000 $_z40 $HSUB sub1\n+\t\t1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules\n+\t\t1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1\n \t\tEOF\n \n \t\tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n@@ -546,8 +546,8 @@ test_expect_success 'staged and unstaged changes in added (AM S.M.)' '\n \t\t# branch.head master\n \t\t# branch.upstream origin/master\n \t\t# branch.ab +0 -0\n-\t\t1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules\n-\t\t1 AM S.M. 000000 160000 160000 $_z40 $HSUB sub1\n+\t\t1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules\n+\t\t1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1\n \t\tEOF\n \n \t\tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n@@ -573,8 +573,8 @@ test_expect_success 'staged and untracked changes in added submodule (AM S.MU)'\n \t\t# branch.head master\n \t\t# branch.upstream origin/master\n \t\t# branch.ab +0 -0\n-\t\t1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules\n-\t\t1 AM S.MU 000000 160000 160000 $_z40 $HSUB sub1\n+\t\t1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules\n+\t\t1 AM S.MU 000000 160000 160000 $ZERO_OID $HSUB sub1\n \t\tEOF\n \n \t\tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n@@ -600,8 +600,8 @@ test_expect_success 'commit within the submodule appears as new commit in super\n \t\t# branch.head master\n \t\t# branch.upstream origin/master\n \t\t# branch.ab +0 -0\n-\t\t1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules\n-\t\t1 AM SC.. 000000 160000 160000 $_z40 $HSUB sub1\n+\t\t1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules\n+\t\t1 AM SC.. 000000 160000 160000 $ZERO_OID $HSUB sub1\n \t\tEOF\n \n \t\tgit status --porcelain=v2 --branch --untracked-files=all >actual &&\n"},{"id":"347487","messageId":"20180513022438.60003-5-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 04/28] t/test-lib: introduce OID_REGEX","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:14Z","receivedAt":"2018-05-13T02:25:17Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Currently we have a variable, $_x40, which contains a regex that matches\na full 40-character hex constant.  However, with NewHash, we'll have\nobject IDs that are longer than 40 characters.  In such a case, $_x40\nwill be a confusing name.  Create a $OID_REGEX variable which will\nalways reflect a regex matching the appropriate object ID, regardless of\nthe length of the current hash.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/test-lib.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 58c2ea52c6..fed21c3dfc 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -184,6 +184,7 @@ _x40=\"$_x35$_x05\"\n # Zero SHA-1\n _z40=0000000000000000000000000000000000000000\n \n+OID_REGEX=\"$_x40\"\n ZERO_OID=$_z40\n EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n@@ -196,7 +197,7 @@ LF='\n # when case-folding filenames\n u200c=$(printf '\\342\\200\\214')\n \n-export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID\n+export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX\n \n # Each test should start with something like this, after copyright notices:\n #\n"},{"id":"347488","messageId":"20180513022438.60003-6-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 05/28] t: switch $_x40 to $OID_REGEX","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:15Z","receivedAt":"2018-05-13T02:25:27Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Switch all uses of $_x40 to $OID_REGEX so that they work correctly with\nlarger hashes.  This commit was created by using the following sed\ncommand to modify all files in the t directory except t/test-lib.sh:\n\n  sed -i 's/\\$_x40/$OID_REGEX/g'\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/diff-lib.sh                   |  4 ++--\n t/t0090-cache-tree.sh           |  2 +-\n t/t1000-read-tree-m-3way.sh     |  2 +-\n t/t1001-read-tree-m-2way.sh     |  2 +-\n t/t1002-read-tree-m-u-2way.sh   |  2 +-\n t/t1012-read-tree-df.sh         |  2 +-\n t/t3100-ls-tree-restrict.sh     |  2 +-\n t/t3101-ls-tree-dirname.sh      |  2 +-\n t/t3510-cherry-pick-sequence.sh |  8 ++++----\n t/t4002-diff-basic.sh           |  2 +-\n t/t4006-diff-mode.sh            |  2 +-\n t/t4014-format-patch.sh         |  2 +-\n t/t4201-shortlog.sh             |  2 +-\n t/t5150-request-pull.sh         |  2 +-\n t/t6006-rev-list-format.sh      |  4 ++--\n t/t6012-rev-list-simplify.sh    |  2 +-\n t/t6111-rev-list-treesame.sh    |  2 +-\n t/t7506-status-submodule.sh     |  2 +-\n t/t9010-svn-fe.sh               | 14 +++++++-------\n t/t9300-fast-import.sh          |  6 +++---\n 20 files changed, 33 insertions(+), 33 deletions(-)\n\ndiff --git a/t/diff-lib.sh b/t/diff-lib.sh\nindex c211dc40ee..2de880f7a5 100644\n--- a/t/diff-lib.sh\n+++ b/t/diff-lib.sh\n@@ -1,6 +1,6 @@\n :\n \n-sanitize_diff_raw='/^:/s/ '\"\\($_x40\\)\"' '\"\\($_x40\\)\"' \\([A-Z]\\)[0-9]*\t/ \\1 \\2 \\3#\t/'\n+sanitize_diff_raw='/^:/s/ '\"\\($OID_REGEX\\)\"' '\"\\($OID_REGEX\\)\"' \\([A-Z]\\)[0-9]*\t/ \\1 \\2 \\3#\t/'\n compare_diff_raw () {\n     # When heuristics are improved, the score numbers would change.\n     # Ignore them while comparing.\n@@ -12,7 +12,7 @@ compare_diff_raw () {\n     test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2\n }\n \n-sanitize_diff_raw_z='/^:/s/ '\"$_x40\"' '\"$_x40\"' \\([A-Z]\\)[0-9]*$/ X X \\1#/'\n+sanitize_diff_raw_z='/^:/s/ '\"$OID_REGEX\"' '\"$OID_REGEX\"' \\([A-Z]\\)[0-9]*$/ X X \\1#/'\n compare_diff_raw_z () {\n     # When heuristics are improved, the score numbers would change.\n     # Ignore them while comparing.\ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex 4ae0995cd9..0c61268fd2 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -9,7 +9,7 @@ cache-tree extension.\n \n cmp_cache_tree () {\n \ttest-tool dump-cache-tree | sed -e '/#(ref)/d' >actual &&\n-\tsed \"s/$_x40/SHA/\" <actual >filtered &&\n+\tsed \"s/$OID_REGEX/SHA/\" <actual >filtered &&\n \ttest_cmp \"$1\" filtered\n }\n \ndiff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh\nindex 3c4d2d6045..013c5a7bc3 100755\n--- a/t/t1000-read-tree-m-3way.sh\n+++ b/t/t1000-read-tree-m-3way.sh\n@@ -128,7 +128,7 @@ cat >expected <<\\EOF\n EOF\n \n check_result () {\n-\tgit ls-files --stage | sed -e 's/ '\"$_x40\"' / X /' >current &&\n+\tgit ls-files --stage | sed -e 's/ '\"$OID_REGEX\"' / X /' >current &&\n \ttest_cmp expected current\n }\n \ndiff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh\nindex 5ededd8e40..1057a96b24 100755\n--- a/t/t1001-read-tree-m-2way.sh\n+++ b/t/t1001-read-tree-m-2way.sh\n@@ -30,7 +30,7 @@ read_tree_twoway () {\n compare_change () {\n \tsed -n >current \\\n \t    -e '/^--- /d; /^+++ /d; /^@@ /d;' \\\n-\t    -e 's/^\\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$_x40\"' /\\1 X /p' \\\n+\t    -e 's/^\\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$OID_REGEX\"' /\\1 X /p' \\\n \t    \"$1\"\n \ttest_cmp expected current\n }\ndiff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh\nindex 7ca2e65d10..9c05f5e1f5 100755\n--- a/t/t1002-read-tree-m-u-2way.sh\n+++ b/t/t1002-read-tree-m-u-2way.sh\n@@ -16,7 +16,7 @@ compare_change () {\n \t    -e '1{/^diff --git /d;}' \\\n \t    -e '2{/^index /d;}' \\\n \t    -e '/^--- /d; /^+++ /d; /^@@ /d;' \\\n-\t    -e 's/^\\(.[0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$_x40\"' /\\1 X /' \"$1\"\n+\t    -e 's/^\\(.[0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$OID_REGEX\"' /\\1 X /' \"$1\"\n \ttest_cmp expected current\n }\n \ndiff --git a/t/t1012-read-tree-df.sh b/t/t1012-read-tree-df.sh\nindex a6a04b6b90..57f0770df1 100755\n--- a/t/t1012-read-tree-df.sh\n+++ b/t/t1012-read-tree-df.sh\n@@ -32,7 +32,7 @@ settree () {\n \n checkindex () {\n \tgit ls-files -s |\n-\tsed \"s|^[0-7][0-7]* $_x40 \\([0-3]\\)\t|\\1 |\" >current &&\n+\tsed \"s|^[0-7][0-7]* $OID_REGEX \\([0-3]\\)\t|\\1 |\" >current &&\n \tcat >expect &&\n \ttest_cmp expect current\n }\ndiff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh\nindex 325114f8fe..18baf49a49 100755\n--- a/t/t3100-ls-tree-restrict.sh\n+++ b/t/t3100-ls-tree-restrict.sh\n@@ -32,7 +32,7 @@ test_expect_success \\\n      echo $tree'\n \n test_output () {\n-    sed -e \"s/ $_x40\t/ X\t/\" <current >check\n+    sed -e \"s/ $OID_REGEX\t/ X\t/\" <current >check\n     test_cmp expected check\n }\n \ndiff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh\nindex 327ded4000..12bf31022a 100755\n--- a/t/t3101-ls-tree-dirname.sh\n+++ b/t/t3101-ls-tree-dirname.sh\n@@ -40,7 +40,7 @@ test_expect_success 'setup' '\n '\n \n test_output () {\n-\tsed -e \"s/ $_x40\t/ X\t/\" <current >check &&\n+\tsed -e \"s/ $OID_REGEX\t/ X\t/\" <current >check &&\n \ttest_cmp expected check\n }\n \ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 21b4f194a2..b42cd66d3a 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -122,7 +122,7 @@ test_expect_success '--quit keeps HEAD and conflicted index intact' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \ttest_cmp expect actual\n '\n@@ -220,7 +220,7 @@ test_expect_success 'cherry-pick still writes sequencer state when one commit is\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\n@@ -317,7 +317,7 @@ test_expect_success '--continue after resolving conflicts' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual.log &&\n \ttest_cmp expect foo &&\n \ttest_cmp expect.log actual.log\n@@ -334,7 +334,7 @@ test_expect_success '--continue after resolving conflicts and committing' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex 5af773d6f7..3a6c21e825 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -131,7 +131,7 @@ cmp_diff_files_output () {\n     # object ID for the changed files because it wants you to look at the\n     # filesystem.\n     sed <\"$2\" >.test-tmp \\\n-\t-e '/^:000000 /d;s/'$_x40'\\( [MCRNDU][0-9]*\\)\t/'$ZERO_OID'\\1\t/' &&\n+\t-e '/^:000000 /d;s/'$OID_REGEX'\\( [MCRNDU][0-9]*\\)\t/'$ZERO_OID'\\1\t/' &&\n     test_cmp \"$1\" .test-tmp\n }\n \ndiff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh\nindex 76f643b2c2..a8e01eccd1 100755\n--- a/t/t4006-diff-mode.sh\n+++ b/t/t4006-diff-mode.sh\n@@ -8,7 +8,7 @@ test_description='Test mode change diffs.\n '\n . ./test-lib.sh\n \n-sed_script='s/\\(:100644 100755\\) \\('\"$_x40\"'\\) \\2 /\\1 X X /'\n+sed_script='s/\\(:100644 100755\\) \\('\"$OID_REGEX\"'\\) \\2 /\\1 X X /'\n \n test_expect_success 'setup' '\n \techo frotz >rezrov &&\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 0dbf7d5b4b..dac3f349a3 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -1530,7 +1530,7 @@ test_expect_success 'format-patch --zero-commit' '\n test_expect_success 'From line has expected format' '\n \tgit format-patch --stdout v2..v1 >patch2 &&\n \tgrep \"^From \" patch2 >from &&\n-\tgrep \"^From $_x40 Mon Sep 17 00:00:00 2001$\" patch2 >filtered &&\n+\tgrep \"^From $OID_REGEX Mon Sep 17 00:00:00 2001$\" patch2 >filtered &&\n \ttest_cmp from filtered\n '\n \ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex ff6649ed9a..58c2773676 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -59,7 +59,7 @@ test_expect_success 'setup' '\n fuzz() {\n \tfile=$1 &&\n \tsed \"\n-\t\t\ts/$_x40/OBJECT_NAME/g\n+\t\t\ts/$OID_REGEX/OBJECT_NAME/g\n \t\t\ts/$_x35/OBJID/g\n \t\t\ts/^ \\{6\\}[CTa].*/      SUBJECT/g\n \t\t\ts/^ \\{8\\}[^ ].*/        CONTINUATION/g\ndiff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh\nindex 08c210f035..fca001eb9b 100755\n--- a/t/t5150-request-pull.sh\n+++ b/t/t5150-request-pull.sh\n@@ -81,7 +81,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '\n \tcat <<-EOT >fuzz.sed\n \t#!/bin/sed -nf\n \ts/$downstream_url_for_sed/URL/g\n-\ts/$_x40/OBJECT_NAME/g\n+\ts/$OID_REGEX/OBJECT_NAME/g\n \ts/A U Thor/AUTHOR/g\n \ts/[-0-9]\\{10\\} [:0-9]\\{8\\} [-+][0-9]\\{4\\}/DATE/g\n \ts/        [^ ].*/        SUBJECT/g\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex 98be78b4a2..ec42c2f779 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -447,8 +447,8 @@ test_expect_success '--abbrev' '\n \tgit log -1 --format=\"%h %h %h\" HEAD >actual1 &&\n \tgit log -1 --abbrev=5 --format=\"%h %h %h\" HEAD >actual2 &&\n \tgit log -1 --abbrev=5 --format=\"%H %H %H\" HEAD >actual3 &&\n-\tsed -e \"s/$_x40/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual2 >fuzzy2 &&\n-\tsed -e \"s/$_x40/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual3 >fuzzy3 &&\n+\tsed -e \"s/$OID_REGEX/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual2 >fuzzy2 &&\n+\tsed -e \"s/$OID_REGEX/LONG/g\" -e \"s/$_x05/SHORT/g\" <actual3 >fuzzy3 &&\n \ttest_cmp expect2 fuzzy2 &&\n \ttest_cmp expect3 fuzzy3 &&\n \t! test_cmp actual1 actual2\ndiff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh\nindex 2a0fbb87b1..b5a1190ffe 100755\n--- a/t/t6012-rev-list-simplify.sh\n+++ b/t/t6012-rev-list-simplify.sh\n@@ -9,7 +9,7 @@ note () {\n }\n \n unnote () {\n-\tgit name-rev --tags --stdin | sed -e \"s|$_x40 (tags/\\([^)]*\\)) |\\1 |g\"\n+\tgit name-rev --tags --stdin | sed -e \"s|$OID_REGEX (tags/\\([^)]*\\)) |\\1 |g\"\n }\n \n test_expect_success setup '\ndiff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh\nindex 32474c23d3..4244638285 100755\n--- a/t/t6111-rev-list-treesame.sh\n+++ b/t/t6111-rev-list-treesame.sh\n@@ -20,7 +20,7 @@ note () {\n }\n \n unnote () {\n-\tgit name-rev --tags --stdin | sed -e \"s|$_x40 (tags/\\([^)]*\\))\\([ \t]\\)|\\1\\2|g\"\n+\tgit name-rev --tags --stdin | sed -e \"s|$OID_REGEX (tags/\\([^)]*\\))\\([ \t]\\)|\\1\\2|g\"\n }\n \n test_expect_success setup '\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 9edf6572ed..b4b74dbe29 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -18,7 +18,7 @@ test_create_repo_with_commit () {\n }\n \n sanitize_output () {\n-\tsed -e \"s/$_x40/HASH/\" -e \"s/$_x40/HASH/\" output >output2 &&\n+\tsed -e \"s/$OID_REGEX/HASH/\" -e \"s/$OID_REGEX/HASH/\" output >output2 &&\n \tmv output2 output\n }\n \ndiff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh\nindex 8eaaca6f99..0b20b07e68 100755\n--- a/t/t9010-svn-fe.sh\n+++ b/t/t9010-svn-fe.sh\n@@ -473,7 +473,7 @@ test_expect_failure 'change file mode but keep old content' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \tgit show HEAD:greeting >actual.blob &&\n \tgit show HEAD^:greeting >actual.target &&\n@@ -573,7 +573,7 @@ test_expect_success 'NUL in log message, file content, and property name' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \t{\n \t\tgit cat-file commit HEAD | nul_to_q &&\n@@ -659,7 +659,7 @@ test_expect_success 'change file mode and reiterate content' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \tgit show HEAD:greeting >actual.blob &&\n \tgit show HEAD^:greeting >actual.target &&\n@@ -792,7 +792,7 @@ test_expect_success 'property deltas supported' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \ttest_cmp expect actual\n '\n@@ -846,7 +846,7 @@ test_expect_success 'properties on /' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --always --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \ttest_cmp expect actual\n '\n@@ -931,7 +931,7 @@ test_expect_success 'deltas for typechange' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \ttest_cmp expect actual\n '\n@@ -1030,7 +1030,7 @@ test_expect_success 'deltas need not consume the whole preimage' '\n \t{\n \t\tgit rev-list HEAD |\n \t\tgit diff-tree --root --stdin |\n-\t\tsed \"s/$_x40/OBJID/g\"\n+\t\tsed \"s/$OID_REGEX/OBJID/g\"\n \t} >actual &&\n \ttest_cmp expect actual &&\n \tgit show HEAD:postimage >actual.3 &&\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex dc79df7b04..9e7f96223d 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -1185,7 +1185,7 @@ test_expect_success PIPE 'N: empty directory reads as missing' '\n \ttest_cmp expect.response response &&\n \tgit rev-list read-empty |\n \tgit diff-tree -r --root --stdin |\n-\tsed \"s/$_x40/OBJNAME/g\" >actual &&\n+\tsed \"s/$OID_REGEX/OBJNAME/g\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1271,7 +1271,7 @@ test_expect_success 'N: delete directory by copying' '\n \tgit fast-import <input &&\n \tgit rev-list N-delete |\n \t\tgit diff-tree -r --stdin --root --always |\n-\t\tsed -e \"s/$_x40/OBJID/g\" >actual &&\n+\t\tsed -e \"s/$OID_REGEX/OBJID/g\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -2602,7 +2602,7 @@ test_expect_success 'R: terminating \"done\" within commit' '\n \tEOF\n \tgit rev-list done-ends |\n \tgit diff-tree -r --stdin --root --always |\n-\tsed -e \"s/$_x40/OBJID/g\" >actual &&\n+\tsed -e \"s/$OID_REGEX/OBJID/g\" >actual &&\n \ttest_cmp expect actual\n '\n \n"},{"id":"347489","messageId":"20180513022438.60003-7-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 06/28] t0000: annotate with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:16Z","receivedAt":"2018-05-13T02:25:29Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Since this is a core test that tests basic functionality, annotate the\nassertions that have dependencies on SHA-1 with the appropriate\nprerequisite.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t0000-basic.sh | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 7fd87dd544..af61d083b4 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -839,7 +839,7 @@ test_expect_success 'writing tree out with git write-tree' '\n '\n \n # we know the shape and contents of the tree and know the object ID for it.\n-test_expect_success 'validate object ID of a known tree' '\n+test_expect_success SHA1 'validate object ID of a known tree' '\n \ttest \"$tree\" = 7bb943559a305bdd6bdee2cef6e5df2413c3d30a\n     '\n \n@@ -882,7 +882,7 @@ test_expect_success 'showing stage with git ls-files --stage' '\n \tgit ls-files --stage >current\n '\n \n-test_expect_success 'validate git ls-files output for a known tree' '\n+test_expect_success SHA1 'validate git ls-files output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 f87290f8eb2cbbea7857214459a0739927eab154 0\tpath0\n \t120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0\tpath0sym\n@@ -900,7 +900,7 @@ test_expect_success 'writing tree out with git write-tree' '\n \ttree=$(git write-tree)\n '\n \n-test_expect_success 'validate object ID for a known tree' '\n+test_expect_success SHA1 'validate object ID for a known tree' '\n \ttest \"$tree\" = 087704a96baf1c2d1c869a8b084481e121c88b5b\n '\n \n@@ -908,7 +908,7 @@ test_expect_success 'showing tree with git ls-tree' '\n     git ls-tree $tree >current\n '\n \n-test_expect_success 'git ls-tree output for a known tree' '\n+test_expect_success SHA1 'git ls-tree output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -924,7 +924,7 @@ test_expect_success 'showing tree with git ls-tree -r' '\n \tgit ls-tree -r $tree >current\n '\n \n-test_expect_success 'git ls-tree -r output for a known tree' '\n+test_expect_success SHA1 'git ls-tree -r output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -943,7 +943,7 @@ test_expect_success 'showing tree with git ls-tree -r -t' '\n \tgit ls-tree -r -t $tree >current\n '\n \n-test_expect_success 'git ls-tree -r output for a known tree' '\n+test_expect_success SHA1 'git ls-tree -r output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -964,7 +964,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '\n \tptree=$(git write-tree --prefix=path3)\n '\n \n-test_expect_success 'validate object ID for a known tree' '\n+test_expect_success SHA1 'validate object ID for a known tree' '\n \ttest \"$ptree\" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3\n '\n \n@@ -972,7 +972,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '\n \tptree=$(git write-tree --prefix=path3/subp3)\n '\n \n-test_expect_success 'validate object ID for a known tree' '\n+test_expect_success SHA1 'validate object ID for a known tree' '\n \ttest \"$ptree\" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2\n '\n \n@@ -1006,7 +1006,7 @@ test_expect_success 'git read-tree followed by write-tree should be idempotent'\n \ttest \"$newtree\" = \"$tree\"\n '\n \n-test_expect_success 'validate git diff-files output for a know cache/work tree state' '\n+test_expect_success SHA1 'validate git diff-files output for a know cache/work tree state' '\n \tcat >expected <<\\EOF &&\n :100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M\tpath0\n :120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M\tpath0sym\n@@ -1033,21 +1033,21 @@ test_expect_success 'no diff after checkout and git update-index --refresh' '\n ################################################################\n P=087704a96baf1c2d1c869a8b084481e121c88b5b\n \n-test_expect_success 'git commit-tree records the correct tree in a commit' '\n+test_expect_success SHA1 'git commit-tree records the correct tree in a commit' '\n \tcommit0=$(echo NO | git commit-tree $P) &&\n \ttree=$(git show --pretty=raw $commit0 |\n \t\t sed -n -e \"s/^tree //p\" -e \"/^author /q\") &&\n \ttest \"z$tree\" = \"z$P\"\n '\n \n-test_expect_success 'git commit-tree records the correct parent in a commit' '\n+test_expect_success SHA1 'git commit-tree records the correct parent in a commit' '\n \tcommit1=$(echo NO | git commit-tree $P -p $commit0) &&\n \tparent=$(git show --pretty=raw $commit1 |\n \t\tsed -n -e \"s/^parent //p\" -e \"/^author /q\") &&\n \ttest \"z$commit0\" = \"z$parent\"\n '\n \n-test_expect_success 'git commit-tree omits duplicated parent in a commit' '\n+test_expect_success SHA1 'git commit-tree omits duplicated parent in a commit' '\n \tcommit2=$(echo NO | git commit-tree $P -p $commit0 -p $commit0) &&\n \t     parent=$(git show --pretty=raw $commit2 |\n \t\tsed -n -e \"s/^parent //p\" -e \"/^author /q\" |\n"},{"id":"347490","messageId":"20180513022438.60003-8-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 07/28] t1007: annotate with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:17Z","receivedAt":"2018-05-13T02:25:30Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Since this is a core test that tests basic functionality, annotate the\nassertions that have dependencies on SHA-1 with the appropriate\nprerequisite.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t1007-hash-object.sh | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh\nindex 532682f51c..a37753047e 100755\n--- a/t/t1007-hash-object.sh\n+++ b/t/t1007-hash-object.sh\n@@ -9,13 +9,13 @@ echo_without_newline() {\n }\n \n test_blob_does_not_exist() {\n-\ttest_expect_success 'blob does not exist in database' \"\n+\ttest_expect_success SHA1 'blob does not exist in database' \"\n \t\ttest_must_fail git cat-file blob $1\n \t\"\n }\n \n test_blob_exists() {\n-\ttest_expect_success 'blob exists in database' \"\n+\ttest_expect_success SHA1 'blob exists in database' \"\n \t\tgit cat-file blob $1\n \t\"\n }\n@@ -73,19 +73,19 @@ test_expect_success \"Can't use --path with --no-filters\" '\n \n push_repo\n \n-test_expect_success 'hash a file' '\n+test_expect_success SHA1 'hash a file' '\n \ttest $hello_sha1 = $(git hash-object hello)\n '\n \n test_blob_does_not_exist $hello_sha1\n \n-test_expect_success 'hash from stdin' '\n+test_expect_success SHA1 'hash from stdin' '\n \ttest $example_sha1 = $(git hash-object --stdin < example)\n '\n \n test_blob_does_not_exist $example_sha1\n \n-test_expect_success 'hash a file and write to database' '\n+test_expect_success SHA1 'hash a file and write to database' '\n \ttest $hello_sha1 = $(git hash-object -w hello)\n '\n \n@@ -161,7 +161,7 @@ pop_repo\n for args in \"-w --stdin\" \"--stdin -w\"; do\n \tpush_repo\n \n-\ttest_expect_success \"hash from stdin and write to database ($args)\" '\n+\ttest_expect_success SHA1 \"hash from stdin and write to database ($args)\" '\n \t\ttest $example_sha1 = $(git hash-object $args < example)\n \t'\n \n@@ -176,14 +176,14 @@ example\"\n sha1s=\"$hello_sha1\n $example_sha1\"\n \n-test_expect_success \"hash two files with names on stdin\" '\n+test_expect_success SHA1 \"hash two files with names on stdin\" '\n \ttest \"$sha1s\" = \"$(echo_without_newline \"$filenames\" | git hash-object --stdin-paths)\"\n '\n \n for args in \"-w --stdin-paths\" \"--stdin-paths -w\"; do\n \tpush_repo\n \n-\ttest_expect_success \"hash two files with names on stdin and write to database ($args)\" '\n+\ttest_expect_success SHA1 \"hash two files with names on stdin and write to database ($args)\" '\n \t\ttest \"$sha1s\" = \"$(echo_without_newline \"$filenames\" | git hash-object $args)\"\n \t'\n \n"},{"id":"347491","messageId":"20180513022438.60003-10-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 09/28] t4044: skip test if not using SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:19Z","receivedAt":"2018-05-13T02:25:33Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test relies on objects with colliding short names which are\nnecessarily dependent on the hash used.  Skip the test if we're not\nusing SHA-1.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4044-diff-index-unique-abbrev.sh | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/t/t4044-diff-index-unique-abbrev.sh b/t/t4044-diff-index-unique-abbrev.sh\nindex d5ce72be63..647905e01f 100755\n--- a/t/t4044-diff-index-unique-abbrev.sh\n+++ b/t/t4044-diff-index-unique-abbrev.sh\n@@ -3,6 +3,12 @@\n test_description='test unique sha1 abbreviation on \"index from..to\" line'\n . ./test-lib.sh\n \n+if ! test_have_prereq SHA1\n+then\n+       skip_all='not using SHA-1 for objects'\n+       test_done\n+fi\n+\n cat >expect_initial <<EOF\n 100644 blob 51d2738463ea4ca66f8691c91e33ce64b7d41bb1\tfoo\n EOF\n"},{"id":"347492","messageId":"20180513022438.60003-12-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 11/28] t2203: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:21Z","receivedAt":"2018-05-13T02:25:35Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t2203-add-intent.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex 1797f946b9..04d840a544 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -27,8 +27,8 @@ test_expect_success 'git status' '\n \n test_expect_success 'git status with porcelain v2' '\n \tgit status --porcelain=v2 | grep -v \"^?\" >actual &&\n-\tnam1=d00491fd7e5bb6fa28c517a0bb32b8b506539d4d &&\n-\tnam2=ce013625030ba8dba906f756967f9e9ca394464a &&\n+\tnam1=$(echo 1 | git hash-object --stdin) &&\n+\tnam2=$(git hash-object elif) &&\n \tcat >expect <<-EOF &&\n \t1 DA N... 100644 000000 100644 $nam1 $ZERO_OID 1.t\n \t1 A. N... 000000 100644 100644 $ZERO_OID $nam2 elif\n@@ -181,7 +181,7 @@ test_expect_success 'rename detection finds the right names' '\n \t\tEOF\n \t\ttest_cmp expected.2 actual.2 &&\n \n-\t\thash=12f00e90b6ef79117ce6e650416b8cf517099b78 &&\n+\t\thash=$(git hash-object third) &&\n \t\tgit status --porcelain=v2 | grep -v \"^?\" >actual.3 &&\n \t\tcat >expected.3 <<-EOF &&\n \t\t2 .R N... 100644 100644 100644 $hash $hash R100 third\tfirst\n@@ -212,7 +212,7 @@ test_expect_success 'double rename detection in status' '\n \t\tEOF\n \t\ttest_cmp expected.2 actual.2 &&\n \n-\t\thash=12f00e90b6ef79117ce6e650416b8cf517099b78 &&\n+\t\thash=$(git hash-object third) &&\n \t\tgit status --porcelain=v2 | grep -v \"^?\" >actual.3 &&\n \t\tcat >expected.3 <<-EOF &&\n \t\t2 R. N... 100644 100644 100644 $hash $hash R100 second\tfirst\n"},{"id":"347493","messageId":"20180513022438.60003-11-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 10/28] t: skip pack tests if not using SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:20Z","receivedAt":"2018-05-13T02:25:39Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"These tests rely on creating packs with specially named objects which\nare necessarily dependent on the hash used.  Skip these tests if we're\nnot using SHA-1.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t5308-pack-detect-duplicates.sh | 6 ++++++\n t/t5309-pack-delta-cycles.sh      | 6 ++++++\n 2 files changed, 12 insertions(+)\n\ndiff --git a/t/t5308-pack-detect-duplicates.sh b/t/t5308-pack-detect-duplicates.sh\nindex 156ae9e9d3..6845c1f3c3 100755\n--- a/t/t5308-pack-detect-duplicates.sh\n+++ b/t/t5308-pack-detect-duplicates.sh\n@@ -4,6 +4,12 @@ test_description='handling of duplicate objects in incoming packfiles'\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-pack.sh\n \n+if ! test_have_prereq SHA1\n+then\n+       skip_all='not using SHA-1 for objects'\n+       test_done\n+fi\n+\n # The sha1s we have in our pack. It's important that these have the same\n # starting byte, so that they end up in the same fanout section of the index.\n # That lets us make sure we are exercising the binary search with both sets.\ndiff --git a/t/t5309-pack-delta-cycles.sh b/t/t5309-pack-delta-cycles.sh\nindex 3e7861b075..491556dad9 100755\n--- a/t/t5309-pack-delta-cycles.sh\n+++ b/t/t5309-pack-delta-cycles.sh\n@@ -4,6 +4,12 @@ test_description='test index-pack handling of delta cycles in packfiles'\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-pack.sh\n \n+if ! test_have_prereq SHA1\n+then\n+       skip_all='not using SHA-1 for objects'\n+       test_done\n+fi\n+\n # Two similar-ish objects that we have computed deltas between.\n A=01d7713666f4de822776c7622c10f1b07de280dc\n B=e68fe8129b546b101aee9510c5328e7f21ca1d18\n"},{"id":"347494","messageId":"20180513022438.60003-9-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 08/28] t1512: skip test if not using SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:18Z","receivedAt":"2018-05-13T02:25:43Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test relies on objects with colliding short names which are\nnecessarily dependent on the hash used.  Skip the test if we're not\nusing SHA-1.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t1512-rev-parse-disambiguation.sh | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh\nindex 711704ba5a..6537f30c9e 100755\n--- a/t/t1512-rev-parse-disambiguation.sh\n+++ b/t/t1512-rev-parse-disambiguation.sh\n@@ -22,6 +22,12 @@ one tagged as v1.0.0.  They all have one regular file each.\n \n . ./test-lib.sh\n \n+if ! test_have_prereq SHA1\n+then\n+\tskip_all='not using SHA-1 for objects'\n+\ttest_done\n+fi\n+\n test_expect_success 'blob and tree' '\n \ttest_tick &&\n \t(\n"},{"id":"347495","messageId":"20180513022438.60003-13-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 12/28] t3103: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:22Z","receivedAt":"2018-05-13T02:25:47Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it uses variables and command substitution for\ntrees instead of hard-coded hashes.  This also has the benefit of making\nit more obvious how the test works.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t3103-ls-tree-misc.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t3103-ls-tree-misc.sh b/t/t3103-ls-tree-misc.sh\nindex 09dcf043fd..14520913af 100755\n--- a/t/t3103-ls-tree-misc.sh\n+++ b/t/t3103-ls-tree-misc.sh\n@@ -17,7 +17,8 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '\n-\trm -f .git/objects/5f/cffbd6e4c5c5b8d81f5e9314b20e338e3ffff5 &&\n+\ttree=$(git rev-parse HEAD:a) &&\n+\trm -f .git/objects/$(echo $tree | sed -e \"s,^\\(..\\),\\1/,\") &&\n \ttest_must_fail git ls-tree -r HEAD\n '\n \n"},{"id":"347496","messageId":"20180513022438.60003-16-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 15/28] t4007: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:25Z","receivedAt":"2018-05-13T02:25:51Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs and uses the\nZERO_OID variable instead of using hard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4007-rename-3.sh | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\nindex dae327fabb..b187b7f6c6 100755\n--- a/t/t4007-rename-3.sh\n+++ b/t/t4007-rename-3.sh\n@@ -17,6 +17,7 @@ test_expect_success 'prepare reference tree' '\n \techo $tree\n '\n \n+blob=$(git hash-object \"$TEST_DIRECTORY/diff-lib/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@@ -26,8 +27,8 @@ test_expect_success 'prepare work tree' '\n # path1 both have COPYING and the latter is a copy of path0/COPYING.\n # Comparing the full tree with cache should tell us so.\n \n-cat >expected <<\\EOF\n-:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 C100\tpath0/COPYING\tpath1/COPYING\n+cat >expected <<EOF\n+:100644 100644 $blob $blob C100\tpath0/COPYING\tpath1/COPYING\n EOF\n \n test_expect_success 'copy detection' '\n@@ -46,8 +47,8 @@ test_expect_success 'copy detection, cached' '\n # path1/COPYING suddenly appearing from nowhere, not detected as\n # a copy from path0/COPYING.\n \n-cat >expected <<\\EOF\n-:000000 100644 0000000000000000000000000000000000000000 6ff87c4664981e4397625791c8ea3bbb5f2279a3 A\tpath1/COPYING\n+cat >expected <<EOF\n+:000000 100644 $ZERO_OID $blob A\tpath1/COPYING\n EOF\n \n test_expect_success 'copy, limited to a subtree' '\n@@ -64,8 +65,8 @@ test_expect_success 'tweak work tree' '\n # path0/COPYING.  Showing the full tree with cache should tell us about\n # the rename.\n \n-cat >expected <<\\EOF\n-:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 R100\tpath0/COPYING\tpath1/COPYING\n+cat >expected <<EOF\n+:100644 100644 $blob $blob R100\tpath0/COPYING\tpath1/COPYING\n EOF\n \n test_expect_success 'rename detection' '\n@@ -78,8 +79,8 @@ test_expect_success 'rename detection' '\n # path0/COPYING.  When we say we care only about path1, we should just\n # see path1/COPYING appearing from nowhere.\n \n-cat >expected <<\\EOF\n-:000000 100644 0000000000000000000000000000000000000000 6ff87c4664981e4397625791c8ea3bbb5f2279a3 A\tpath1/COPYING\n+cat >expected <<EOF\n+:000000 100644 $ZERO_OID $blob A\tpath1/COPYING\n EOF\n \n test_expect_success 'rename, limited to a subtree' '\n"},{"id":"347497","messageId":"20180513022438.60003-18-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 17/28] t4014: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:27Z","receivedAt":"2018-05-13T02:25:52Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes values for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4014-format-patch.sh | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex dac3f349a3..42b3e11207 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -578,7 +578,9 @@ test_expect_success 'excessive subject' '\n \n \trm -rf patches/ &&\n \tgit checkout side &&\n+\tbefore=$(git rev-parse --short $(git hash-object file)) &&\n \tfor i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo \"$i\"; done >>file &&\n+\tafter=$(git rev-parse --short $(git hash-object file)) &&\n \tgit update-index file &&\n \tgit commit -m \"This is an excessively long subject line for a message due to the habit some projects have of not having a short, one-line subject at the start of the commit message, but rather sticking a whole paragraph right at the start as the only thing in the commit message. It had better not become the filename for the patch.\" &&\n \tgit format-patch -o patches/ master..side &&\n@@ -586,7 +588,6 @@ test_expect_success 'excessive subject' '\n '\n \n test_expect_success 'cover-letter inherits diff options' '\n-\n \tgit mv file foo &&\n \tgit commit -m foo &&\n \tgit format-patch --no-renames --cover-letter -1 &&\n@@ -616,7 +617,7 @@ test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '\n '\n \n cat > expect << EOF\n-index 40f36c6..2dc5c23 100644\n+index $before..$after 100644\n --- a/file\n +++ b/file\n @@ -13,4 +13,20 @@ C\n@@ -640,7 +641,7 @@ test_expect_success 'format-patch respects -U' '\n cat > expect << EOF\n \n diff --git a/file b/file\n-index 40f36c6..2dc5c23 100644\n+index $before..$after 100644\n --- a/file\n +++ b/file\n @@ -14,3 +14,19 @@ C\n"},{"id":"347498","messageId":"20180513022438.60003-19-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 18/28] t4020: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:28Z","receivedAt":"2018-05-13T02:25:54Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4020-diff-external.sh | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\nindex 49d3f54b29..fd2140700e 100755\n--- a/t/t4020-diff-external.sh\n+++ b/t/t4020-diff-external.sh\n@@ -13,6 +13,7 @@ test_expect_success setup '\n \n \ttest_tick &&\n \techo second >file &&\n+\tbefore=$(git rev-parse --short $(git hash-object file)) &&\n \tgit add file &&\n \tgit commit -m second &&\n \n@@ -180,9 +181,12 @@ test_expect_success 'no diff with -diff' '\n echo NULZbetweenZwords | perl -pe 'y/Z/\\000/' > file\n \n test_expect_success 'force diff with \"diff\"' '\n+\tafter=$(git rev-parse --short $(git hash-object file)) &&\n \techo >.gitattributes \"file diff\" &&\n \tgit diff >actual &&\n-\ttest_cmp \"$TEST_DIRECTORY\"/t4020/diff.NUL actual\n+\tsed -e \"s/^index .*/index $before..$after 100644/\" \\\n+\t\t\"$TEST_DIRECTORY\"/t4020/diff.NUL >expected-diff &&\n+\ttest_cmp expected-diff actual\n '\n \n test_expect_success 'GIT_EXTERNAL_DIFF with more than one changed files' '\n@@ -237,7 +241,7 @@ test_expect_success 'diff --cached' '\n \tgit update-index --assume-unchanged file &&\n \techo second >file &&\n \tgit diff --cached >actual &&\n-\ttest_cmp \"$TEST_DIRECTORY\"/t4020/diff.NUL actual\n+\ttest_cmp expected-diff actual\n '\n \n test_expect_success 'clean up crlf leftovers' '\n"},{"id":"347499","messageId":"20180513022438.60003-22-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 21/28] t4029: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:31Z","receivedAt":"2018-05-13T02:25:57Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4029-diff-trailing-space.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t4029-diff-trailing-space.sh b/t/t4029-diff-trailing-space.sh\nindex f4e18cb8d3..eaa56521e8 100755\n--- a/t/t4029-diff-trailing-space.sh\n+++ b/t/t4029-diff-trailing-space.sh\n@@ -6,7 +6,7 @@ test_description='diff honors config option, diff.suppressBlankEmpty'\n \n . ./test-lib.sh\n \n-cat <<\\EOF > exp ||\n+cat <<\\EOF >expected ||\n diff --git a/f b/f\n index 5f6a263..8cb8bae 100644\n --- a/f\n@@ -20,9 +20,12 @@ exit 1\n \n test_expect_success \"$test_description\" '\n \tprintf \"\\nx\\n\" > f &&\n+\tbefore=$(git rev-parse --short $(git hash-object f)) &&\n \tgit add f &&\n \tgit commit -q -m. f &&\n \tprintf \"\\ny\\n\" > f &&\n+\tafter=$(git rev-parse --short $(git hash-object f)) &&\n+\tsed -e \"s/^index .*/index $before..$after 100644/\" expected >exp &&\n \tgit config --bool diff.suppressBlankEmpty true &&\n \tgit diff f > actual &&\n \ttest_cmp exp actual &&\n"},{"id":"347500","messageId":"20180513022438.60003-20-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 19/28] t4022: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:29Z","receivedAt":"2018-05-13T02:25:59Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4022-diff-rewrite.sh | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4022-diff-rewrite.sh b/t/t4022-diff-rewrite.sh\nindex cb51d9f9d4..0f1287a8ce 100755\n--- a/t/t4022-diff-rewrite.sh\n+++ b/t/t4022-diff-rewrite.sh\n@@ -13,6 +13,7 @@ test_expect_success setup '\n \t  \"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM\" \\\n \t  <\"$TEST_DIRECTORY\"/../COPYING >test &&\n \techo \"to be deleted\" >test2 &&\n+\tblob=$(git rev-parse --short $(git hash-object test2)) &&\n \tgit add test2\n \n '\n@@ -27,7 +28,7 @@ test_expect_success 'detect rewrite' '\n cat >expect <<EOF\n diff --git a/test2 b/test2\n deleted file mode 100644\n-index 4202011..0000000\n+index $blob..0000000\n --- a/test2\n +++ /dev/null\n @@ -1 +0,0 @@\n@@ -43,7 +44,7 @@ test_expect_success 'show deletion diff without -D' '\n cat >expect <<EOF\n diff --git a/test2 b/test2\n deleted file mode 100644\n-index 4202011..0000000\n+index $blob..0000000\n EOF\n test_expect_success 'suppress deletion diff with -D' '\n \n"},{"id":"347501","messageId":"20180513022438.60003-25-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 24/28] t4205: sort log output in a hash-independent way","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:34Z","receivedAt":"2018-05-13T02:26:01Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test enumerates log entries and then sorts them.  For SHA-1, this\nproduces results that happen to sort in the order specified in the test,\nbut for other hash algorithms they sort differently.  Ensure we sort the\nlog entries in a hash-independent way by sorting on the ref name instead\nof the object ID.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4205-log-pretty-formats.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex 591f35daaf..2052cadb11 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -516,22 +516,22 @@ test_expect_success 'log decoration properly follows tag chain' '\n \tgit commit --amend -m shorter &&\n \tgit log --no-walk --tags --pretty=\"%H %d\" --decorate=full >actual &&\n \tcat <<-EOF >expected &&\n-\t$head1  (tag: refs/tags/tag2)\n \t$head2  (tag: refs/tags/message-one)\n \t$old_head1  (tag: refs/tags/message-two)\n+\t$head1  (tag: refs/tags/tag2)\n \tEOF\n-\tsort actual >actual1 &&\n+\tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\n \n test_expect_success 'clean log decoration' '\n \tgit log --no-walk --tags --pretty=\"%H %D\" --decorate=full >actual &&\n \tcat >expected <<-EOF &&\n-\t$head1 tag: refs/tags/tag2\n \t$head2 tag: refs/tags/message-one\n \t$old_head1 tag: refs/tags/message-two\n+\t$head1 tag: refs/tags/tag2\n \tEOF\n-\tsort actual >actual1 &&\n+\tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\n \n"},{"id":"347502","messageId":"20180513022438.60003-27-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 26/28] t4045: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:36Z","receivedAt":"2018-05-13T02:26:02Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4045-diff-relative.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4045-diff-relative.sh b/t/t4045-diff-relative.sh\nindex 6471a68701..36f8ed8a81 100755\n--- a/t/t4045-diff-relative.sh\n+++ b/t/t4045-diff-relative.sh\n@@ -8,6 +8,7 @@ test_expect_success 'setup' '\n \techo content >file1 &&\n \tmkdir subdir &&\n \techo other content >subdir/file2 &&\n+\tblob=$(git hash-object subdir/file2) &&\n \tgit add . &&\n \tgit commit -m one\n '\n@@ -17,10 +18,11 @@ check_diff () {\n \tshift\n \texpect=$1\n \tshift\n+\tshort_blob=$(git rev-parse --short $blob)\n \tcat >expected <<-EOF\n \tdiff --git a/$expect b/$expect\n \tnew file mode 100644\n-\tindex 0000000..25c05ef\n+\tindex 0000000..$short_blob\n \t--- /dev/null\n \t+++ b/$expect\n \t@@ -0,0 +1 @@\n@@ -68,7 +70,7 @@ check_raw () {\n \texpect=$1\n \tshift\n \tcat >expected <<-EOF\n-\t:000000 100644 0000000000000000000000000000000000000000 25c05ef3639d2d270e7fe765a67668f098092bc5 A\t$expect\n+\t:000000 100644 0000000000000000000000000000000000000000 $blob A\t$expect\n \tEOF\n \ttest_expect_success \"--raw $*\" \"\n \t\tgit -C '$dir' diff --no-abbrev --raw $* HEAD^ >actual &&\n"},{"id":"347503","messageId":"20180513022438.60003-26-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 25/28] t4042: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:35Z","receivedAt":"2018-05-13T02:26:04Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4042-diff-textconv-caching.sh | 16 ++++++++++------\n 1 file changed, 10 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4042-diff-textconv-caching.sh b/t/t4042-diff-textconv-caching.sh\nindex 04a44d5c61..bf33aedf4b 100755\n--- a/t/t4042-diff-textconv-caching.sh\n+++ b/t/t4042-diff-textconv-caching.sh\n@@ -15,9 +15,13 @@ test_expect_success 'setup' '\n \techo bar content 1 >bar.bin &&\n \tgit add . &&\n \tgit commit -m one &&\n+\tfoo1=$(git rev-parse --short HEAD:foo.bin) &&\n+\tbar1=$(git rev-parse --short HEAD:bar.bin) &&\n \techo foo content 2 >foo.bin &&\n \techo bar content 2 >bar.bin &&\n \tgit commit -a -m two &&\n+\tfoo2=$(git rev-parse --short HEAD:foo.bin) &&\n+\tbar2=$(git rev-parse --short HEAD:bar.bin) &&\n \techo \"*.bin diff=magic\" >.gitattributes &&\n \tgit config diff.magic.textconv ./helper &&\n \tgit config diff.magic.cachetextconv true\n@@ -25,14 +29,14 @@ test_expect_success 'setup' '\n \n cat >expect <<EOF\n diff --git a/bar.bin b/bar.bin\n-index fcf9166..28283d5 100644\n+index $bar1..$bar2 100644\n --- a/bar.bin\n +++ b/bar.bin\n @@ -1 +1 @@\n -converted: bar content 1\n +converted: bar content 2\n diff --git a/foo.bin b/foo.bin\n-index d5b9fe3..1345db2 100644\n+index $foo1..$foo2 100644\n --- a/foo.bin\n +++ b/foo.bin\n @@ -1 +1 @@\n@@ -59,7 +63,7 @@ test_expect_success 'cached textconv does not run helper' '\n \n cat >expect <<EOF\n diff --git a/bar.bin b/bar.bin\n-index fcf9166..28283d5 100644\n+index $bar1..$bar2 100644\n --- a/bar.bin\n +++ b/bar.bin\n @@ -1,2 +1,2 @@\n@@ -67,7 +71,7 @@ index fcf9166..28283d5 100644\n -converted: bar content 1\n +converted: bar content 2\n diff --git a/foo.bin b/foo.bin\n-index d5b9fe3..1345db2 100644\n+index $foo1..$foo2 100644\n --- a/foo.bin\n +++ b/foo.bin\n @@ -1,2 +1,2 @@\n@@ -84,7 +88,7 @@ test_expect_success 'changing textconv invalidates cache' '\n \n cat >expect <<EOF\n diff --git a/bar.bin b/bar.bin\n-index fcf9166..28283d5 100644\n+index $bar1..$bar2 100644\n --- a/bar.bin\n +++ b/bar.bin\n @@ -1,2 +1,2 @@\n@@ -92,7 +96,7 @@ index fcf9166..28283d5 100644\n -converted: bar content 1\n +converted: bar content 2\n diff --git a/foo.bin b/foo.bin\n-index d5b9fe3..1345db2 100644\n+index $foo1..$foo2 100644\n --- a/foo.bin\n +++ b/foo.bin\n @@ -1 +1 @@\n"},{"id":"347504","messageId":"20180513022438.60003-29-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 28/28] t5300: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:38Z","receivedAt":"2018-05-13T02:26:07Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for object IDs instead of\nusing hard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t5300-pack-object.sh | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 65ff60f2ee..9e66637a19 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -466,9 +466,11 @@ test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'pack-objects --threads=N or pack.\n \n test_expect_success \\\n     'fake a SHA1 hash collision' \\\n-    'test -f\t.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&\n-     cp -f\t.git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \\\n-\t\t.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'\n+    'long_a=$(git hash-object a | sed -e \"s!^..!&/!\") &&\n+     long_b=$(git hash-object b | sed -e \"s!^..!&/!\") &&\n+     test -f\t.git/objects/$long_b &&\n+     cp -f\t.git/objects/$long_a \\\n+\t\t.git/objects/$long_b'\n \n test_expect_success \\\n     'make sure index-pack detects the SHA1 collision' \\\n"},{"id":"347505","messageId":"20180513022438.60003-28-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 27/28] t4208: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:37Z","receivedAt":"2018-05-13T02:26:11Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for object IDs instead of\nusing hard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4208-log-magic-pathspec.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh\nindex a1705f70cf..62f335b2d9 100755\n--- a/t/t4208-log-magic-pathspec.sh\n+++ b/t/t4208-log-magic-pathspec.sh\n@@ -45,8 +45,9 @@ test_expect_success 'git log -- :' '\n '\n \n test_expect_success 'git log HEAD -- :/' '\n+\tinitial=$(git rev-parse --short HEAD^) &&\n \tcat >expected <<-EOF &&\n-\t24b24cf initial\n+\t$initial initial\n \tEOF\n \t(cd sub && git log --oneline HEAD -- :/ >../actual) &&\n \ttest_cmp expected actual\n"},{"id":"347506","messageId":"20180513022438.60003-21-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 20/28] t4029: fix test indentation","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:30Z","receivedAt":"2018-05-13T02:26:15Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"We typically indent our tests with a single tab, partially so that we\ncan take advantage of indented heredocs.  Make this change and move the\nquote marks to be in the typical position for our tests.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4029-diff-trailing-space.sh | 33 ++++++++++++++++-----------------\n 1 file changed, 16 insertions(+), 17 deletions(-)\n\ndiff --git a/t/t4029-diff-trailing-space.sh b/t/t4029-diff-trailing-space.sh\nindex 3ccc237a8d..f4e18cb8d3 100755\n--- a/t/t4029-diff-trailing-space.sh\n+++ b/t/t4029-diff-trailing-space.sh\n@@ -18,22 +18,21 @@ index 5f6a263..8cb8bae 100644\n EOF\n exit 1\n \n-test_expect_success \\\n-    \"$test_description\" \\\n-    'printf \"\\nx\\n\" > f &&\n-     git add f &&\n-     git commit -q -m. f &&\n-     printf \"\\ny\\n\" > f &&\n-     git config --bool diff.suppressBlankEmpty true &&\n-     git diff f > actual &&\n-     test_cmp exp actual &&\n-     perl -i.bak -p -e \"s/^\\$/ /\" exp &&\n-     git config --bool diff.suppressBlankEmpty false &&\n-     git diff f > actual &&\n-     test_cmp exp actual &&\n-     git config --bool --unset diff.suppressBlankEmpty &&\n-     git diff f > actual &&\n-     test_cmp exp actual\n-     '\n+test_expect_success \"$test_description\" '\n+\tprintf \"\\nx\\n\" > f &&\n+\tgit add f &&\n+\tgit commit -q -m. f &&\n+\tprintf \"\\ny\\n\" > f &&\n+\tgit config --bool diff.suppressBlankEmpty true &&\n+\tgit diff f > actual &&\n+\ttest_cmp exp actual &&\n+\tperl -i.bak -p -e \"s/^\\$/ /\" exp &&\n+\tgit config --bool diff.suppressBlankEmpty false &&\n+\tgit diff f > actual &&\n+\ttest_cmp exp actual &&\n+\tgit config --bool --unset diff.suppressBlankEmpty &&\n+\tgit diff f > actual &&\n+\ttest_cmp exp actual\n+'\n \n test_done\n"},{"id":"347507","messageId":"20180513022438.60003-24-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 23/28] t/lib-diff-alternative: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:33Z","receivedAt":"2018-05-13T02:26:18Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test code so that it computes variables for blobs instead of\nusing hard-coded hashes.  This makes t4033 and t4050 (the patience and\nhistogram tests) pass.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/lib-diff-alternative.sh | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/t/lib-diff-alternative.sh b/t/lib-diff-alternative.sh\nindex 8b4dbf22d2..8d1e408bb5 100644\n--- a/t/lib-diff-alternative.sh\n+++ b/t/lib-diff-alternative.sh\n@@ -59,9 +59,11 @@ int main(int argc, char **argv)\n }\n EOF\n \n-\tcat >expect <<\\EOF\n+\tfile1=$(git rev-parse --short $(git hash-object file1))\n+\tfile2=$(git rev-parse --short $(git hash-object file2))\n+\tcat >expect <<EOF\n diff --git a/file1 b/file2\n-index 6faa5a3..e3af329 100644\n+index $file1..$file2 100644\n --- a/file1\n +++ b/file2\n @@ -1,26 +1,25 @@\n@@ -136,9 +138,11 @@ e\n f\n EOF\n \n-\tcat >expect <<\\EOF\n+\tuniq1=$(git rev-parse --short $(git hash-object uniq1))\n+\tuniq2=$(git rev-parse --short $(git hash-object uniq2))\n+\tcat >expect <<EOF\n diff --git a/uniq1 b/uniq2\n-index b414108..0fdf397 100644\n+index $uniq1..$uniq2 100644\n --- a/uniq1\n +++ b/uniq2\n @@ -1,6 +1,6 @@\n"},{"id":"347508","messageId":"20180513022438.60003-23-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 22/28] t4030: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:32Z","receivedAt":"2018-05-13T02:26:23Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4030-diff-textconv.sh | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex aad6c7f78d..4cb9f0e523 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -148,7 +148,8 @@ test_expect_success 'diffstat does not run textconv' '\n # restore working setup\n echo file diff=foo >.gitattributes\n \n-cat >expect.typechange <<'EOF'\n+symlink=$(git rev-parse --short $(printf frotz | git hash-object --stdin))\n+cat >expect.typechange <<EOF\n --- a/file\n +++ /dev/null\n @@ -1,2 +0,0 @@\n@@ -156,7 +157,7 @@ cat >expect.typechange <<'EOF'\n -1\n diff --git a/file b/file\n new file mode 120000\n-index 0000000..67be421\n+index 0000000..$symlink\n --- /dev/null\n +++ b/file\n @@ -0,0 +1 @@\n"},{"id":"347509","messageId":"20180513022438.60003-14-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 13/28] t3702: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:23Z","receivedAt":"2018-05-13T02:26:26Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Strip out the index lines in the diff before comparing them, as these\nwill differ between hash algorithms.  This leads to a smaller, simpler\nchange than editing the index line.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t3702-add-edit.sh | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex 3cb74ca296..1be5cd5756 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -40,7 +40,6 @@ test_expect_success 'setup' '\n \n cat > expected-patch << EOF\n diff --git a/file b/file\n-index b9834b5..9020acb 100644\n --- a/file\n +++ b/file\n @@ -1,11 +1,6 @@\n@@ -80,7 +79,6 @@ EOF\n \n cat > expected << EOF\n diff --git a/file b/file\n-index b9834b5..ef6e94c 100644\n --- a/file\n +++ b/file\n @@ -1,10 +1,12 @@\n@@ -100,7 +98,7 @@ EOF\n \n echo \"#!$SHELL_PATH\" >fake-editor.sh\n cat >> fake-editor.sh <<\\EOF\n-mv -f \"$1\" orig-patch &&\n+egrep -v '^index' \"$1\" >orig-patch &&\n mv -f patch \"$1\"\n EOF\n \n@@ -113,7 +111,8 @@ test_expect_success 'add -e' '\n \tgit add -e &&\n \ttest_cmp second-part file &&\n \ttest_cmp orig-patch expected-patch &&\n-\tgit diff --cached > out &&\n+\tgit diff --cached >actual &&\n+\tegrep -v \"^index \" actual >out &&\n \ttest_cmp out expected\n \n '\n"},{"id":"347510","messageId":"20180513022438.60003-17-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 16/28] t4008: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:26Z","receivedAt":"2018-05-13T02:26:28Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4008-diff-break-rewrite.sh | 59 +++++++++++++++++++----------------\n 1 file changed, 32 insertions(+), 27 deletions(-)\n\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex 9dd1bc5e16..b1ccd4102e 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -27,29 +27,32 @@ Further, with -B and -M together, these should turn into two renames.\n test_expect_success setup '\n \tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n \tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n+\tblob0_id=$(git hash-object file0) &&\n+\tblob1_id=$(git hash-object file1) &&\n \tgit update-index --add file0 file1 &&\n \tgit tag reference $(git write-tree)\n '\n \n test_expect_success 'change file1 with copy-edit of file0 and remove file0' '\n \tsed -e \"s/git/GIT/\" file0 >file1 &&\n+\tblob2_id=$(git hash-object file1) &&\n \trm -f file0 &&\n \tgit update-index --remove file0 file1\n '\n \n test_expect_success 'run diff with -B (#1)' '\n \tgit diff-index -B --cached reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D\tfile0\n-\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 000000 $blob0_id $ZERO_OID D\tfile0\n+\t:100644 100644 $blob1_id $blob2_id M100\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n \n test_expect_success 'run diff with -B and -M (#2)' '\n \tgit diff-index -B -M reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec R100\tfile0\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $blob0_id $blob2_id R100\tfile0\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n@@ -66,18 +69,18 @@ test_expect_success 'swap file0 and file1' '\n \n test_expect_success 'run diff with -B (#3)' '\n \tgit diff-index -B reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100\tfile0\n-\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $blob0_id $blob1_id M100\tfile0\n+\t:100644 100644 $blob1_id $blob0_id M100\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n \n test_expect_success 'run diff with -B and -M (#4)' '\n \tgit diff-index -B -M reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 R100\tfile1\tfile0\n-\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 R100\tfile0\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $blob1_id $blob1_id R100\tfile1\tfile0\n+\t:100644 100644 $blob0_id $blob0_id R100\tfile0\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n@@ -85,14 +88,15 @@ test_expect_success 'run diff with -B and -M (#4)' '\n test_expect_success 'make file0 into something completely different' '\n \trm -f file0 &&\n \ttest_ln_s_add frotz file0 &&\n+\tslink_id=$(printf frotz | git hash-object --stdin) &&\n \tgit update-index file1\n '\n \n test_expect_success 'run diff with -B (#5)' '\n \tgit diff-index -B reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T\tfile0\n-\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 120000 $blob0_id $slink_id T\tfile0\n+\t:100644 100644 $blob1_id $blob0_id M100\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n@@ -103,9 +107,9 @@ test_expect_success 'run diff with -B -M (#6)' '\n \t# file0 changed from regular to symlink.  file1 is the same as the preimage\n \t# of file0.  Because the change does not make file0 disappear, file1 is\n \t# denoted as a copy of file0\n-\tcat >expect <<-\\EOF &&\n-\t:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T\tfile0\n-\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 C\tfile0\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 120000 $blob0_id $slink_id T\tfile0\n+\t:100644 100644 $blob0_id $blob0_id C\tfile0\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n@@ -115,9 +119,9 @@ test_expect_success 'run diff with -M (#7)' '\n \n \t# This should not mistake file0 as the copy source of new file1\n \t# due to type differences.\n-\tcat >expect <<-\\EOF &&\n-\t:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T\tfile0\n-\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M\tfile1\n+\tcat >expect <<-EOF &&\n+\t:100644 120000 $blob0_id $slink_id T\tfile0\n+\t:100644 100644 $blob1_id $blob0_id M\tfile1\n \tEOF\n \tcompare_diff_raw expect current\n '\n@@ -128,25 +132,26 @@ test_expect_success 'file1 edited to look like file0 and file0 rename-edited to\n \tgit checkout-index -f -u -a &&\n \tsed -e \"s/git/GIT/\" file0 >file1 &&\n \tsed -e \"s/git/GET/\" file0 >file2 &&\n+\tblob3_id=$(git hash-object file2) &&\n \trm -f file0 &&\n \tgit update-index --add --remove file0 file1 file2\n '\n \n test_expect_success 'run diff with -B (#8)' '\n \tgit diff-index -B reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D\tfile0\n-\t:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100\tfile1\n-\t:000000 100644 0000000000000000000000000000000000000000 69a939f651686f56322566e2fd76715947a24162 A\tfile2\n+\tcat >expect <<-EOF &&\n+\t:100644 000000 $blob0_id $ZERO_OID D\tfile0\n+\t:100644 100644 $blob1_id $blob2_id M100\tfile1\n+\t:000000 100644 $ZERO_OID $blob3_id A\tfile2\n \tEOF\n \tcompare_diff_raw expect current\n '\n \n test_expect_success 'run diff with -B -C (#9)' '\n \tgit diff-index -B -C reference >current &&\n-\tcat >expect <<-\\EOF &&\n-\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec C095\tfile0\tfile1\n-\t:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 69a939f651686f56322566e2fd76715947a24162 R095\tfile0\tfile2\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $blob0_id $blob2_id C095\tfile0\tfile1\n+\t:100644 100644 $blob0_id $blob3_id R095\tfile0\tfile2\n \tEOF\n \tcompare_diff_raw expect current\n '\n"},{"id":"347511","messageId":"20180513022438.60003-15-sandals@crustytoothpaste.net","threadId":"48477","inReplyTo":"20180513022438.60003-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 14/28] t3905: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T02:24:24Z","receivedAt":"2018-05-13T02:26:30Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for blobs instead of using\nhard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t3905-stash-include-untracked.sh | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 3ea5b9bb3f..597b0637d1 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -35,24 +35,26 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'\n \ttest_cmp expect actual\n '\n \n+tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))\n+untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))\n cat > expect.diff <<EOF\n diff --git a/HEAD b/HEAD\n new file mode 100644\n-index 0000000..d00491f\n+index 0000000..$tracked\n --- /dev/null\n +++ b/HEAD\n @@ -0,0 +1 @@\n +1\n diff --git a/file2 b/file2\n new file mode 100644\n-index 0000000..d00491f\n+index 0000000..$tracked\n --- /dev/null\n +++ b/file2\n @@ -0,0 +1 @@\n +1\n diff --git a/untracked/untracked b/untracked/untracked\n new file mode 100644\n-index 0000000..5a72eb2\n+index 0000000..$untracked\n --- /dev/null\n +++ b/untracked/untracked\n @@ -0,0 +1 @@\n@@ -109,10 +111,11 @@ test_expect_success 'stash save -u dirty index' '\n \tgit stash -u\n '\n \n+blob=$(git rev-parse --short $(echo 4 | git hash-object --stdin))\n cat > expect <<EOF\n diff --git a/file3 b/file3\n new file mode 100644\n-index 0000000..b8626c4\n+index 0000000..$blob\n --- /dev/null\n +++ b/file3\n @@ -0,0 +1 @@\n"},{"id":"347530","messageId":"7485f683-e57e-acdd-4502-02c3f4f0b394@kdbg.org","threadId":"48477","inReplyTo":"20180513022438.60003-18-sandals@crustytoothpaste.net","subject":"Re: [PATCH v2 17/28] t4014: abstract away SHA-1-specific constants","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2018-05-13T07:34:03Z","receivedAt":"2018-05-13T07:34:09Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 13.05.2018 um 04:24 schrieb brian m. carlson:\n> Adjust the test so that it computes values for blobs instead of using\n> hard-coded hashes.\n> \n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>   t/t4014-format-patch.sh | 7 ++++---\n>   1 file changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> index dac3f349a3..42b3e11207 100755\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -578,7 +578,9 @@ test_expect_success 'excessive subject' '\n>   \n>   \trm -rf patches/ &&\n>   \tgit checkout side &&\n> +\tbefore=$(git rev-parse --short $(git hash-object file)) &&\n>   \tfor i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo \"$i\"; done >>file &&\n> +\tafter=$(git rev-parse --short $(git hash-object file)) &&\n\nIt would be better to avoid process expansion in command arguments, \nbecause the shell does not diagnose failures. This is preferable:\n\n\tbefore=$(git hash-object file) &&\n\tbefore=$(git rev-parse --short $before) &&\n\n-- Hannes\n"},{"id":"347548","messageId":"20180513174601.GC574870@genre.crustytoothpaste.net","threadId":"48477","inReplyTo":"7485f683-e57e-acdd-4502-02c3f4f0b394@kdbg.org","subject":"Re: [PATCH v2 17/28] t4014: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-13T17:46:02Z","receivedAt":"2018-05-13T17:46:14Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sun, May 13, 2018 at 09:34:03AM +0200, Johannes Sixt wrote:\n> Am 13.05.2018 um 04:24 schrieb brian m. carlson:\n> > diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> > index dac3f349a3..42b3e11207 100755\n> > --- a/t/t4014-format-patch.sh\n> > +++ b/t/t4014-format-patch.sh\n> > @@ -578,7 +578,9 @@ test_expect_success 'excessive subject' '\n> >   \trm -rf patches/ &&\n> >   \tgit checkout side &&\n> > +\tbefore=$(git rev-parse --short $(git hash-object file)) &&\n> >   \tfor i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo \"$i\"; done >>file &&\n> > +\tafter=$(git rev-parse --short $(git hash-object file)) &&\n> \n> It would be better to avoid process expansion in command arguments, because\n> the shell does not diagnose failures. This is preferable:\n> \n> \tbefore=$(git hash-object file) &&\n> \tbefore=$(git rev-parse --short $before) &&\n\nI considered that and assumed it would be all right because if git\nhash-object failed, we wouldn't get anything on stdout.  However, I\nagree that your approach is more robust, so I'll reroll with that\nchange.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}