{"thread":{"id":"48426","subject":"[PATCH 00/28] Hash-independent tests (part 2)","startedAt":"2018-05-06T23:18:14Z","lastAt":"2018-05-09T00:14:05Z","messageCount":46,"participants":["brian m. carlson","Eric Sunshine","Martin Ågren"],"isPatch":true,"patchVersion":1,"patchTotal":28},"messages":[{"id":"346790","messageId":"20180506231752.975110-1-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":null,"subject":"[PATCH 00/28] Hash-independent tests (part 2)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:24Z","receivedAt":"2018-05-06T23:18:14Z","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\nSeveral tests are skipped because of SHA-1-specific dependencies: some\nof these are core tests which test basic expected hash values, some\ndepend on colliding short names, and some depend on specially named\nobject (the pack tests).\n\nElsewhere, tests are modified to compute values using git hash-object\nand git rev-parse.  There is one cleanup patch that fixes indentation so\nwe can use an indented heredoc in the following patch.\n\nThe order in this series is by patch type, then roughly by test number.\n\nAll of these tests pass with an alternate 160-bit hash as well as SHA-1.\nAn additional series cleaning up the remainder of the tests is required\nto make the entire testsuite pass with an alternate 160-bit hash.\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 FULL_HEX\n  t: switch $_x40 to $FULL_HEX\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  | 12 +++---\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(+), 268 deletions(-)\n\n"},{"id":"346791","messageId":"20180506231752.975110-2-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 01/28] t/test-lib: add an SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:25Z","receivedAt":"2018-05-06T23:18:14Z","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 can\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":"346792","messageId":"20180506231752.975110-3-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 02/28] t/test-lib: introduce ZERO_OID","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:26Z","receivedAt":"2018-05-06T23:18:17Z","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":"346793","messageId":"20180506231752.975110-4-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 03/28] t: switch $_z40 to $ZERO_OID","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:27Z","receivedAt":"2018-05-06T23:18:26Z","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":"346794","messageId":"20180506231752.975110-5-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 04/28] t/test-lib: introduce FULL_HEX","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:28Z","receivedAt":"2018-05-06T23:18:29Z","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 $FULL_HEX variable which will always\nreflect a regex matching the appropriate object ID, regardless of the\nlength 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..6d09bd99df 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+FULL_HEX=\"$_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 FULL_HEX\n \n # Each test should start with something like this, after copyright notices:\n #\n"},{"id":"346795","messageId":"20180506231752.975110-6-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 05/28] t: switch $_x40 to $FULL_HEX","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:29Z","receivedAt":"2018-05-06T23:18:38Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Switch all uses of $_x40 to $FULL_HEX 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/$FULL_HEX/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..506ef4c289 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/ '\"\\($FULL_HEX\\)\"' '\"\\($FULL_HEX\\)\"' \\([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/ '\"$FULL_HEX\"' '\"$FULL_HEX\"' \\([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..26f12facf0 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/$FULL_HEX/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..d85056238e 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/ '\"$FULL_HEX\"' / 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..01378f7bcd 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]\\) '\"$FULL_HEX\"' /\\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..bafbe49971 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]\\) '\"$FULL_HEX\"' /\\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..26a4089f1e 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]* $FULL_HEX \\([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..f7b0ad774e 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/ $FULL_HEX\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..316efabbae 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/ $FULL_HEX\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..1ff7527fae 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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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..bcd8f22dd1 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/'$FULL_HEX'\\( [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..2612537255 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\\) \\('\"$FULL_HEX\"'\\) \\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..163d64fc32 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 $FULL_HEX 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..0f28ef5c6c 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/$FULL_HEX/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..99ed055d00 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/$FULL_HEX/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..d3b1bf375b 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/$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 \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..8c252d14b0 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|$FULL_HEX (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..b5082a381d 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|$FULL_HEX (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..42e134f5ae 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/$FULL_HEX/HASH/\" -e \"s/$FULL_HEX/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..980da5da59 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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/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..aac7ae2f6f 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/$FULL_HEX/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/$FULL_HEX/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/$FULL_HEX/OBJID/g\" >actual &&\n \ttest_cmp expect actual\n '\n \n"},{"id":"346796","messageId":"20180506231752.975110-7-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 06/28] t0000: annotate with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:30Z","receivedAt":"2018-05-06T23:18:42Z","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":"346797","messageId":"20180506231752.975110-8-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 07/28] t1007: annotate with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:31Z","receivedAt":"2018-05-06T23:18:43Z","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":"346798","messageId":"20180506231752.975110-10-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 09/28] t4044: skip test if not using SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:33Z","receivedAt":"2018-05-06T23:18:47Z","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":"346799","messageId":"20180506231752.975110-11-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 10/28] t: skip pack tests if not using SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:34Z","receivedAt":"2018-05-06T23:18:51Z","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":"346800","messageId":"20180506231752.975110-13-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 12/28] t3103: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:36Z","receivedAt":"2018-05-06T23:18:53Z","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":"346801","messageId":"20180506231752.975110-12-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 11/28] t2203: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:35Z","receivedAt":"2018-05-06T23:18: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/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":"346802","messageId":"20180506231752.975110-15-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 14/28] t3905: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:38Z","receivedAt":"2018-05-06T23:18: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/t3905-stash-include-untracked.sh | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 3ea5b9bb3f..c073514385 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -34,25 +34,26 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'\n \tgit status --porcelain >actual &&\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 +110,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":"346803","messageId":"20180506231752.975110-17-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 16/28] t4008: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:40Z","receivedAt":"2018-05-06T23:19:00Z","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..76481302c3 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+\tlink_oid=$(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 $link_oid 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 $link_oid 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 $link_oid 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":"346804","messageId":"20180506231752.975110-18-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 17/28] t4014: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:41Z","receivedAt":"2018-05-06T23:19:03Z","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 163d64fc32..eb34d0faab 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":"346805","messageId":"20180506231752.975110-21-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 20/28] t4029: fix test indentation","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:44Z","receivedAt":"2018-05-06T23:19:06Z","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":"346806","messageId":"20180506231752.975110-22-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 21/28] t4029: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:45Z","receivedAt":"2018-05-06T23:19: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 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":"346807","messageId":"20180506231752.975110-23-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 22/28] t4030: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:46Z","receivedAt":"2018-05-06T23:19:10Z","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":"346808","messageId":"20180506231752.975110-25-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 24/28] t4205: sort log output in a hash-independent way","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:48Z","receivedAt":"2018-05-06T23:19:13Z","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":"346809","messageId":"20180506231752.975110-26-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 25/28] t4042: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:49Z","receivedAt":"2018-05-06T23:19:16Z","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":"346810","messageId":"20180506231752.975110-24-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 23/28] t/lib-diff-alternative: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:47Z","receivedAt":"2018-05-06T23:19:19Z","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":"346811","messageId":"20180506231752.975110-28-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 27/28] t4208: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:51Z","receivedAt":"2018-05-06T23:19:21Z","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":"346812","messageId":"20180506231752.975110-29-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 28/28] t5300: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:52Z","receivedAt":"2018-05-06T23:19: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 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":"346813","messageId":"20180506231752.975110-27-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 26/28] t4045: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:50Z","receivedAt":"2018-05-06T23:19:29Z","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":"346814","messageId":"20180506231752.975110-19-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 18/28] t4020: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:42Z","receivedAt":"2018-05-06T23:19:34Z","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":"346815","messageId":"20180506231752.975110-20-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 19/28] t4022: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:43Z","receivedAt":"2018-05-06T23:19:37Z","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":"346816","messageId":"20180506231752.975110-9-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 08/28] t1512: skip test if not using SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:32Z","receivedAt":"2018-05-06T23:19:39Z","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":"346817","messageId":"20180506231752.975110-16-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 15/28] t4007: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:39Z","receivedAt":"2018-05-06T23:19:43Z","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":"346818","messageId":"20180506231752.975110-14-sandals@crustytoothpaste.net","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"[PATCH 13/28] t3702: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-06T23:17:37Z","receivedAt":"2018-05-06T23:19:44Z","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":"346822","messageId":"CAPig+cTrLseKxznrMb63rQ4NK1JYvPraV=Bz6vbnO0sY6qkK=Q@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-5-sandals@crustytoothpaste.net","subject":"Re: [PATCH 04/28] t/test-lib: introduce FULL_HEX","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-05-06T23:53:42Z","receivedAt":"2018-05-06T23:53:46Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\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\nBikeshedding: $FULL_HEX doesn't convey much. Perhaps $OID_REGEX? (And\n$_x05 and $_x35 can be named $OID_REGEX_SHORT and\n$OID_REGEX_{something}, respectively? Or perhaps they don't need\nrenaming?)\n\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n"},{"id":"346824","messageId":"CAPig+cQ7hn_P_xZW70X4vCztCr_r84+ofh_ApEbZwfQKRRq6Nw@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-15-sandals@crustytoothpaste.net","subject":"Re: [PATCH 14/28] t3905: abstract away SHA-1-specific constants","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-05-07T00:03:27Z","receivedAt":"2018-05-07T00:03:31Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> Adjust the test so that it computes variables for blobs instead of using\n> hard-coded hashes.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n> diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\n> @@ -34,25 +34,26 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'\n>         git status --porcelain >actual &&\n>         test_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\nYou lost the blank line following the previous test.\n\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"},{"id":"346825","messageId":"CAPig+cQ0tm76B4_uewtdMwUo9weRkz92id5cuuQcRdBByZBCDA@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-17-sandals@crustytoothpaste.net","subject":"Re: [PATCH 16/28] t4008: abstract away SHA-1-specific constants","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-05-07T00:07:46Z","receivedAt":"2018-05-07T00:07:50Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> Adjust the test so that it computes variables for blobs instead of using\n> hard-coded hashes.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n> diff --git a/t/t4008-diff-break-rewrite.sh 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> +       blob0_id=$(git hash-object file0) &&\n> +       blob1_id=$(git hash-object file1) &&\n> +       blob2_id=$(git hash-object file1) &&\n> +       link_oid=$(printf frotz | git hash-object --stdin) &&\n\nInconsistency nit: For the blobs, you tacked on \"_id\" but for the link\nyou added \"_oid\".\n"},{"id":"346831","messageId":"CAPig+cQnsdcYQnDB_bvn1p9wc9wTVAPAGZKn6_JHqnRtfAXaUA@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH 00/28] Hash-independent tests (part 2)","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-05-07T01:49:45Z","receivedAt":"2018-05-07T01:49:49Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> This series introduces an SHA1 prerequisite which checks if the hash in\n> use is SHA-1, and can be used to skip the test if it is not.\n> Additionally, because NewHash will be 256-bit, I introduced aliases for\n> the test constants $_x40 and $_z40 which will be less confusing when the\n> hash isn't 40 hex characters long.  I opted to leave the old names in\n> place for the moment to prevent any potential conflicts with other\n> series and will clean up any stragglers later.\n>\n> Several tests are skipped because of SHA-1-specific dependencies: some\n> of these are core tests which test basic expected hash values, some\n> depend on colliding short names, and some depend on specially named\n> object (the pack tests).\n\nWas I wrong to expect this series to annotate[1] tests\n\n    t3404 \"short SHA-1 setup\"\n    t3404 \"short SHA-1 collide\"\n\nwith the SHA1 prerequisite?\n\n[1]: https://public-inbox.org/git/CAPig+cR==SNfGdhwqPdvW75fUxXg-VSQ5Tz_OR7Sy_c0L94axQ@mail.gmail.com/T/#m7bb98bd57a3189bb5fe01993b22b0c480a601259\n"},{"id":"346836","messageId":"20180507022801.GC953644@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAPig+cTrLseKxznrMb63rQ4NK1JYvPraV=Bz6vbnO0sY6qkK=Q@mail.gmail.com","subject":"Re: [PATCH 04/28] t/test-lib: introduce FULL_HEX","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-07T02:28:01Z","receivedAt":"2018-05-07T02:28:13Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sun, May 06, 2018 at 07:53:42PM -0400, Eric Sunshine wrote:\n> On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\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> \n> Bikeshedding: $FULL_HEX doesn't convey much. Perhaps $OID_REGEX? (And\n> $_x05 and $_x35 can be named $OID_REGEX_SHORT and\n> $OID_REGEX_{something}, respectively? Or perhaps they don't need\n> renaming?)\n\nI agree that $OID_REGEX is better.  Thinking about it, I'm wondering if\n$_xoid might be shorter and familiar enough to people who are used to\n$_x40.  I'll wait for other people to chime in, and then reroll.\n\nI don't think the short forms will end up needing renaming, but I'll try\nto pick something sane in line with the others should that be necessary.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"346837","messageId":"20180507023026.GD953644@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAPig+cQ7hn_P_xZW70X4vCztCr_r84+ofh_ApEbZwfQKRRq6Nw@mail.gmail.com","subject":"Re: [PATCH 14/28] t3905: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-07T02:30:27Z","receivedAt":"2018-05-07T02:30:36Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sun, May 06, 2018 at 08:03:27PM -0400, Eric Sunshine wrote:\n> On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> > Adjust the test so that it computes variables for blobs instead of using\n> > hard-coded hashes.\n> >\n> > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> > ---\n> > diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\n> > @@ -34,25 +34,26 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'\n> >         git status --porcelain >actual &&\n> >         test_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> \n> You lost the blank line following the previous test.\n\nSo I did.  Will fix.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"346838","messageId":"20180507023244.GE953644@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAPig+cQ0tm76B4_uewtdMwUo9weRkz92id5cuuQcRdBByZBCDA@mail.gmail.com","subject":"Re: [PATCH 16/28] t4008: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-07T02:32:45Z","receivedAt":"2018-05-07T02:32:56Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sun, May 06, 2018 at 08:07:46PM -0400, Eric Sunshine wrote:\n> On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> > Adjust the test so that it computes variables for blobs instead of using\n> > hard-coded hashes.\n> >\n> > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> > ---\n> > diff --git a/t/t4008-diff-break-rewrite.sh 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> > +       blob0_id=$(git hash-object file0) &&\n> > +       blob1_id=$(git hash-object file1) &&\n> > +       blob2_id=$(git hash-object file1) &&\n> > +       link_oid=$(printf frotz | git hash-object --stdin) &&\n> \n> Inconsistency nit: For the blobs, you tacked on \"_id\" but for the link\n> you added \"_oid\".\n\nYes, that was intentional.  I want them to line up nicely because it\nmakes reading the heredocs much easier.  Maybe it would be better if I\ncalled it \"linkf_id\" or \"slink_id\" or something.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"346839","messageId":"20180507024041.GF953644@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAPig+cQnsdcYQnDB_bvn1p9wc9wTVAPAGZKn6_JHqnRtfAXaUA@mail.gmail.com","subject":"Re: [PATCH 00/28] Hash-independent tests (part 2)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-07T02:40:42Z","receivedAt":"2018-05-07T02:40:51Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sun, May 06, 2018 at 09:49:45PM -0400, Eric Sunshine wrote:\n> On Sun, May 6, 2018 at 7:17 PM, brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> > This series introduces an SHA1 prerequisite which checks if the hash in\n> > use is SHA-1, and can be used to skip the test if it is not.\n> > Additionally, because NewHash will be 256-bit, I introduced aliases for\n> > the test constants $_x40 and $_z40 which will be less confusing when the\n> > hash isn't 40 hex characters long.  I opted to leave the old names in\n> > place for the moment to prevent any potential conflicts with other\n> > series and will clean up any stragglers later.\n> >\n> > Several tests are skipped because of SHA-1-specific dependencies: some\n> > of these are core tests which test basic expected hash values, some\n> > depend on colliding short names, and some depend on specially named\n> > object (the pack tests).\n> \n> Was I wrong to expect this series to annotate[1] tests\n> \n>     t3404 \"short SHA-1 setup\"\n>     t3404 \"short SHA-1 collide\"\n> \n> with the SHA1 prerequisite?\n\nt3404 is in the next series.  I realize it's slightly out of order, but\nI tended to fix them in roughly the order they showed up in parallel\ntest output, which is why it's in the next series.  There are some more\ninvolved ones which ended up in the next series as well.\n\nI figured reviewers would appreciate a shorter series over a longer one.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"346858","messageId":"CAN0heSqk0siv4y5BGz2+sLhAyNG=TEZmgucKoCDGyx2i8_O+tQ@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-2-sandals@crustytoothpaste.net","subject":"Re: [PATCH 01/28] t/test-lib: add an SHA1 prerequisite","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-07T10:10:39Z","receivedAt":"2018-05-07T10:10:48Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 7 May 2018 at 01:17, brian m. carlson <sandals@crustytoothpaste.net> wrote:\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> create versions of these tests which handle both SHA-1 and NewHash.\n\nMinor nit: s/can/can and should/\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> +       test $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n> +'\n\nSo SHA1 means roughly \"git hash-object uses SHA-1, so supposedly\neverything on disk is SHA-1.\" I could imagine one or two different\nmeanings: \"Git was compiled with support for SHA-1 [oids].\"\n\nDo we actually need more SHA-1-related prereqs, at least long-term, in\nwhich case we would want to find a more specific name for this one now?\nIs this SHA1_STORAGE, or some much better name than that?\n\nI am thinking for example about a repo with NewHash that gets pushed to\nand fetched from a SHA-1 server, see hash-function-transition.txt, goal\n1b. We'd want to always test that SHA-1-related functionality in git.\n(But only until the day when someone defines a prereq such as \"SHA1\" to\nbe able to test a git that was compiled without any traces of SHA-1\nwhatsoever.)\n\nMartin\n"},{"id":"346859","messageId":"CAN0heSqu9gwsrgV0rnPe8=vANhBA+Z7fZ3UNTeG9S1QiJBsksw@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-7-sandals@crustytoothpaste.net","subject":"Re: [PATCH 06/28] t0000: annotate with SHA1 prerequisite","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-07T10:24:13Z","receivedAt":"2018-05-07T10:24:17Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 7 May 2018 at 01:17, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> Since this is a core test that tests basic functionality, annotate the\n> assertions that have dependencies on SHA-1 with the appropriate\n> prerequisite.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  t/t0000-basic.sh | 24 ++++++++++++------------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n> index 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>         test \"$tree\" = 7bb943559a305bdd6bdee2cef6e5df2413c3d30a\n>      '\n>\n> @@ -882,7 +882,7 @@ test_expect_success 'showing stage with git ls-files --stage' '\n>         git 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>         cat >expected <<-\\EOF &&\n>         100644 f87290f8eb2cbbea7857214459a0739927eab154 0       path0\n>         120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0       path0sym\n> @@ -900,7 +900,7 @@ test_expect_success 'writing tree out with git write-tree' '\n>         tree=$(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>         test \"$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>         cat >expected <<-\\EOF &&\n>         100644 blob f87290f8eb2cbbea7857214459a0739927eab154    path0\n>         120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01    path0sym\n> @@ -924,7 +924,7 @@ test_expect_success 'showing tree with git ls-tree -r' '\n>         git ls-tree -r $tree >current\n>  '\n\n[snip]\n\nThis could be more centralized at the top of the file, more likely to be\nnoticed during a `make test` and easier to adapt in the future. Maybe\nsomething like this at the top of the file:\n\nif hash for storage is SHA-1 then\n        knowntree=7bb943559a305bdd6bdee2cef6e5df2413c3d30a\n        path0=f87290f8eb2cbbea7857214459a0739927eab154\n        ....\nelse\n        skip_all='unknown hash, but you really need to expand this test'\n        # or even error out!\nfi\n\nWhen we add NewHash, we get to add an \"else if\". Otherwise, we'd be\nplugging in NewHash without testing some very basic stuff.\n\nOk, so `skip_all` is quite hard, but skipping certain basic tests also\nfeels really shaky. Adding a new hash algo without adapting this test\nshould be a no-go, IMHO.\n\nMartin\n"},{"id":"346860","messageId":"CAN0heSrbG+Axs=xq=MdnA=m98Habi_uHS3hj6xweCHqufA7Vag@mail.gmail.com","threadId":"48426","inReplyTo":"20180506231752.975110-11-sandals@crustytoothpaste.net","subject":"Re: [PATCH 10/28] t: skip pack tests if not using SHA-1","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-07T10:30:47Z","receivedAt":"2018-05-07T10:30:51Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 7 May 2018 at 01:17, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> These tests rely on creating packs with specially named objects which\n> are necessarily dependent on the hash used.  Skip these tests if we're\n> not using SHA-1.\n>\n> Signed-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>\n> diff --git a/t/t5308-pack-detect-duplicates.sh b/t/t5308-pack-detect-duplicates.sh\n> index 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\nAdd something like \"FIXME please expand this test\", either as a comment\nor inside the skip_all? That probably goes for all patches in this\nseries that skip tests.\n\nAs it is now, it feels to me like this is simply stuffing tests away\nthat are failing. When your primary focus is to run the test suite with\nanother hash function, I can see why you need to do this change. But if\nthe goal is to eventually have another hash function and test things at\nleast as well as before, I think leaving some sort of note here would\nhelp someone who later wants to resurrect those tests that this series\nsuppressed.\n\nI realize this is related to my comment on the previous series formally\nchanging the on-disk format [1] and that this comment is along the same\nlines as my comment there.\n\n[1] https://public-inbox.org/git/20180427210823.GB722934@genre.crustytoothpaste.net/\n\nMartin\n"},{"id":"346928","messageId":"20180507233000.GI953644@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAN0heSqk0siv4y5BGz2+sLhAyNG=TEZmgucKoCDGyx2i8_O+tQ@mail.gmail.com","subject":"Re: [PATCH 01/28] t/test-lib: add an SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-07T23:30:00Z","receivedAt":"2018-05-07T23:30:10Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Mon, May 07, 2018 at 12:10:39PM +0200, Martin Ågren wrote:\n> On 7 May 2018 at 01:17, brian m. carlson <sandals@crustytoothpaste.net> wrote:\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> > create versions of these tests which handle both SHA-1 and NewHash.\n> \n> Minor nit: s/can/can and should/\n\nI agree with that sentiment.  I can change that.\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> > +       test $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n> > +'\n> \n> So SHA1 means roughly \"git hash-object uses SHA-1, so supposedly\n> everything on disk is SHA-1.\" I could imagine one or two different\n> meanings: \"Git was compiled with support for SHA-1 [oids].\"\n\nCurrently it means that, yes.  It may specialize to mean, \"git emits\nSHA-1 output, regardless of the format on disk.\"  See cases 1 and 2\nbelow.\n\n> Do we actually need more SHA-1-related prereqs, at least long-term, in\n> which case we would want to find a more specific name for this one now?\n> Is this SHA1_STORAGE, or some much better name than that?\n\nWe may.  The transition plan anticipates several states:\n\n1. Store data in NewHash, but input and output are SHA-1.\n2. Store data in NewHash; output is SHA-1; input can be either.\n3. Store data and output in NewHash; input can be either.\n4. All NewHash.\n\nAt this point, I'm working on getting the tests to handle case 4, as\nthat's actually the easiest to fix (because if things are wrong, the\ncode tends to segfault).  Case 1 will be next, in which case, we may\nneed SHA1_STORAGE or such.\n\nI plan to make the SHA1 prerequisite go away or at least be far less\nused in a few releases.  Once we know what NewHash is going to be, it's\npretty easy to write tooling and translation tables that do the\nconversion for most tests, and a test helper can simply emit the right\noutput for whichever algorithm we're using in that situation, whether\nthat's the on-disk algorithm, the input algorithm, or the output\nalgorithm.\n\n> I am thinking for example about a repo with NewHash that gets pushed to\n> and fetched from a SHA-1 server, see hash-function-transition.txt, goal\n> 1b. We'd want to always test that SHA-1-related functionality in git.\n> (But only until the day when someone defines a prereq such as \"SHA1\" to\n> be able to test a git that was compiled without any traces of SHA-1\n> whatsoever.)\n\nI anticipate that by the time we get to that point, the SHA1\nprerequisite will be long gone and can be reused for that purpose,\nshould we need it.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"346933","messageId":"20180507234058.GJ953644@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAN0heSqu9gwsrgV0rnPe8=vANhBA+Z7fZ3UNTeG9S1QiJBsksw@mail.gmail.com","subject":"Re: [PATCH 06/28] t0000: annotate with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-07T23:40:58Z","receivedAt":"2018-05-07T23:41:07Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Mon, May 07, 2018 at 12:24:13PM +0200, Martin Ågren wrote:\n> This could be more centralized at the top of the file, more likely to be\n> noticed during a `make test` and easier to adapt in the future. Maybe\n> something like this at the top of the file:\n> \n> if hash for storage is SHA-1 then\n>         knowntree=7bb943559a305bdd6bdee2cef6e5df2413c3d30a\n>         path0=f87290f8eb2cbbea7857214459a0739927eab154\n>         ....\n> else\n>         skip_all='unknown hash, but you really need to expand this test'\n>         # or even error out!\n> fi\n\nAs I mentioned in an earlier email, I plan to set an environment\nvariable for the algorithms in use and then do something like:\n\n  test \"$tree\" = \"$(test-tool hash-helper --output known-tree)\"\n\nwhere \"known-tree\" is some key we can use to look up the SHA-1 or\nNewHash value, and we've specified we want the output format (as opposed\nto input format or on-disk format).\n\n> When we add NewHash, we get to add an \"else if\". Otherwise, we'd be\n> plugging in NewHash without testing some very basic stuff.\n> \n> Ok, so `skip_all` is quite hard, but skipping certain basic tests also\n> feels really shaky. Adding a new hash algo without adapting this test\n> should be a no-go, IMHO.\n\nI agree that this test needs to be updated for NewHash, but since we\nhaven't decided what that's going to be, it makes sense during\ndevelopment to still test the rest of the code if possible so that we\nknow what does and doesn't work.\n\nThis is a first step in making it obvious what doesn't work, and when we\nknow what the data is supposed to be, we can adjust it by fixing the\ntests so that it works in all cases.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"347007","messageId":"CAN0heSpzBtSBE78zmBx_5ukb4DpHEO==kGgbYAczE+UyBf3HxA@mail.gmail.com","threadId":"48426","inReplyTo":"20180507233000.GI953644@genre.crustytoothpaste.net","subject":"Re: [PATCH 01/28] t/test-lib: add an SHA1 prerequisite","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-08T18:26:05Z","receivedAt":"2018-05-08T18:26:12Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 8 May 2018 at 01:30, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> On Mon, May 07, 2018 at 12:10:39PM +0200, Martin Ågren wrote:\n>> On 7 May 2018 at 01:17, brian m. carlson <sandals@crustytoothpaste.net> wrote:\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>> > create versions of these tests which handle both SHA-1 and NewHash.\n>>\n>> Minor nit: s/can/can and should/\n>\n> I agree with that sentiment.  I can change that.\n\nTo be clear, this was an \"if you have independent reasons for rerolling\nthis, then maybe consider possibly doing this\".\n\n>> So SHA1 means roughly \"git hash-object uses SHA-1, so supposedly\n>> everything on disk is SHA-1.\" I could imagine one or two different\n>> meanings: \"Git was compiled with support for SHA-1 [oids].\"\n>\n> Currently it means that, yes.  It may specialize to mean, \"git emits\n> SHA-1 output, regardless of the format on disk.\"  See cases 1 and 2\n> below.\n>\n>> Do we actually need more SHA-1-related prereqs, at least long-term, in\n>> which case we would want to find a more specific name for this one now?\n>> Is this SHA1_STORAGE, or some much better name than that?\n>\n> We may.  The transition plan anticipates several states:\n\n\"We may\" as in, \"we may need more SHA1-FOO prereqs later\", or \"we may\nwant this to be SHA1-BAR\"?\n\n> 1. Store data in NewHash, but input and output are SHA-1.\n> 2. Store data in NewHash; output is SHA-1; input can be either.\n> 3. Store data and output in NewHash; input can be either.\n> 4. All NewHash.\n>\n> At this point, I'm working on getting the tests to handle case 4, as\n> that's actually the easiest to fix (because if things are wrong, the\n> code tends to segfault).  Case 1 will be next, in which case, we may\n> need SHA1_STORAGE or such.\n\n> I plan to make the SHA1 prerequisite go away or at least be far less\n> used in a few releases.  Once we know what NewHash is going to be, it's\n> pretty easy to write tooling and translation tables that do the\n> conversion for most tests, and a test helper can simply emit the right\n> output for whichever algorithm we're using in that situation, whether\n> that's the on-disk algorithm, the input algorithm, or the output\n> algorithm.\n\nI do not feel entirely relaxed about a reasoning such as \"this prereq\nwill soon go away again, so we do not need to think too much about its\nname and meaning\" (heavily paraphrased and possibly a bit pointed, but\nhopefully not too dishonest).\n\nI guess a counter-argument might be \"sure, if only we knew which\nSHA1-FOOs we will need. Only time and experience will tell.\" You've\ncertainly spent way more brain-cycles on this than I have, and most\nlikely more than anyone else on this list.\n\nMaybe we want to document the transition-ness of this in the code and/or\nthe commit message. Not only \"transition\" in the sense of the big\ntransition, but in the sense of \"this will probably go away long before\nthe transition is completed.\"\n\n>> I am thinking for example about a repo with NewHash that gets pushed to\n>> and fetched from a SHA-1 server, see hash-function-transition.txt, goal\n>> 1b. We'd want to always test that SHA-1-related functionality in git.\n>> (But only until the day when someone defines a prereq such as \"SHA1\" to\n>> be able to test a git that was compiled without any traces of SHA-1\n>> whatsoever.)\n>\n> I anticipate that by the time we get to that point, the SHA1\n> prerequisite will be long gone and can be reused for that purpose,\n> should we need it.\n"},{"id":"347008","messageId":"CAN0heSq8EYxVx9Qpb==KgeBVT3AXtgK6f+CQyK_kNUXZHMMnLA@mail.gmail.com","threadId":"48426","inReplyTo":"20180507234058.GJ953644@genre.crustytoothpaste.net","subject":"Re: [PATCH 06/28] t0000: annotate with SHA1 prerequisite","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-08T18:28:47Z","receivedAt":"2018-05-08T18:28:54Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 8 May 2018 at 01:40, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> On Mon, May 07, 2018 at 12:24:13PM +0200, Martin Ågren wrote:\n>> This could be more centralized at the top of the file, more likely to be\n>> noticed during a `make test` and easier to adapt in the future. Maybe\n>> something like this at the top of the file:\n>>\n>> if hash for storage is SHA-1 then\n>>         knowntree=7bb943559a305bdd6bdee2cef6e5df2413c3d30a\n>>         path0=f87290f8eb2cbbea7857214459a0739927eab154\n>>         ....\n>> else\n>>         skip_all='unknown hash, but you really need to expand this test'\n>>         # or even error out!\n>> fi\n>\n> As I mentioned in an earlier email, I plan to set an environment\n> variable for the algorithms in use and then do something like:\n>\n>   test \"$tree\" = \"$(test-tool hash-helper --output known-tree)\"\n>\n> where \"known-tree\" is some key we can use to look up the SHA-1 or\n> NewHash value, and we've specified we want the output format (as opposed\n> to input format or on-disk format).\n\nMy first thought was, can't we introduce such a helper already now? It\nwould not check with the environment, but would always output SHA-1\nvalues. Thinking about it some more, maybe the exact usage/interface\nwould be a bit volatile in the beginning, making it just as good an idea\nto gain some more experience and feeling first.\n\n>> When we add NewHash, we get to add an \"else if\". Otherwise, we'd be\n>> plugging in NewHash without testing some very basic stuff.\n>>\n>> Ok, so `skip_all` is quite hard, but skipping certain basic tests also\n>> feels really shaky. Adding a new hash algo without adapting this test\n>> should be a no-go, IMHO.\n>\n> I agree that this test needs to be updated for NewHash, but since we\n> haven't decided what that's going to be, it makes sense during\n> development to still test the rest of the code if possible so that we\n> know what does and doesn't work.\n>\n> This is a first step in making it obvious what doesn't work, and when we\n> know what the data is supposed to be, we can adjust it by fixing the\n> tests so that it works in all cases.\n\nA lingering feeling is, how do we find all these tests that we \"hide\"\n(for lack of a better word)? Maybe introduce some standardized comment\nkeyword. Or use a more grep-friendly prereq-name. Or, if all occurances\nof \"SHA1\" (outside of t????-*sha*) are expected to go away real soon\nnow, maybe this is not an issue.\n\nAnyway, thanks for putting up with me, and thanks a big lot for driving\nthis major undertaking forward.\n\nMartin\n"},{"id":"347032","messageId":"20180508234627.GC275488@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAN0heSpzBtSBE78zmBx_5ukb4DpHEO==kGgbYAczE+UyBf3HxA@mail.gmail.com","subject":"Re: [PATCH 01/28] t/test-lib: add an SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-08T23:46:27Z","receivedAt":"2018-05-08T23:46:37Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Tue, May 08, 2018 at 08:26:05PM +0200, Martin Ågren wrote:\n> On 8 May 2018 at 01:30, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> > On Mon, May 07, 2018 at 12:10:39PM +0200, Martin Ågren wrote:\n> >> Do we actually need more SHA-1-related prereqs, at least long-term, in\n> >> which case we would want to find a more specific name for this one now?\n> >> Is this SHA1_STORAGE, or some much better name than that?\n> >\n> > We may.  The transition plan anticipates several states:\n> \n> \"We may\" as in, \"we may need more SHA1-FOO prereqs later\", or \"we may\n> want this to be SHA1-BAR\"?\n\nAs in, we may need additional prerequisites.\n\n> I do not feel entirely relaxed about a reasoning such as \"this prereq\n> will soon go away again, so we do not need to think too much about its\n> name and meaning\" (heavily paraphrased and possibly a bit pointed, but\n> hopefully not too dishonest).\n\nI think \"SHA1\" is short and reasonable considering that it's basically\nstating, \"This test depends on Git using SHA-1.\"  That's all we're\nstating here.\n\nI agree that the expected lifetime of the code should not impact its\ndesign or naming in this case.  As someone who does maintenance for a\nliving, I'm all too aware that code lives far longer than its expected\nlifetime.\n\n> I guess a counter-argument might be \"sure, if only we knew which\n> SHA1-FOOs we will need. Only time and experience will tell.\" You've\n> certainly spent way more brain-cycles on this than I have, and most\n> likely more than anyone else on this list.\n> \n> Maybe we want to document the transition-ness of this in the code and/or\n> the commit message. Not only \"transition\" in the sense of the big\n> transition, but in the sense of \"this will probably go away long before\n> the transition is completed.\"\n\nSure.  I can fix this up in a reroll.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"347033","messageId":"20180509001352.GD275488@genre.crustytoothpaste.net","threadId":"48426","inReplyTo":"CAN0heSq8EYxVx9Qpb==KgeBVT3AXtgK6f+CQyK_kNUXZHMMnLA@mail.gmail.com","subject":"Re: [PATCH 06/28] t0000: annotate with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-09T00:13:52Z","receivedAt":"2018-05-09T00:14:05Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Tue, May 08, 2018 at 08:28:47PM +0200, Martin Ågren wrote:\n> On 8 May 2018 at 01:40, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> > As I mentioned in an earlier email, I plan to set an environment\n> > variable for the algorithms in use and then do something like:\n> >\n> >   test \"$tree\" = \"$(test-tool hash-helper --output known-tree)\"\n> >\n> > where \"known-tree\" is some key we can use to look up the SHA-1 or\n> > NewHash value, and we've specified we want the output format (as opposed\n> > to input format or on-disk format).\n> \n> My first thought was, can't we introduce such a helper already now? It\n> would not check with the environment, but would always output SHA-1\n> values. Thinking about it some more, maybe the exact usage/interface\n> would be a bit volatile in the beginning, making it just as good an idea\n> to gain some more experience and feeling first.\n\nI think your second thought is spot on.  As we move on in this work, it\nwill become more obvious what functionality we need.\n\nAs a note, the benefit of using the prerequisite is in development work.\nIt's useful to know that all but a certain set of tests pass in the\ncodebase, because that gives me confidence that Git as a whole is mostly\nfunctional as a result of my refactors.\n\nBecause I'm using a hash that may not be the final NewHash, it doesn't\nmake sense for me to compute translation tables.  Even if I did go\nthrough that work, I couldn't submit it upstream, because nobody is\ninterested in carrying code for brian's development hash.  A helper that\noutput SHA-1 wouldn't be useful to me, because the tests would still\nfail, and I wouldn't know what was failing because it was broken and\nwhat just depended on SHA-1.\n\nSo part of the idea with the prerequisite is to provide code that can be\nincluded in the main project and provides benefit to those that are\ndoing future development work.  The test helper approach becomes more\nviable once we're clearer about what variations we need from the helper\nand what hash we're actually using.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}