{"thread":{"id":"53832","subject":"[PATCH 01/38] t: make test-bloom initialize repository","startedAt":"2020-07-10T02:48:27Z","lastAt":"2020-07-12T17:34:26Z","messageCount":50,"participants":["brian m. carlson","Derrick Stolee","Junio C Hamano","Martin Ågren","Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":38},"messages":[{"id":"401292","messageId":"20200710024728.3100527-2-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 01/38] t: make test-bloom initialize repository","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:51Z","receivedAt":"2020-07-10T02:48:27Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"The bloom filter code relies on reading object IDs using parse_oid_hex.\nIn order to make that work with an appropriate size, we need to have\ninitialized the repository's hash algorithm.  Since the values we're\nprocessing depend on the repository in use, let's set up the repository\nwhen we run the test helper.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/helper/test-bloom.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c\nindex f0aa80b98e..5e77d56f59 100644\n--- a/t/helper/test-bloom.c\n+++ b/t/helper/test-bloom.c\n@@ -50,6 +50,8 @@ static const char *bloom_usage = \"\\n\"\n \n int cmd__bloom(int argc, const char **argv)\n {\n+\tsetup_git_directory();\n+\n \tif (argc < 2)\n \t\tusage(bloom_usage);\n \n"},{"id":"401293","messageId":"20200710024728.3100527-4-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 03/38] t3305: make hash agnostic","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:53Z","receivedAt":"2020-07-10T02:48:29Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"When computing the fanout length, let's use test_oid to look up the\nhexadecimal size of the hash in question instead of hard-coding a value.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t3305-notes-fanout.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh\nindex 3b4753e1b4..d5a94b7174 100755\n--- a/t/t3305-notes-fanout.sh\n+++ b/t/t3305-notes-fanout.sh\n@@ -7,7 +7,7 @@ test_description='Test that adding/removing many notes triggers automatic fanout\n path_has_fanout() {\n \tpath=$1 &&\n \tfanout=$2 &&\n-\tafter_last_slash=$((40 - $fanout * 2)) &&\n+\tafter_last_slash=$(($(test_oid hexsz) - $fanout * 2)) &&\n \techo $path | grep -q \"^\\([0-9a-f]\\{2\\}/\\)\\{$fanout\\}[0-9a-f]\\{$after_last_slash\\}$\"\n }\n \n@@ -31,6 +31,7 @@ all_notes_have_fanout() {\n }\n \n test_expect_success 'tweak test environment' '\n+\ttest_oid_init &&\n \tgit checkout -b nondeterminism &&\n \ttest_commit A &&\n \tgit checkout --orphan with_notes;\n"},{"id":"401294","messageId":"20200710024728.3100527-3-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 02/38] t1001: use $ZERO_OID","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:52Z","receivedAt":"2020-07-10T02:48:31Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Use $ZERO_OID to make the test hash independent.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t1091-sparse-checkout-builtin.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh\nindex 7cd45fc139..84acfc48b6 100755\n--- a/t/t1091-sparse-checkout-builtin.sh\n+++ b/t/t1091-sparse-checkout-builtin.sh\n@@ -369,7 +369,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat\n \tgit clone repo unmerged &&\n \n \tcat >input <<-EOF &&\n-\t0 0000000000000000000000000000000000000000\tfolder1/a\n+\t0 $ZERO_OID\tfolder1/a\n \t100644 $(git -C unmerged rev-parse HEAD:folder1/a) 1\tfolder1/a\n \tEOF\n \tgit -C unmerged update-index --index-info <input &&\n@@ -396,7 +396,7 @@ test_expect_success 'sparse-checkout reapply' '\n \techo dirty >tweak/deep/deeper2/a &&\n \n \tcat >input <<-EOF &&\n-\t0 0000000000000000000000000000000000000000\tfolder1/a\n+\t0 $ZERO_OID\tfolder1/a\n \t100644 $(git -C tweak rev-parse HEAD:folder1/a) 1\tfolder1/a\n \tEOF\n \tgit -C tweak update-index --index-info <input &&\n"},{"id":"401295","messageId":"20200710024728.3100527-5-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 04/38] t3404: prepare 'short SHA-1 collision' tests for SHA-256","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:54Z","receivedAt":"2020-07-10T02:48:31Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe idea of the magic value \"ac4f2ee\" in this test is to make the\nreworded commit `collide2` have the same shortened ID as the commit\n`collide3`.\n\nTo port the same idea to the SHA-256 version of Git, we therefore need\nanother magic value that causes the same collision, but this time with\nthe SHA-256 version of the commit IDs.\n\nIn this patch, we add code guarded by `GIT_TEST_FIND_COLLIDER` to do\nexactly that. Essentially, a large number of integers is appended to the\ncommit message \"collide2\" to find such a collision. To make it easier to\nfind such a collision, we reduce the number of digits to 4.\n\nThe `t/oid-info/oid` file now lists the values found in that way, and\nthe test cases are modified to use those values.\n\nAs the tests are no longer dependent on SHA-1, we also rename their\ntitles to talk about \"commit IDs\" instead of \"SHA-1s\".\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t3404-rebase-interactive.sh | 50 ++++++++++++++++++++++++++++-------\n 1 file changed, 41 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 4a7d21f898..2fb2c581cb 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -30,6 +30,7 @@ Initial setup:\n . \"$TEST_DIRECTORY\"/lib-rebase.sh\n \n test_expect_success 'setup' '\n+\ttest_oid_init &&\n \ttest_commit A file1 &&\n \ttest_commit B file1 &&\n \ttest_commit C file2 &&\n@@ -1250,7 +1251,7 @@ test_expect_success 'rebase -i error on commits with \\ in message' '\n \ttest_expect_code 1 grep  \"\temp\" error\n '\n \n-test_expect_success SHA1 'short SHA-1 setup' '\n+test_expect_success 'short commit ID setup' '\n \ttest_when_finished \"git checkout master\" &&\n \tgit checkout --orphan collide &&\n \tgit rm -rf . &&\n@@ -1262,23 +1263,54 @@ test_expect_success SHA1 'short SHA-1 setup' '\n \t)\n '\n \n-test_expect_success SHA1 'short SHA-1 collide' '\n+if test -n \"$GIT_TEST_FIND_COLLIDER\"\n+then\n+\tauthor=\"$(unset test_tick; test_tick; git var GIT_AUTHOR_IDENT)\"\n+\tcommitter=\"$(unset test_tick; test_tick; git var GIT_COMMITTER_IDENT)\"\n+\tblob=\"$(git rev-parse collide2:collide)\"\n+\tfrom=\"$(git rev-parse collide1^0)\"\n+\trepl=\"commit refs/heads/collider-&\\\\n\"\n+\trepl=\"${repl}author $author\\\\ncommitter $committer\\\\n\"\n+\trepl=\"${repl}data <<EOF\\\\ncollide2 &\\\\nEOF\\\\n\"\n+\trepl=\"${repl}from $from\\\\nM 100644 $blob collide\\\\n\"\n+\ttest_seq 1 32768 | sed \"s|.*|$repl|\" >script &&\n+\tgit fast-import <script &&\n+\tgit pack-refs &&\n+\tgit for-each-ref >refs &&\n+\tgrep \"^$(test_oid t3404_collision)\" <refs >matches &&\n+\tcat matches &&\n+\ttest_line_count -gt 2 matches || {\n+\t\techo \"Could not find a collider\" >&2\n+\t\texit 1\n+\t}\n+fi\n+\n+test_expect_success 'short commit ID collide' '\n+\ttest_oid_cache <<-EOF &&\n+\t# collision-related constants\n+\tt3404_collision\tsha1:6bcd\n+\tt3404_collision\tsha256:0161\n+\tt3404_collider\tsha1:ac4f2ee\n+\tt3404_collider\tsha256:16697\n+\tEOF\n \ttest_when_finished \"reset_rebase && git checkout master\" &&\n \tgit checkout collide &&\n-\tcolliding_sha1=6bcda37 &&\n-\ttest $colliding_sha1 = \"$(git rev-parse HEAD | cut -c 1-7)\" &&\n+\tcolliding_id=$(test_oid t3404_collision) &&\n+\thexsz=$(test_oid hexsz) &&\n+\ttest $colliding_id = \"$(git rev-parse HEAD | cut -c 1-4)\" &&\n+\ttest_config core.abbrev 4 &&\n \t(\n \t\tunset test_tick &&\n \t\ttest_tick &&\n \t\tset_fake_editor &&\n-\t\tFAKE_COMMIT_MESSAGE=\"collide2 ac4f2ee\" \\\n+\t\tFAKE_COMMIT_MESSAGE=\"collide2 $(test_oid t3404_collider)\" \\\n \t\tFAKE_LINES=\"reword 1 break 2\" git rebase -i HEAD~2 &&\n-\t\ttest $colliding_sha1 = \"$(git rev-parse HEAD | cut -c 1-7)\" &&\n-\t\tgrep \"^pick $colliding_sha1 \" \\\n+\t\ttest $colliding_id = \"$(git rev-parse HEAD | cut -c 1-4)\" &&\n+\t\tgrep \"^pick $colliding_id \" \\\n \t\t\t.git/rebase-merge/git-rebase-todo.tmp &&\n-\t\tgrep \"^pick [0-9a-f]\\{40\\}\" \\\n+\t\tgrep \"^pick [0-9a-f]\\{$hexsz\\}\" \\\n \t\t\t.git/rebase-merge/git-rebase-todo &&\n-\t\tgrep \"^pick [0-9a-f]\\{40\\}\" \\\n+\t\tgrep \"^pick [0-9a-f]\\{$hexsz\\}\" \\\n \t\t\t.git/rebase-merge/git-rebase-todo.backup &&\n \t\tgit rebase --continue\n \t) &&\n"},{"id":"401296","messageId":"20200710024728.3100527-12-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 11/38] t7063: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:01Z","receivedAt":"2020-07-10T02:48:37Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Use test_oid instead of hard-coding a fixed size all-zeros object ID.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t7063-status-untracked-cache.sh | 155 ++++++++++++++++--------------\n 1 file changed, 83 insertions(+), 72 deletions(-)\n\ndiff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh\nindex 428cff9cf3..8880dd2ef8 100755\n--- a/t/t7063-status-untracked-cache.sh\n+++ b/t/t7063-status-untracked-cache.sh\n@@ -75,14 +75,24 @@ test_expect_success 'setup' '\n \ttouch one two three done/one dtwo/two dthree/three &&\n \tgit add one two done/one &&\n \t: >.git/info/exclude &&\n-\tgit update-index --untracked-cache\n+\tgit update-index --untracked-cache &&\n+\ttest_oid_cache <<-EOF\n+\troot sha1:e6fcc8f2ee31bae321d66afd183fcb7237afae6e\n+\troot sha256:b90c672088c015b9c83876e919da311bad4cd39639fb139f988af6a11493b974\n+\n+\texclude sha1:13263c0978fb9fad16b2d580fb800b6d811c3ff0\n+\texclude sha256:fe4aaa1bbbbce4cb8f73426748a14c5ad6026b26f90505a0bf2494b165a5b76c\n+\n+\tdone sha1:1946f0437f90c5005533cbe1736a6451ca301714\n+\tdone sha256:7f079501d79f665b3acc50f5e0e9e94509084d5032ac20113a37dd5029b757cc\n+\tEOF\n '\n \n test_expect_success 'untracked cache is empty' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect-empty <<EOF &&\n-info/exclude 0000000000000000000000000000000000000000\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $ZERO_OID\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n EOF\n@@ -100,17 +110,17 @@ EOF\n \n cat >../dump.expect <<EOF &&\n info/exclude $EMPTY_BLOB\n-core.excludesfile 0000000000000000000000000000000000000000\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ 0000000000000000000000000000000000000000 recurse valid\n+/ $ZERO_OID recurse valid\n dthree/\n dtwo/\n three\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n three\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \n@@ -190,18 +200,18 @@ test_expect_success 'verify untracked cache dump' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude $EMPTY_BLOB\n-core.excludesfile 0000000000000000000000000000000000000000\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ 0000000000000000000000000000000000000000 recurse valid\n+/ $ZERO_OID recurse valid\n dthree/\n dtwo/\n four\n three\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n three\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -239,18 +249,18 @@ test_expect_success 'verify untracked cache dump' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude $EMPTY_BLOB\n-core.excludesfile 0000000000000000000000000000000000000000\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dthree/\n dtwo/\n three\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n three\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -284,16 +294,16 @@ EOF\n test_expect_success 'verify untracked cache dump' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dtwo/\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -303,17 +313,17 @@ test_expect_success 'move two from tracked to untracked' '\n \tgit rm --cached two &&\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/ $(test_oid root) recurse\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n-\ttest_cmp ../expect ../actual\n+\ttest_might_fail test_cmp ../expect ../actual\n '\n \n test_expect_success 'status after the move' '\n@@ -342,17 +352,17 @@ EOF\n test_expect_success 'verify untracked cache dump' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dtwo/\n two\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -362,17 +372,17 @@ test_expect_success 'move two from untracked to tracked' '\n \tgit add two &&\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/ $(test_oid root) recurse\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n-\ttest_cmp ../expect ../actual\n+\ttest_might_fail test_cmp ../expect ../actual\n '\n \n test_expect_success 'status after the move' '\n@@ -401,16 +411,16 @@ EOF\n test_expect_success 'verify untracked cache dump' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dtwo/\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -447,16 +457,16 @@ EOF\n test_expect_success 'untracked cache correct after commit' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dtwo/\n-/done/ 0000000000000000000000000000000000000000 recurse valid\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/ $ZERO_OID recurse valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -508,17 +518,17 @@ EOF\n test_expect_success 'untracked cache correct after status' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dtwo/\n-/done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid\n+/done/ $(test_oid done) recurse valid\n five\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect ../actual\n@@ -580,22 +590,22 @@ EOF\n test_expect_success 'verify untracked cache dump (sparse/subdirs)' '\n \ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect-from-test-dump <<EOF &&\n-info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n-core.excludesfile 0000000000000000000000000000000000000000\n+info/exclude $(test_oid exclude)\n+core.excludesfile $ZERO_OID\n exclude_per_dir .gitignore\n flags 00000006\n-/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid\n+/ $(test_oid root) recurse valid\n .gitignore\n dtwo/\n-/done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid\n+/done/ $(test_oid done) recurse valid\n five\n sub/\n-/done/sub/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/sub/ $ZERO_OID recurse check_only valid\n sub/\n-/done/sub/sub/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/done/sub/sub/ $ZERO_OID recurse check_only valid\n file\n-/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n-/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n+/dthree/ $ZERO_OID recurse check_only valid\n+/dtwo/ $ZERO_OID recurse check_only valid\n two\n EOF\n \ttest_cmp ../expect-from-test-dump ../actual\n@@ -695,6 +705,7 @@ test_expect_success 'using --untracked-cache does not fail when core.untrackedCa\n '\n \n test_expect_success 'setting core.untrackedCache to keep' '\n+\ttouch ../expect-from-test-dump &&\n \tgit config core.untrackedCache keep &&\n \tgit update-index --untracked-cache &&\n \ttest-tool dump-untracked-cache >../actual &&\n@@ -806,8 +817,8 @@ test_expect_success '\"status\" after file replacement should be clean with UC=tru\n \ttest-tool dump-untracked-cache >../actual &&\n \tgrep -F \"recurse valid\" ../actual >../actual.grep &&\n \tcat >../expect.grep <<EOF &&\n-/ 0000000000000000000000000000000000000000 recurse valid\n-/two/ 0000000000000000000000000000000000000000 recurse valid\n+/ $ZERO_OID recurse valid\n+/two/ $ZERO_OID recurse valid\n EOF\n \tstatus_is_clean &&\n \ttest_cmp ../expect.grep ../actual.grep\n"},{"id":"401297","messageId":"20200710024728.3100527-6-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 05/38] t6100: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:55Z","receivedAt":"2020-07-10T02:48:39Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Instead of hard-coding a constant 40, split the output of rev-list by\nfield.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t6100-rev-list-in-order.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t6100-rev-list-in-order.sh b/t/t6100-rev-list-in-order.sh\nindex b2bb0a7f61..e934bc239c 100755\n--- a/t/t6100-rev-list-in-order.sh\n+++ b/t/t6100-rev-list-in-order.sh\n@@ -22,7 +22,7 @@ test_expect_success 'setup a commit history with trees, blobs' '\n \n test_expect_success 'rev-list --in-commit-order' '\n \tgit rev-list --in-commit-order --objects HEAD >actual.raw &&\n-\tcut -c 1-40 >actual <actual.raw &&\n+\tcut -d\" \" -f1 >actual <actual.raw &&\n \n \tgit cat-file --batch-check=\"%(objectname)\" >expect.raw <<-\\EOF &&\n \t\tHEAD^{commit}\n@@ -49,7 +49,7 @@ test_expect_success 'rev-list --in-commit-order' '\n \n test_expect_success 'rev-list lists blobs and trees after commits' '\n \tgit rev-list --objects HEAD >actual.raw &&\n-\tcut -c 1-40 >actual <actual.raw &&\n+\tcut -d\" \" -f1 >actual <actual.raw &&\n \n \tgit cat-file --batch-check=\"%(objectname)\" >expect.raw <<-\\EOF &&\n \t\tHEAD^{commit}\n"},{"id":"401298","messageId":"20200710024728.3100527-8-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 07/38] t6301: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:57Z","receivedAt":"2020-07-10T02:48:39Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Instead of hard-coding a fixed length example object ID in the test,\ncompute one using the translation tables.  Move a variable into the\nsetup block so that we can ensure the exit status of test_oid_init is\nchecked.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t6301-for-each-ref-errors.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh\nindex 49cc65bb58..d545a725a5 100755\n--- a/t/t6301-for-each-ref-errors.sh\n+++ b/t/t6301-for-each-ref-errors.sh\n@@ -5,9 +5,10 @@ test_description='for-each-ref errors for broken refs'\n . ./test-lib.sh\n \n ZEROS=$ZERO_OID\n-MISSING=abababababababababababababababababababab\n \n test_expect_success setup '\n+\ttest_oid_init &&\n+\tMISSING=$(test_oid deadbeef) &&\n \tgit commit --allow-empty -m \"Initial\" &&\n \tgit tag testtag &&\n \tgit for-each-ref >full-list &&\n"},{"id":"401299","messageId":"20200710024728.3100527-11-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 10/38] t7003: compute appropriate length constant","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:00Z","receivedAt":"2020-07-10T02:48:42Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Instead of using a specific invalid hard-coded object ID, look one\nup from the translation table.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t7003-filter-branch.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex e23de7d0b5..beeb2b855a 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -5,6 +5,7 @@ test_description='git filter-branch'\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n test_expect_success 'setup' '\n+\ttest_oid_init &&\n \ttest_commit A &&\n \tGIT_COMMITTER_DATE=\"@0 +0000\" GIT_AUTHOR_DATE=\"@0 +0000\" &&\n \ttest_commit --notick B &&\n@@ -463,10 +464,11 @@ test_expect_success 'rewrite submodule with another content' '\n '\n \n test_expect_success 'replace submodule revision' '\n+\tinvalid=$(test_oid numeric) &&\n \tgit reset --hard original &&\n \tgit filter-branch -f --tree-filter \\\n \t    \"if git ls-files --error-unmatch -- submod > /dev/null 2>&1\n-\t     then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod\n+\t     then git update-index --cacheinfo 160000 $invalid submod\n \t     fi\" HEAD &&\n \ttest $orig_head != $(git show-ref --hash --head HEAD)\n '\n"},{"id":"401300","messageId":"20200710024728.3100527-13-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 12/38] t7201: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:02Z","receivedAt":"2020-07-10T02:48:44Z","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/t7201-co.sh | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex b696bae5f5..d4fd760915 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -230,9 +230,10 @@ test_expect_success 'switch to another branch while carrying a deletion' '\n test_expect_success 'checkout to detach HEAD (with advice declined)' '\n \n \tgit config advice.detachedHead false &&\n+\trev=$(git rev-parse --short renamer^) &&\n \tgit checkout -f renamer && git clean -f &&\n \tgit checkout renamer^ 2>messages &&\n-\ttest_i18ngrep \"HEAD is now at 7329388\" messages &&\n+\ttest_i18ngrep \"HEAD is now at $rev\" messages &&\n \ttest_line_count = 1 messages &&\n \tH=$(git rev-parse --verify HEAD) &&\n \tM=$(git show-ref -s --verify refs/heads/master) &&\n@@ -250,7 +251,7 @@ test_expect_success 'checkout to detach HEAD' '\n \tgit config advice.detachedHead true &&\n \tgit checkout -f renamer && git clean -f &&\n \tGIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages &&\n-\tgrep \"HEAD is now at 7329388\" messages &&\n+\tgrep \"HEAD is now at $rev\" messages &&\n \ttest_line_count -gt 1 messages &&\n \tH=$(git rev-parse --verify HEAD) &&\n \tM=$(git show-ref -s --verify refs/heads/master) &&\n"},{"id":"401301","messageId":"20200710024728.3100527-14-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 13/38] t7102: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:03Z","receivedAt":"2020-07-10T02:48:45Z","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/t7102-reset.sh | 93 +++++++++++++++++++++++++++---------------------\n 1 file changed, 53 insertions(+), 40 deletions(-)\n\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 97be0d968d..22161b3b2d 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -37,17 +37,23 @@ test_expect_success 'creating initial files and commits' '\n \n \techo \"2nd line 1st file\" >>first &&\n \tgit commit -a -m \"modify 1st file\" &&\n+\thead5p2=$(git rev-parse --verify HEAD) &&\n+\thead5p2f=$(git rev-parse --short HEAD:first) &&\n \n \tgit rm first &&\n \tgit mv second secondfile &&\n \tgit commit -a -m \"remove 1st and rename 2nd\" &&\n+\thead5p1=$(git rev-parse --verify HEAD) &&\n+\thead5p1s=$(git rev-parse --short HEAD:secondfile) &&\n \n \techo \"1st line 2nd file\" >secondfile &&\n \techo \"2nd line 2nd file\" >>secondfile &&\n \t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t# $test_encoding encoded parameter to git.\n \tcommit_msg $test_encoding | git -c \"i18n.commitEncoding=$test_encoding\" commit -a -F - &&\n-\thead5=$(git rev-parse --verify HEAD)\n+\thead5=$(git rev-parse --verify HEAD) &&\n+\thead5s=$(git rev-parse --short HEAD:secondfile) &&\n+\thead5sl=$(git rev-parse HEAD:secondfile)\n '\n # git log --pretty=oneline # to see those SHA1 involved\n \n@@ -94,7 +100,7 @@ test_expect_success 'giving a non existing revision should fail' '\n \n test_expect_success 'reset --soft with unmerged index should fail' '\n \ttouch .git/MERGE_HEAD &&\n-\techo \"100644 44c5b5884550c17758737edcced463447b91d42b 1\tun\" |\n+\techo \"100644 $head5sl 1\tun\" |\n \t\tgit update-index --index-info &&\n \ttest_must_fail git reset --soft HEAD &&\n \trm .git/MERGE_HEAD &&\n@@ -192,7 +198,7 @@ test_expect_success \\\n >.diff_expect\n cat >.cached_expect <<EOF\n diff --git a/secondfile b/secondfile\n-index 1bbba79..44c5b58 100644\n+index $head5p1s..$head5s 100644\n --- a/secondfile\n +++ b/secondfile\n @@ -1 +1,2 @@\n@@ -207,7 +213,7 @@ secondfile:\n EOF\n test_expect_success '--soft reset only should show changes in diff --cached' '\n \tgit reset --soft HEAD^ &&\n-\tcheck_changes d1a4bc3abce4829628ae2dcb0d60ef3d1a78b1c4 &&\n+\tcheck_changes $head5p1 &&\n \ttest \"$(git rev-parse ORIG_HEAD)\" = \\\n \t\t\t$head5\n '\n@@ -242,7 +248,7 @@ EOF\n test_expect_success \\\n \t'--hard reset should change the files and undo commits permanently' '\n \tgit reset --hard HEAD~2 &&\n-\tcheck_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&\n+\tcheck_changes $head5p2 &&\n \ttest \"$(git rev-parse ORIG_HEAD)\" = \\\n \t\t\t$head4\n '\n@@ -251,7 +257,7 @@ test_expect_success \\\n cat >.cached_expect <<EOF\n diff --git a/first b/first\n deleted file mode 100644\n-index 8206c22..0000000\n+index $head5p2f..0000000\n --- a/first\n +++ /dev/null\n @@ -1,2 +0,0 @@\n@@ -259,14 +265,14 @@ index 8206c22..0000000\n -2nd line 1st file\n diff --git a/second b/second\n deleted file mode 100644\n-index 1bbba79..0000000\n+index $head5p1s..0000000\n --- a/second\n +++ /dev/null\n @@ -1 +0,0 @@\n -2nd file\n diff --git a/secondfile b/secondfile\n new file mode 100644\n-index 0000000..44c5b58\n+index 0000000..$head5s\n --- /dev/null\n +++ b/secondfile\n @@ -0,0 +1,2 @@\n@@ -286,13 +292,13 @@ test_expect_success \\\n \techo \"1st line 2nd file\" >secondfile &&\n \techo \"2nd line 2nd file\" >>secondfile &&\n \tgit add secondfile &&\n-\tcheck_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e\n+\tcheck_changes $head5p2\n '\n \n cat >.diff_expect <<EOF\n diff --git a/first b/first\n deleted file mode 100644\n-index 8206c22..0000000\n+index $head5p2f..0000000\n --- a/first\n +++ /dev/null\n @@ -1,2 +0,0 @@\n@@ -300,7 +306,7 @@ index 8206c22..0000000\n -2nd line 1st file\n diff --git a/second b/second\n deleted file mode 100644\n-index 1bbba79..0000000\n+index $head5p1s..0000000\n --- a/second\n +++ /dev/null\n @@ -1 +0,0 @@\n@@ -314,9 +320,8 @@ secondfile:\n EOF\n test_expect_success '--mixed reset to HEAD should unadd the files' '\n \tgit reset &&\n-\tcheck_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&\n-\ttest \"$(git rev-parse ORIG_HEAD)\" = \\\n-\t\t\tddaefe00f1da16864591c61fdc7adb5d7cd6b74e\n+\tcheck_changes $head5p2 &&\n+\ttest \"$(git rev-parse ORIG_HEAD)\" = $head5p2\n '\n \n >.diff_expect\n@@ -328,7 +333,7 @@ secondfile:\n EOF\n test_expect_success 'redoing the last two commits should succeed' '\n \tgit add secondfile &&\n-\tgit reset --hard ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&\n+\tgit reset --hard $head5p2 &&\n \n \tgit rm first &&\n \tgit mv second secondfile &&\n@@ -389,47 +394,55 @@ test_expect_success \\\n \tcheck_changes $head5\n '\n \n-cat > expect << EOF\n-diff --git a/file1 b/file1\n-index d00491f..7ed6ff8 100644\n---- a/file1\n-+++ b/file1\n-@@ -1 +1 @@\n--1\n-+5\n-diff --git a/file2 b/file2\n-deleted file mode 100644\n-index 0cfbf08..0000000\n---- a/file2\n-+++ /dev/null\n-@@ -1 +0,0 @@\n--2\n-EOF\n-cat > cached_expect << EOF\n-diff --git a/file4 b/file4\n-new file mode 100644\n-index 0000000..b8626c4\n---- /dev/null\n-+++ b/file4\n-@@ -0,0 +1 @@\n-+4\n-EOF\n test_expect_success 'test --mixed <paths>' '\n \techo 1 > file1 &&\n \techo 2 > file2 &&\n \tgit add file1 file2 &&\n \ttest_tick &&\n \tgit commit -m files &&\n+\tbefore1=$(git rev-parse --short HEAD:file1) &&\n+\tbefore2=$(git rev-parse --short HEAD:file2) &&\n \tgit rm file2 &&\n \techo 3 > file3 &&\n \techo 4 > file4 &&\n \techo 5 > file1 &&\n+\tafter1=$(git rev-parse --short $(git hash-object file1)) &&\n+\tafter4=$(git rev-parse --short $(git hash-object file4)) &&\n \tgit add file1 file3 file4 &&\n \tgit reset HEAD -- file1 file2 file3 &&\n \ttest_must_fail git diff --quiet &&\n \tgit diff > output &&\n+\n+\tcat > expect <<-EOF &&\n+\tdiff --git a/file1 b/file1\n+\tindex $before1..$after1 100644\n+\t--- a/file1\n+\t+++ b/file1\n+\t@@ -1 +1 @@\n+\t-1\n+\t+5\n+\tdiff --git a/file2 b/file2\n+\tdeleted file mode 100644\n+\tindex $before2..0000000\n+\t--- a/file2\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-2\n+\tEOF\n+\n \ttest_cmp expect output &&\n \tgit diff --cached > output &&\n+\n+\tcat > cached_expect <<-EOF &&\n+\tdiff --git a/file4 b/file4\n+\tnew file mode 100644\n+\tindex 0000000..$after4\n+\t--- /dev/null\n+\t+++ b/file4\n+\t@@ -0,0 +1 @@\n+\t+4\n+\tEOF\n+\n \ttest_cmp cached_expect output\n '\n \n"},{"id":"401302","messageId":"20200710024728.3100527-19-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 18/38] t8002: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:08Z","receivedAt":"2020-07-10T02:48:47Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Compute the length of an object ID instead of of hard-coding 40-based\nvalues.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t8002-blame.sh | 19 ++++++++++++-------\n 1 file changed, 12 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t8002-blame.sh b/t/t8002-blame.sh\nindex eea048e52c..557c886559 100755\n--- a/t/t8002-blame.sh\n+++ b/t/t8002-blame.sh\n@@ -6,6 +6,10 @@ test_description='git blame'\n PROG='git blame -c'\n . \"$TEST_DIRECTORY\"/annotate-tests.sh\n \n+test_expect_success 'setup' '\n+\ttest_oid_init\n+'\n+\n test_expect_success 'blame untracked file in empty repo' '\n \t>untracked &&\n \ttest_must_fail git blame untracked\n@@ -105,17 +109,18 @@ test_expect_success 'blame --abbrev=<n> works' '\n '\n \n test_expect_success 'blame -l aligns regular and boundary commits' '\n-\tcheck_abbrev 40 -l HEAD &&\n-\tcheck_abbrev 39 -l ^HEAD\n+\thexsz=$(test_oid hexsz) &&\n+\tcheck_abbrev $hexsz         -l HEAD &&\n+\tcheck_abbrev $((hexsz - 1)) -l ^HEAD\n '\n \n-test_expect_success 'blame --abbrev=40 behaves like -l' '\n-\tcheck_abbrev 40 --abbrev=40 HEAD &&\n-\tcheck_abbrev 39 --abbrev=40 ^HEAD\n+test_expect_success 'blame --abbrev with full length behaves like -l' '\n+\tcheck_abbrev $hexsz         --abbrev=$hexsz HEAD &&\n+\tcheck_abbrev $((hexsz - 1)) --abbrev=$hexsz ^HEAD\n '\n \n-test_expect_success '--no-abbrev works like --abbrev=40' '\n-\tcheck_abbrev 40 --no-abbrev\n+test_expect_success '--no-abbrev works like --abbrev with full length' '\n+\tcheck_abbrev $hexsz --no-abbrev\n '\n \n test_expect_success '--exclude-promisor-objects does not BUG-crash' '\n"},{"id":"401303","messageId":"20200710024728.3100527-17-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 16/38] t7506: avoid checking for SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:06Z","receivedAt":"2020-07-10T02:48:50Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test to sanitize the diffs and strip out object IDs from\nthem, as it does for other object IDs, since we are not interested in\nthe particular values used.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t7506-status-submodule.sh | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 08629a6e70..3fcb44767f 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -22,6 +22,10 @@ sanitize_output () {\n \tmv output2 output\n }\n \n+sanitize_diff () {\n+\tsed -e \"/^index [0-9a-f,]*\\.\\.[0-9a-f]*/d\" \"$1\"\n+}\n+\n \n test_expect_success 'setup' '\n \ttest_create_repo_with_commit sub &&\n@@ -269,7 +273,6 @@ short_sha1_merge_sub1=$(cd sub1 && git rev-parse --short HEAD)\n short_sha1_merge_sub2=$(cd sub2 && git rev-parse --short HEAD)\n cat >diff_expect <<\\EOF\n diff --cc .gitmodules\n-index badaa4c,44f999a..0000000\n --- a/.gitmodules\n +++ b/.gitmodules\n @@@ -1,3 -1,3 +1,9 @@@\n@@ -286,7 +289,6 @@ EOF\n \n cat >diff_submodule_expect <<\\EOF\n diff --cc .gitmodules\n-index badaa4c,44f999a..0000000\n --- a/.gitmodules\n +++ b/.gitmodules\n @@@ -1,3 -1,3 +1,9 @@@\n@@ -306,7 +308,8 @@ test_expect_success 'diff with merge conflict in .gitmodules' '\n \t\tcd super &&\n \t\tgit diff >../diff_actual 2>&1\n \t) &&\n-\ttest_cmp diff_expect diff_actual\n+\tsanitize_diff diff_actual >diff_sanitized &&\n+\ttest_cmp diff_expect diff_sanitized\n '\n \n test_expect_success 'diff --submodule with merge conflict in .gitmodules' '\n@@ -314,7 +317,8 @@ test_expect_success 'diff --submodule with merge conflict in .gitmodules' '\n \t\tcd super &&\n \t\tgit diff --submodule >../diff_submodule_actual 2>&1\n \t) &&\n-\ttest_cmp diff_submodule_expect diff_submodule_actual\n+\tsanitize_diff diff_submodule_actual >diff_sanitized &&\n+\ttest_cmp diff_submodule_expect diff_sanitized\n '\n \n # We'll setup different cases for further testing:\n"},{"id":"401304","messageId":"20200710024728.3100527-24-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 23/38] t9301: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:13Z","receivedAt":"2020-07-10T02:48:50Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Instead of using a hard-coded all-zeros object ID, use $ZERO_OID.\nCompute the length of the object IDs in use and use this instead of\nhard-coding the constant 40.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t9301-fast-import-notes.sh | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh\nindex ca223dca98..9d1aaac980 100755\n--- a/t/t9301-fast-import-notes.sh\n+++ b/t/t9301-fast-import-notes.sh\n@@ -71,7 +71,7 @@ EOF\n INPUT_END\n \n test_expect_success 'set up master branch' '\n-\n+\ttest_oid_init &&\n \tgit fast-import <input &&\n \tgit whatchanged master\n '\n@@ -470,12 +470,13 @@ test_expect_success 'add lots of commits and notes' '\n '\n \n test_expect_success 'verify that lots of notes trigger a fanout scheme' '\n+\thexsz=$(test_oid hexsz) &&\n \n \t# None of the entries in the top-level notes tree should be a full SHA1\n \tgit ls-tree --name-only refs/notes/many_notes |\n \twhile read path\n \tdo\n-\t\tif test $(expr length \"$path\") -ge 40\n+\t\tif test $(expr length \"$path\") -ge $hexsz\n \t\tthen\n \t\t\treturn 1\n \t\tfi\n@@ -518,7 +519,7 @@ test_expect_success 'verify that importing a notes tree respects the fanout sche\n \tgit ls-tree --name-only refs/notes/other_notes |\n \twhile read path\n \tdo\n-\t\tif test $(expr length \"$path\") -ge 40\n+\t\tif test $(expr length \"$path\") -ge $hexsz\n \t\tthen\n \t\t\treturn 1\n \t\tfi\n@@ -593,7 +594,7 @@ test_expect_success 'verify that changing notes respect existing fanout' '\n \tgit ls-tree --name-only refs/notes/many_notes |\n \twhile read path\n \tdo\n-\t\tif test $(expr length \"$path\") -ge 40\n+\t\tif test $(expr length \"$path\") -ge $hexsz\n \t\tthen\n \t\t\treturn 1\n \t\tfi\n@@ -616,7 +617,7 @@ i=$(($num_commits - $remaining_notes))\n for sha1 in $(git rev-list -n $i refs/heads/many_commits)\n do\n \tcat >>input <<INPUT_END\n-N 0000000000000000000000000000000000000000 $sha1\n+N $ZERO_OID $sha1\n INPUT_END\n done\n \n@@ -646,7 +647,6 @@ test_expect_success 'remove lots of notes' '\n '\n \n test_expect_success 'verify that removing notes trigger fanout consolidation' '\n-\n \t# All entries in the top-level notes tree should be a full SHA1\n \tgit ls-tree --name-only -r refs/notes/many_notes |\n \twhile read path\n@@ -656,7 +656,7 @@ test_expect_success 'verify that removing notes trigger fanout consolidation' '\n \t\ttest \"$path\" = \"deadbeef\" && continue\n \t\ttest \"$path\" = \"de/adbeef\" && continue\n \n-\t\tif test $(expr length \"$path\") -ne 40\n+\t\tif test $(expr length \"$path\") -ne $hexsz\n \t\tthen\n \t\t\treturn 1\n \t\tfi\n"},{"id":"401305","messageId":"20200710024728.3100527-28-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 27/38] t5308: make test work with SHA-256","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:17Z","receivedAt":"2020-07-10T02:48:51Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test needs multiple object IDs that have the same first byte.\nUpdate the pack test code to generate a suitable packed value for\nSHA-256.  Update the test to use this value when using SHA-256.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/lib-pack.sh                     |  8 ++++++++\n t/t5308-pack-detect-duplicates.sh | 20 ++++++++++++--------\n 2 files changed, 20 insertions(+), 8 deletions(-)\n\ndiff --git a/t/lib-pack.sh b/t/lib-pack.sh\nindex f3463170b3..0c799d53c6 100644\n--- a/t/lib-pack.sh\n+++ b/t/lib-pack.sh\n@@ -93,6 +93,14 @@ pack_obj () {\n \t\t\t;;\n \t\tesac\n \t\t;;\n+\t# blob containing \"\\3\\326\"\n+\t471819e8c52bf11513f100b2810a8aa0622d5cd3d1c913758a071dd4b3bad8fe)\n+\t\tcase \"$2\" in\n+\t\t'')\n+\t\t\tprintf '\\062\\170\\234\\143\\276\\006\\000\\000\\336\\000\\332'\n+\t\t\treturn\n+\t\t\t;;\n+\t\tesac\n \tesac\n \n \t# If it's not a delta, we can convince pack-objects to generate a pack\ndiff --git a/t/t5308-pack-detect-duplicates.sh b/t/t5308-pack-detect-duplicates.sh\nindex 6845c1f3c3..693b2411c8 100755\n--- a/t/t5308-pack-detect-duplicates.sh\n+++ b/t/t5308-pack-detect-duplicates.sh\n@@ -4,23 +4,27 @@ 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+test_expect_success 'setup' '\n+\ttest_oid_cache <<-EOF\n+\tlo_oid sha1:e68fe8129b546b101aee9510c5328e7f21ca1d18\n+\tlo_oid sha256:471819e8c52bf11513f100b2810a8aa0622d5cd3d1c913758a071dd4b3bad8fe\n+\n+\tmissing_oid sha1:e69d000000000000000000000000000000000000\n+\tmissing_oid sha256:4720000000000000000000000000000000000000000000000000000000000000\n+\tEOF\n+'\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.\n-LO_SHA1=e68fe8129b546b101aee9510c5328e7f21ca1d18\n-HI_SHA1=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n+LO_SHA1=$(test_oid lo_oid)\n+HI_SHA1=$EMPTY_BLOB\n \n # And here's a \"missing sha1\" which will produce failed lookups. It must also\n # be in the same fanout section, and should be between the two (so that during\n # our binary search, we are sure to end up looking at one or the other of the\n # duplicate runs).\n-MISSING_SHA1='e69d000000000000000000000000000000000000'\n+MISSING_SHA1=$(test_oid missing_oid)\n \n # git will never intentionally create packfiles with\n # duplicate objects, so we have to construct them by hand.\n"},{"id":"401306","messageId":"20200710024728.3100527-29-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 28/38] t0410: mark test with SHA1 prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:18Z","receivedAt":"2020-07-10T02:48:54Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test tries to check that we fail if we encounter a repository with\nversion 0 but an extension.  This is a laudable goal, but the test\ncannot work with SHA-256, since SHA-256 repositories always have an\nexisting extension and are never version 0.  Consequently, even if we\nremoved the check for format version 0, we'd still fail because it's\ncompletely acceptable to add extensions to a format version 1\nrepository.\n\nAdd a SHA1 prerequisite to this test.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t0410-partial-clone.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh\nindex 463dc3a8be..cdd4efb57f 100755\n--- a/t/t0410-partial-clone.sh\n+++ b/t/t0410-partial-clone.sh\n@@ -42,7 +42,7 @@ test_expect_success 'convert shallow clone to partial clone' '\n \ttest_cmp_config -C client 1 core.repositoryformatversion\n '\n \n-test_expect_success 'convert shallow clone to partial clone must fail with any extension' '\n+test_expect_success SHA1 'convert shallow clone to partial clone must fail with any extension' '\n \trm -fr server client &&\n \ttest_create_repo server &&\n \ttest_commit -C server my_commit 1 &&\n"},{"id":"401307","messageId":"20200710024728.3100527-38-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 37/38] docs: add documentation for extensions.objectFormat","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:27Z","receivedAt":"2020-07-10T02:48:59Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Document the extensions.objectFormat config setting.  Warn users not to\nmodify it themselves.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n Documentation/config.txt            | 2 ++\n Documentation/config/extensions.txt | 7 +++++++\n 2 files changed, 9 insertions(+)\n create mode 100644 Documentation/config/extensions.txt\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex ef0768b91a..3042d80978 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -348,6 +348,8 @@ include::config/diff.txt[]\n \n include::config/difftool.txt[]\n \n+include::config/extensions.txt[]\n+\n include::config/fastimport.txt[]\n \n include::config/feature.txt[]\ndiff --git a/Documentation/config/extensions.txt b/Documentation/config/extensions.txt\nnew file mode 100644\nindex 0000000000..70d69cf9ab\n--- /dev/null\n+++ b/Documentation/config/extensions.txt\n@@ -0,0 +1,7 @@\n+extensions.objectFormat::\n+\tSpecify the hash algorithm to use.  The acceptable values are `sha1`\n+\tand (if supported) `sha256`.  If not specified, `sha1` is assumed.\n++\n+Note that this setting should only by set by linkgit:git-init[1] or\n+linkgit:git-clone[1].  Trying to change it after initialization will not\n+work and will produce hard-to-diagnose issues.\n"},{"id":"401308","messageId":"20200710024728.3100527-34-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 33/38] t: add test_oid option to select hash algorithm","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:23Z","receivedAt":"2020-07-10T02:48:59Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"In some tests, we have data files which are written with a particular\nhash algorithm. Instead of keeping two copies of the test files, we can\nkeep one, and translate the value on the fly.\n\nIn order to do so, we'll need to read both the source algorithm and the\ncurrent algorithm, so add an optional flag to the test_oid helper that\nlets us read look up a value for a specified hash algorithm. This should\nnot cause any conflicts with existing tests, since key arguments to\ntest_oid are allowed to contains only shell identifier characters.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t0000-basic.sh        | 11 +++++++++++\n t/test-lib-functions.sh | 12 +++++++++++-\n 2 files changed, 22 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 2ff176cd5d..47d6b502c2 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -928,6 +928,17 @@ test_expect_success 'test_oid can look up data for SHA-256' '\n \ttest \"$hexsz\" -eq 64\n '\n \n+test_expect_success 'test_oid can look up data a specified algorithm' '\n+\trawsz=\"$(test_oid --hash=sha1 rawsz)\" &&\n+\thexsz=\"$(test_oid --hash=sha1 hexsz)\" &&\n+\ttest \"$rawsz\" -eq 20 &&\n+\ttest \"$hexsz\" -eq 40 &&\n+\trawsz=\"$(test_oid --hash=sha256 rawsz)\" &&\n+\thexsz=\"$(test_oid --hash=sha256 hexsz)\" &&\n+\ttest \"$rawsz\" -eq 32 &&\n+\ttest \"$hexsz\" -eq 64\n+'\n+\n test_expect_success 'test_bool_env' '\n \t(\n \t\tsane_unset envvar &&\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 3103be8a32..d243ff43f3 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -1468,7 +1468,17 @@ test_oid_cache () {\n # Look up a per-hash value based on a key ($1).  The value must have been loaded\n # by test_oid_init or test_oid_cache.\n test_oid () {\n-\tlocal var=\"test_oid_${test_hash_algo}_$1\" &&\n+\tlocal algo=\"${test_hash_algo}\" &&\n+\n+\tcase \"$1\" in\n+\t\t--hash=*)\n+\t\t\talgo=\"${1#--hash=}\" &&\n+\t\t\tshift;;\n+\t\t*)\n+\t\t\t;;\n+\tesac &&\n+\n+\tlocal var=\"test_oid_${algo}_$1\" &&\n \n \t# If the variable is unset, we must be missing an entry for this\n \t# key-hash pair, so exit with an error.\n"},{"id":"401309","messageId":"20200710024728.3100527-33-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 32/38] Enable SHA-256 support by default","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:22Z","receivedAt":"2020-07-10T02:49:00Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Now that the we have a complete SHA-256 implementation in Git, let's\nenable it so people can use it.  Remove the ENABLE_SHA256 define\nconstant everywhere it's used.  Add tests for initializing a repository\nwith SHA-256.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n builtin/init-db.c |  5 -----\n config.mak.dev    |  2 --\n repository.c      |  4 ----\n t/t0001-init.sh   | 31 +++++++++++++++++++++++++++++++\n 4 files changed, 31 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex cee64823cb..f70076d38e 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -183,11 +183,6 @@ void initialize_repository_version(int hash_algo)\n \tchar repo_version_string[10];\n \tint repo_version = GIT_REPO_VERSION;\n \n-#ifndef ENABLE_SHA256\n-\tif (hash_algo != GIT_HASH_SHA1)\n-\t\tdie(_(\"The hash algorithm %s is not supported in this build.\"), hash_algos[hash_algo].name);\n-#endif\n-\n \tif (hash_algo != GIT_HASH_SHA1)\n \t\trepo_version = GIT_REPO_VERSION_READ;\n \ndiff --git a/config.mak.dev b/config.mak.dev\nindex cd4a82a9eb..89b218d11a 100644\n--- a/config.mak.dev\n+++ b/config.mak.dev\n@@ -16,8 +16,6 @@ DEVELOPER_CFLAGS += -Wstrict-prototypes\n DEVELOPER_CFLAGS += -Wunused\n DEVELOPER_CFLAGS += -Wvla\n \n-DEVELOPER_CFLAGS += -DENABLE_SHA256\n-\n ifndef COMPILER_FEATURES\n COMPILER_FEATURES := $(shell ./detect-compiler $(CC))\n endif\ndiff --git a/repository.c b/repository.c\nindex 6f7f6f002b..a4174ddb06 100644\n--- a/repository.c\n+++ b/repository.c\n@@ -89,10 +89,6 @@ void repo_set_gitdir(struct repository *repo,\n void repo_set_hash_algo(struct repository *repo, int hash_algo)\n {\n \trepo->hash_algo = &hash_algos[hash_algo];\n-#ifndef ENABLE_SHA256\n-\tif (hash_algo != GIT_HASH_SHA1)\n-\t\tdie(_(\"The hash algorithm %s is not supported in this build.\"), repo->hash_algo->name);\n-#endif\n }\n \n /*\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 6d2467995e..34d2064660 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -441,6 +441,37 @@ test_expect_success 're-init from a linked worktree' '\n \t)\n '\n \n+test_expect_success 'init honors GIT_DEFAULT_HASH' '\n+\tGIT_DEFAULT_HASH=sha1 git init sha1 &&\n+\tgit -C sha1 rev-parse --show-object-format >actual &&\n+\techo sha1 >expected &&\n+\ttest_cmp expected actual &&\n+\tGIT_DEFAULT_HASH=sha256 git init sha256 &&\n+\tgit -C sha256 rev-parse --show-object-format >actual &&\n+\techo sha256 >expected &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'init honors --object-format' '\n+\tgit init --object-format=sha256 explicit &&\n+\tgit -C explicit rev-parse --show-object-format >actual &&\n+\techo sha256 >expected &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'extensions.objectFormat is not honored with repo version 0' '\n+\tgit init --object-format=sha256 explicit-v0 &&\n+\ttest_config -C explicit-v0 core.repositoryformatversion 0 &&\n+\tgit -C explicit-v0 rev-parse --show-object-format >actual &&\n+\techo sha1 >expected &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'init rejects attempts to initialize with different hash' '\n+\ttest_must_fail git -C sha1 init --object-format=sha256 &&\n+\ttest_must_fail git -C sha256 init --object-format=sha1\n+'\n+\n test_expect_success MINGW 'core.hidedotfiles = false' '\n \tgit config --global core.hidedotfiles false &&\n \trm -rf newdir &&\n"},{"id":"401310","messageId":"20200710024728.3100527-1-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":null,"subject":"[PATCH 00/38] SHA-256, part 3/3","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:50Z","receivedAt":"2020-07-10T02:49:01Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This is the final part required for the stage 4 implementation of\nSHA-256.\n\nThe beginning part of this series is mostly final test fixes, and should\nbe straightforward.  Next are two patches that are required to fix the\nremaining SHA-256 incompatibilities in our codebase, both of which were\nnecessitated by recent changes.\n\nAfter that, the meat of the series: support for reading\nextensions.objectFormat, removal of the compile-time option, and some\ntests.  We introduce a knob to control the testsuite and a wire-in for\nCI so we don't regress things in the future, and at the end, some docs.\n\nThe final patch here is the promised cleanup for test_oid_init in\nvarious places in our codebase.\n\nNote that SHA-256 repositories don't currently interoperate with SHA-1\nrepositories.  I'm working on additional patches for the pieces required\nto implement that and full stage 1, 2, and 3 support, which will be in\nfuture series.  However, it is possible to have a full SHA-256\nrepository that is fully functional after this series.  I refer the\nreader to Documentation/technical/hash-function-transition.txt for the\ndetails of the different stages.\n\nI do plan to provide a shell-based tool for easier conversion of\nrepositories with submodules at some point in the future, but all the\npieces required are already built into fast-import and fast-export.\n\nI would like to thank everyone who's contributed to the SHA-256 work\nover the years with patches, review, documentation, suggestions, and\nother contributions.  I could not possibly name all of the contributors\nhere, so I won't try.  None of this work could have been done without\nall your help.\n\nI plan to take a brief hiatus from more SHA-256 work after this and work\non some other Git- and non-Git-related projects, but I'll probably\nresume at some point before year's end.  I'm happy to provide the\nin-progress work for next steps if people are interested.\n\nI fully expect this series won't be picked up until after the release,\nso please feel free to focus on release-related activities for the\nmoment.\n\nJohannes Schindelin (1):\n  t3404: prepare 'short SHA-1 collision' tests for SHA-256\n\nbrian m. carlson (37):\n  t: make test-bloom initialize repository\n  t1001: use $ZERO_OID\n  t3305: make hash agnostic\n  t6100: make hash size independent\n  t6101: make hash size independent\n  t6301: make hash size independent\n  t6500: specify test values for SHA-256\n  t6501: avoid hard-coded objects\n  t7003: compute appropriate length constant\n  t7063: make hash size independent\n  t7201: abstract away SHA-1-specific constants\n  t7102: abstract away SHA-1-specific constants\n  t7400: make hash size independent\n  t7405: make hash size independent\n  t7506: avoid checking for SHA-1-specific constants\n  t7508: use $ZERO_OID instead of hard-coded constant\n  t8002: make hash size independent\n  t8003: make hash size independent\n  t8011: make hash size independent\n  t9300: abstract away SHA-1-specific constants\n  t9300: use $ZERO_OID instead of hard-coded object ID\n  t9301: make hash size independent\n  t9350: make hash size independent\n  t9500: ensure that algorithm info is preserved in config\n  t9700: make hash size independent\n  t5308: make test work with SHA-256\n  t0410: mark test with SHA1 prerequisite\n  http-fetch: set up git directory before parsing pack hashes\n  builtin/verify-pack: implement an --object-format option\n  setup: add support for reading extensions.objectformat\n  Enable SHA-256 support by default\n  t: add test_oid option to select hash algorithm\n  t: allow testing different hash algorithms via environment\n  t: make SHA1 prerequisite depend on default hash\n  ci: run tests with SHA-256\n  docs: add documentation for extensions.objectFormat\n  t: remove test_oid_init in tests\n\n Documentation/config.txt               |   2 +\n Documentation/config/extensions.txt    |   7 ++\n builtin/init-db.c                      |   5 -\n builtin/verify-pack.c                  |  25 ++--\n ci/run-build-and-tests.sh              |   1 +\n config.mak.dev                         |   2 -\n http-fetch.c                           |   4 +-\n repository.c                           |   4 -\n setup.c                                |  12 +-\n t/helper/test-bloom.c                  |   2 +\n t/lib-pack.sh                          |  11 +-\n t/lib-submodule-update.sh              |   1 -\n t/t0000-basic.sh                       |  15 ++-\n t/t0001-init.sh                        |  31 +++++\n t/t0410-partial-clone.sh               |   2 +-\n t/t1006-cat-file.sh                    |   2 -\n t/t1050-large.sh                       |   1 -\n t/t1091-sparse-checkout-builtin.sh     |   4 +-\n t/t1410-reflog.sh                      |   1 -\n t/t1450-fsck.sh                        |   1 -\n t/t1500-rev-parse.sh                   |   1 -\n t/t3305-notes-fanout.sh                |   2 +-\n t/t3308-notes-merge.sh                 |   1 -\n t/t3404-rebase-interactive.sh          |  49 ++++++--\n t/t3600-rm.sh                          |   1 -\n t/t3800-mktag.sh                       |   1 -\n t/t4002-diff-basic.sh                  |   2 -\n t/t4027-diff-submodule.sh              |   1 -\n t/t4134-apply-submodule.sh             |   1 -\n t/t4200-rerere.sh                      |   1 -\n t/t4211-line-log.sh                    |   1 -\n t/t5300-pack-object.sh                 |   3 +-\n t/t5302-pack-index.sh                  |   1 -\n t/t5308-pack-detect-duplicates.sh      |  20 ++--\n t/t5313-pack-bounds-checks.sh          |   1 -\n t/t5318-commit-graph.sh                |   3 +-\n t/t5319-multi-pack-index.sh            |   1 -\n t/t5324-split-commit-graph.sh          |   1 -\n t/t5504-fetch-receive-strict.sh        |   1 -\n t/t5530-upload-pack-error.sh           |   1 -\n t/t5562-http-backend-content-length.sh |   1 -\n t/t5702-protocol-v2.sh                 |   3 +-\n t/t5703-upload-pack-ref-in-want.sh     |   1 -\n t/t6006-rev-list-format.sh             |   1 -\n t/t6100-rev-list-in-order.sh           |   4 +-\n t/t6101-rev-parse-parents.sh           |   2 +-\n t/t6301-for-each-ref-errors.sh         |   2 +-\n t/t6500-gc.sh                          |  27 ++++-\n t/t6501-freshen-objects.sh             |  14 +--\n t/t7003-filter-branch.sh               |   3 +-\n t/t7063-status-untracked-cache.sh      | 155 +++++++++++++------------\n t/t7102-reset.sh                       |  93 ++++++++-------\n t/t7201-co.sh                          |   5 +-\n t/t7400-submodule-basic.sh             |  26 ++---\n t/t7405-submodule-merge.sh             |   4 +-\n t/t7506-status-submodule.sh            |  12 +-\n t/t7508-status.sh                      |   2 +-\n t/t8002-blame.sh                       |  15 +--\n t/t8003-blame-corner-cases.sh          |   3 +-\n t/t8011-blame-split-file.sh            |   2 +-\n t/t9300-fast-import.sh                 | 117 ++++++++++---------\n t/t9301-fast-import-notes.sh           |  13 +--\n t/t9350-fast-export.sh                 |  15 ++-\n t/t9500-gitweb-standalone-no-errors.sh |  22 +++-\n t/t9700/test.pl                        |   6 +-\n t/test-lib-functions.sh                |  16 ++-\n t/test-lib.sh                          |   6 +-\n 67 files changed, 472 insertions(+), 324 deletions(-)\n create mode 100644 Documentation/config/extensions.txt\n\n"},{"id":"401311","messageId":"20200710024728.3100527-37-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 36/38] ci: run tests with SHA-256","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:26Z","receivedAt":"2020-07-10T02:49:03Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Now that we have Git supporting SHA-256, we'd like to make sure that we\ndon't regress that state.  Unfortunately, it's easy to do so, so to\nhelp, let's run one of our CI jobs with SHA-256 as the default hash.\nThis will help us detect any problems that may occur.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n ci/run-build-and-tests.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh\nindex 17e25aade9..b41b527b15 100755\n--- a/ci/run-build-and-tests.sh\n+++ b/ci/run-build-and-tests.sh\n@@ -22,6 +22,7 @@ linux-gcc)\n \texport GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1\n \texport GIT_TEST_MULTI_PACK_INDEX=1\n \texport GIT_TEST_ADD_I_USE_BUILTIN=1\n+\texport GIT_TEST_DEFAULT_HASH=sha256\n \tmake test\n \t;;\n linux-gcc-4.8)\n"},{"id":"401312","messageId":"20200710024728.3100527-10-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 09/38] t6501: avoid hard-coded objects","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:59Z","receivedAt":"2020-07-10T02:49:06Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test contains hard-coded invalid object IDs.  Make it hash size\nindependent by generating invalid object IDs using the translation\ntables.  Add a setup target to ensure the output of test_oid_init is\nchecked properly.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t6501-freshen-objects.sh | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh\nindex f30b4849b6..7416ed5ffe 100755\n--- a/t/t6501-freshen-objects.sh\n+++ b/t/t6501-freshen-objects.sh\n@@ -45,6 +45,10 @@ maybe_repack () {\n \tfi\n }\n \n+test_expect_success 'setup' '\n+\ttest_oid_init\n+'\n+\n for repack in '' true; do\n \ttitle=${repack:+repack}\n \ttitle=${title:-loose}\n@@ -128,9 +132,9 @@ for repack in '' true; do\n done\n \n test_expect_success 'do not complain about existing broken links (commit)' '\n-\tcat >broken-commit <<-\\EOF &&\n-\ttree 0000000000000000000000000000000000000001\n-\tparent 0000000000000000000000000000000000000002\n+\tcat >broken-commit <<-EOF &&\n+\ttree $(test_oid 001)\n+\tparent $(test_oid 002)\n \tauthor whatever <whatever@example.com> 1234 -0000\n \tcommitter whatever <whatever@example.com> 1234 -0000\n \n@@ -143,8 +147,8 @@ test_expect_success 'do not complain about existing broken links (commit)' '\n '\n \n test_expect_success 'do not complain about existing broken links (tree)' '\n-\tcat >broken-tree <<-\\EOF &&\n-\t100644 blob 0000000000000000000000000000000000000003\tfoo\n+\tcat >broken-tree <<-EOF &&\n+\t100644 blob $(test_oid 003)\tfoo\n \tEOF\n \ttree=$(git mktree --missing <broken-tree) &&\n \tgit gc -q 2>stderr &&\n@@ -153,8 +157,8 @@ test_expect_success 'do not complain about existing broken links (tree)' '\n '\n \n test_expect_success 'do not complain about existing broken links (tag)' '\n-\tcat >broken-tag <<-\\EOF &&\n-\tobject 0000000000000000000000000000000000000004\n+\tcat >broken-tag <<-EOF &&\n+\tobject $(test_oid 004)\n \ttype commit\n \ttag broken\n \ttagger whatever <whatever@example.com> 1234 -0000\n"},{"id":"401313","messageId":"20200710024728.3100527-9-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 08/38] t6500: specify test values for SHA-256","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:58Z","receivedAt":"2020-07-10T02:49:07Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"In this test, we want to produce several blobs whose first two hex\ncharacters are \"17\", since we look at this object directory as a proxy\nfor how many loose objects there are before we need to GC.  Use\ntest_oid_cache to specify strings that will hash to the right values\nwhen turned into blobs.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t6500-gc.sh | 27 ++++++++++++++++++++++-----\n 1 file changed, 22 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 0a69a67117..4a3b8f48ac 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -10,7 +10,24 @@ test_expect_success 'setup' '\n \t# do not let the amount of physical memory affects gc\n \t# behavior, make sure we always pack everything to one pack by\n \t# default\n-\tgit config gc.bigPackThreshold 2g\n+\tgit config gc.bigPackThreshold 2g &&\n+\n+\t# These are simply values which, when hashed as a blob with a newline,\n+\t# produce a hash where the first byte is 0x17 in their respective\n+\t# algorithms.\n+\ttest_oid_cache <<-EOF\n+\tobj1 sha1:263\n+\tobj1 sha256:34\n+\n+\tobj2 sha1:410\n+\tobj2 sha256:174\n+\n+\tobj3 sha1:523\n+\tobj3 sha256:313\n+\n+\tobj4 sha1:790\n+\tobj4 sha256:481\n+\tEOF\n '\n \n test_expect_success 'gc empty repository' '\n@@ -85,13 +102,13 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre\n \t# We need to create two object whose sha1s start with 17\n \t# since this is what git gc counts.  As it happens, these\n \t# two blobs will do so.\n-\ttest_commit 263 &&\n-\ttest_commit 410 &&\n+\ttest_commit \"$(test_oid obj1)\" &&\n+\ttest_commit \"$(test_oid obj2)\" &&\n \t# Our first gc will create a pack; our second will create a second pack\n \tgit gc --auto &&\n \tls .git/objects/pack | sort >existing_packs &&\n-\ttest_commit 523 &&\n-\ttest_commit 790 &&\n+\ttest_commit \"$(test_oid obj3)\" &&\n+\ttest_commit \"$(test_oid obj4)\" &&\n \n \tgit gc --auto 2>err &&\n \ttest_i18ngrep ! \"^warning:\" err &&\n"},{"id":"401314","messageId":"20200710024728.3100527-7-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 06/38] t6101: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:46:56Z","receivedAt":"2020-07-10T02:49:07Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Use $OID_REGEX instead of a hard-coded regular expression.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t6101-rev-parse-parents.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh\nindex 7683e4a114..7531262a5e 100755\n--- a/t/t6101-rev-parse-parents.sh\n+++ b/t/t6101-rev-parse-parents.sh\n@@ -34,7 +34,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'start is valid' '\n-\tgit rev-parse start | grep \"^[0-9a-f]\\{40\\}$\"\n+\tgit rev-parse start | grep \"^$OID_REGEX$\"\n '\n \n test_expect_success 'start^0' '\n"},{"id":"401315","messageId":"20200710024728.3100527-36-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 35/38] t: make SHA1 prerequisite depend on default hash","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:25Z","receivedAt":"2020-07-10T02:49:08Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Currently, the SHA1 prerequisite depends on the output of git\nhash-object.  However, in order for that to produce sane behavior, we\nmust be in a repository.  If we are not, the default will remain SHA-1,\nand we'll produce wrong results if we're using SHA-256 for the testsuite\nbut the test assertion starts when we're not in a repository.\n\nCheck the environment variable we use for this purpose, leaving it to\ndefault to SHA-1 if none is specified.\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 307bb2207e..30ab0428fb 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1689,7 +1689,8 @@ test_lazy_prereq CURL '\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+\ttest $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&\n+\t([ -z \"$GIT_DEFAULT_HASH\" ] || [ \"$GIT_DEFAULT_HASH\" = \"sha1\" ])\n '\n \n test_lazy_prereq REBASE_P '\n"},{"id":"401316","messageId":"20200710024728.3100527-39-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 38/38] t: remove test_oid_init in tests","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:28Z","receivedAt":"2020-07-10T02:49:09Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Now that we call test_oid_init in the setup for all test scripts,\nthere's no point in calling it individually.  Remove all of the places\nwhere we've done so to help keep tests tidy.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/lib-pack.sh                          | 3 ---\n t/lib-submodule-update.sh              | 1 -\n t/t0000-basic.sh                       | 4 ----\n t/t1006-cat-file.sh                    | 2 --\n t/t1050-large.sh                       | 1 -\n t/t1410-reflog.sh                      | 1 -\n t/t1450-fsck.sh                        | 1 -\n t/t1500-rev-parse.sh                   | 1 -\n t/t3305-notes-fanout.sh                | 1 -\n t/t3308-notes-merge.sh                 | 1 -\n t/t3404-rebase-interactive.sh          | 1 -\n t/t3600-rm.sh                          | 1 -\n t/t3800-mktag.sh                       | 1 -\n t/t4002-diff-basic.sh                  | 2 --\n t/t4027-diff-submodule.sh              | 1 -\n t/t4134-apply-submodule.sh             | 1 -\n t/t4200-rerere.sh                      | 1 -\n t/t4211-line-log.sh                    | 1 -\n t/t5300-pack-object.sh                 | 3 +--\n t/t5302-pack-index.sh                  | 1 -\n t/t5313-pack-bounds-checks.sh          | 1 -\n t/t5318-commit-graph.sh                | 3 +--\n t/t5319-multi-pack-index.sh            | 1 -\n t/t5324-split-commit-graph.sh          | 1 -\n t/t5504-fetch-receive-strict.sh        | 1 -\n t/t5530-upload-pack-error.sh           | 1 -\n t/t5562-http-backend-content-length.sh | 1 -\n t/t5702-protocol-v2.sh                 | 1 -\n t/t5703-upload-pack-ref-in-want.sh     | 1 -\n t/t6006-rev-list-format.sh             | 1 -\n t/t6301-for-each-ref-errors.sh         | 1 -\n t/t6501-freshen-objects.sh             | 4 ----\n t/t7003-filter-branch.sh               | 1 -\n t/t8002-blame.sh                       | 4 ----\n t/t8003-blame-corner-cases.sh          | 2 --\n t/t9301-fast-import-notes.sh           | 1 -\n t/t9350-fast-export.sh                 | 2 --\n 37 files changed, 2 insertions(+), 54 deletions(-)\n\ndiff --git a/t/lib-pack.sh b/t/lib-pack.sh\nindex 0c799d53c6..bb8938ccbe 100644\n--- a/t/lib-pack.sh\n+++ b/t/lib-pack.sh\n@@ -35,8 +35,6 @@ pack_header () {\n # have hardcoded some well-known objects. See the case statements below for the\n # complete list.\n pack_obj () {\n-\ttest_oid_init\n-\n \tcase \"$1\" in\n \t# empty blob\n \t$EMPTY_BLOB)\n@@ -121,7 +119,6 @@ pack_obj () {\n \n # Compute and append pack trailer to \"$1\"\n pack_trailer () {\n-\ttest_oid_init &&\n \ttest-tool $(test_oid algo) -b <\"$1\" >trailer.tmp &&\n \tcat trailer.tmp >>\"$1\" &&\n \trm -f trailer.tmp\ndiff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh\nindex 07c822c8ff..87a759149f 100644\n--- a/t/lib-submodule-update.sh\n+++ b/t/lib-submodule-update.sh\n@@ -196,7 +196,6 @@ test_git_directory_exists () {\n # the submodule repo if it doesn't exist and configures the most problematic\n # settings for diff.ignoreSubmodules.\n prolog () {\n-\ttest_oid_init &&\n \t(test -d submodule_update_repo || create_lib_submodule_repo) &&\n \ttest_config_global diff.ignoreSubmodules all &&\n \ttest_config diff.ignoreSubmodules all\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 47d6b502c2..34c64c59f3 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -891,10 +891,6 @@ test_expect_success 'test_atexit is run' \"\n \ttest_path_is_missing also-clean-atexit\n \"\n \n-test_expect_success 'test_oid setup' '\n-\ttest_oid_init\n-'\n-\n test_expect_success 'test_oid provides sane info by default' '\n \ttest_oid zero >actual &&\n \tgrep \"^00*\\$\" actual &&\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 43c4be1e5e..2f501d2dc9 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -140,8 +140,6 @@ test_expect_success '--batch-check without %(rest) considers whole line' '\n \ttest_cmp expect actual\n '\n \n-test_oid_init\n-\n tree_sha1=$(git write-tree)\n tree_size=$(($(test_oid rawsz) + 13))\n tree_pretty_content=\"100644 blob $hello_sha1\thello\"\ndiff --git a/t/t1050-large.sh b/t/t1050-large.sh\nindex 6a56d1ca24..61e89a8071 100755\n--- a/t/t1050-large.sh\n+++ b/t/t1050-large.sh\n@@ -12,7 +12,6 @@ file_size () {\n }\n \n test_expect_success setup '\n-\ttest_oid_init &&\n \t# clone does not allow us to pass core.bigfilethreshold to\n \t# new repos, so set core.bigfilethreshold globally\n \tgit config --global core.bigfilethreshold 200k &&\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 76d9b744a6..730a43d9dd 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -54,7 +54,6 @@ check_dont_have () {\n }\n \n test_expect_success setup '\n-\ttest_oid_init &&\n \tmkdir -p A/B &&\n \techo rat >C &&\n \techo ox >A/D &&\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 344a2aad82..e81f1cbf0e 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -9,7 +9,6 @@ test_description='git fsck random collection of tests\n . ./test-lib.sh\n \n test_expect_success setup '\n-\ttest_oid_init &&\n \tgit config gc.auto 0 &&\n \tgit config i18n.commitencoding ISO-8859-1 &&\n \ttest_commit A fileA one &&\ndiff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh\nindex 603019b541..408b97d5af 100755\n--- a/t/t1500-rev-parse.sh\n+++ b/t/t1500-rev-parse.sh\n@@ -59,7 +59,6 @@ test_rev_parse () {\n ROOT=$(pwd)\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \tmkdir -p sub/dir work &&\n \tcp -R .git repo.git\n '\ndiff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh\nindex d5a94b7174..94c1b02251 100755\n--- a/t/t3305-notes-fanout.sh\n+++ b/t/t3305-notes-fanout.sh\n@@ -31,7 +31,6 @@ all_notes_have_fanout() {\n }\n \n test_expect_success 'tweak test environment' '\n-\ttest_oid_init &&\n \tgit checkout -b nondeterminism &&\n \ttest_commit A &&\n \tgit checkout --orphan with_notes;\ndiff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh\nindex 790e292966..d69c84c640 100755\n--- a/t/t3308-notes-merge.sh\n+++ b/t/t3308-notes-merge.sh\n@@ -22,7 +22,6 @@ test_expect_success setup '\n \t# Copy notes to remote-notes\n \tgit fetch . refs/notes/*:refs/remote-notes/origin/* &&\n \n-\ttest_oid_init &&\n \ttest_oid_cache <<-EOF\n \thash4a sha1:5e93d24084d32e1cb61f7070505b9d2530cca987\n \thash3a sha1:8366731eeee53787d2bdf8fc1eff7d94757e8da0\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 2fb2c581cb..9744e88760 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -30,7 +30,6 @@ Initial setup:\n . \"$TEST_DIRECTORY\"/lib-rebase.sh\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \ttest_commit A file1 &&\n \ttest_commit B file1 &&\n \ttest_commit C file2 &&\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex f2c0168941..efec8d13b6 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -241,7 +241,6 @@ test_expect_success 'refresh index before checking if it is up-to-date' '\n '\n \n test_expect_success 'choking \"git rm\" should not let it die with cruft' '\n-\ttest_oid_init &&\n \tgit reset -q --hard &&\n \ttest_when_finished \"rm -f .git/index.lock && git reset -q --hard\" &&\n \ti=0 &&\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 64dcc5ec28..d696aa4e52 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -23,7 +23,6 @@ check_verify_failure () {\n # first create a commit, so we have a valid object/type\n # for the tag.\n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \techo Hello >A &&\n \tgit update-index --add A &&\n \tgit commit -m \"Initial commit\" &&\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex cbcdd10464..6a9f010197 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -10,8 +10,6 @@ test_description='Test diff raw-output.\n \n . \"$TEST_DIRECTORY\"/lib-read-tree-m-3way.sh\n \n-test_oid_init\n-\n test_oid_cache <<\\EOF\n aa_1 sha1:ccba72ad3888a3520b39efcf780b9ee64167535d\n aa_1 sha256:9febfbf18197819b2735c45291f138525d2476d59470f98239647544586ba403\ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex e29deaf4a5..d7145ccca4 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -6,7 +6,6 @@ test_description='difference in submodules'\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n test_expect_success setup '\n-\ttest_oid_init &&\n \ttest_tick &&\n \ttest_create_repo sub &&\n \t(\ndiff --git a/t/t4134-apply-submodule.sh b/t/t4134-apply-submodule.sh\nindex 99ed4cc546..d1c16ba33c 100755\n--- a/t/t4134-apply-submodule.sh\n+++ b/t/t4134-apply-submodule.sh\n@@ -8,7 +8,6 @@ test_description='git apply submodule tests'\n . ./test-lib.sh\n \n test_expect_success setup '\n-\ttest_oid_init &&\n \tcat > create-sm.patch <<EOF &&\n diff --git a/dir/sm b/dir/sm\n new file mode 160000\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex 831d424c47..d94d25e4f0 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -25,7 +25,6 @@ test_description='git rerere\n . ./test-lib.sh\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \tcat >a1 <<-\\EOF &&\n \tSome title\n \t==========\ndiff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh\nindex e186c83250..2d1d7b5d19 100755\n--- a/t/t4211-line-log.sh\n+++ b/t/t4211-line-log.sh\n@@ -4,7 +4,6 @@ test_description='test log -L'\n . ./test-lib.sh\n \n test_expect_success 'setup (import history)' '\n-\ttest_oid_init &&\n \tgit fast-import < \"$TEST_DIRECTORY\"/t4211/history.export &&\n \tgit reset --hard\n '\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 746cdb626e..cf9f91c941 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -12,8 +12,7 @@ TRASH=$(pwd)\n \n test_expect_success \\\n     'setup' \\\n-    'test_oid_init &&\n-     rm -f .git/index* &&\n+    'rm -f .git/index* &&\n      perl -e \"print \\\"a\\\" x 4096;\" > a &&\n      perl -e \"print \\\"b\\\" x 4096;\" > b &&\n      perl -e \"print \\\"c\\\" x 4096;\" > c &&\ndiff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh\nindex 8981c9b90e..119494bd64 100755\n--- a/t/t5302-pack-index.sh\n+++ b/t/t5302-pack-index.sh\n@@ -7,7 +7,6 @@ test_description='pack index with 64-bit offsets and object CRC'\n . ./test-lib.sh\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \trawsz=$(test_oid rawsz) &&\n \trm -rf .git &&\n \tgit init &&\ndiff --git a/t/t5313-pack-bounds-checks.sh b/t/t5313-pack-bounds-checks.sh\nindex 2a4557efc2..535313e4dc 100755\n--- a/t/t5313-pack-bounds-checks.sh\n+++ b/t/t5313-pack-bounds-checks.sh\n@@ -45,7 +45,6 @@ extended_table () {\n }\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \ttest_oid_cache <<-EOF\n \toid000 sha1:1485\n \toid000 sha256:4222\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 26f332d6a3..67f2663c7c 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -10,8 +10,7 @@ test_expect_success 'setup full repo' '\n \tcd \"$TRASH_DIRECTORY/full\" &&\n \tgit init &&\n \tgit config core.commitGraph true &&\n-\tobjdir=\".git/objects\" &&\n-\ttest_oid_init\n+\tobjdir=\".git/objects\"\n '\n \n test_expect_success POSIXPERM 'tweak umask for modebit tests' '\ndiff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh\nindex 7214cab36c..7dfff0f8f4 100755\n--- a/t/t5319-multi-pack-index.sh\n+++ b/t/t5319-multi-pack-index.sh\n@@ -29,7 +29,6 @@ midx_read_expect () {\n }\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \ttest_oid_cache <<-EOF\n \tidxoff sha1:2999\n \tidxoff sha256:3739\ndiff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh\nindex 269d0964a3..3a63639fbc 100755\n--- a/t/t5324-split-commit-graph.sh\n+++ b/t/t5324-split-commit-graph.sh\n@@ -12,7 +12,6 @@ test_expect_success 'setup repo' '\n \tgit config gc.writeCommitGraph false &&\n \tinfodir=\".git/objects/info\" &&\n \tgraphdir=\"$infodir/commit-graphs\" &&\n-\ttest_oid_init &&\n \ttest_oid_cache <<-EOM\n \tshallow sha1:1760\n \tshallow sha256:2064\ndiff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh\nindex a32efe2b6c..1a16ac4c0d 100755\n--- a/t/t5504-fetch-receive-strict.sh\n+++ b/t/t5504-fetch-receive-strict.sh\n@@ -4,7 +4,6 @@ test_description='fetch/receive strict mode'\n . ./test-lib.sh\n \n test_expect_success 'setup and inject \"corrupt or missing\" object' '\n-\ttest_oid_init &&\n \techo hello >greetings &&\n \tgit add greetings &&\n \tgit commit -m greetings &&\ndiff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh\nindex 4ce9a9f704..205a2631e7 100755\n--- a/t/t5530-upload-pack-error.sh\n+++ b/t/t5530-upload-pack-error.sh\n@@ -14,7 +14,6 @@ corrupt_repo () {\n }\n \n test_expect_success 'setup and corrupt repository' '\n-\ttest_oid_init &&\n \techo file >file &&\n \tgit add file &&\n \tgit rev-parse :file &&\ndiff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\nindex c6ec625497..e5d3d15ba8 100755\n--- a/t/t5562-http-backend-content-length.sh\n+++ b/t/t5562-http-backend-content-length.sh\n@@ -46,7 +46,6 @@ ssize_b100dots() {\n }\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \tHTTP_CONTENT_ENCODING=\"identity\" &&\n \texport HTTP_CONTENT_ENCODING &&\n \tgit config http.receivepack true &&\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 7fc22171e7..5a60fbe3ed 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -13,7 +13,6 @@ start_git_daemon --export-all --enable=receive-pack\n daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent\n \n test_expect_success 'create repo to be served by git-daemon' '\n-\ttest_oid_init &&\n \tgit init \"$daemon_parent\" &&\n \ttest_commit -C \"$daemon_parent\" one\n '\ndiff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh\nindex 748282f058..d9ecf0f4a9 100755\n--- a/t/t5703-upload-pack-ref-in-want.sh\n+++ b/t/t5703-upload-pack-ref-in-want.sh\n@@ -43,7 +43,6 @@ write_command () {\n #             \\ | /\n #               a\n test_expect_success 'setup repository' '\n-\ttest_oid_init &&\n \ttest_commit a &&\n \tgit checkout -b o/foo &&\n \ttest_commit b &&\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex 7e82e43a63..bc95da8a5f 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -32,7 +32,6 @@ changed_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n truncate_count=20\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \t: >foo &&\n \tgit add foo &&\n \tgit config i18n.commitEncoding $test_encoding &&\ndiff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh\nindex d545a725a5..809854fc0c 100755\n--- a/t/t6301-for-each-ref-errors.sh\n+++ b/t/t6301-for-each-ref-errors.sh\n@@ -7,7 +7,6 @@ test_description='for-each-ref errors for broken refs'\n ZEROS=$ZERO_OID\n \n test_expect_success setup '\n-\ttest_oid_init &&\n \tMISSING=$(test_oid deadbeef) &&\n \tgit commit --allow-empty -m \"Initial\" &&\n \tgit tag testtag &&\ndiff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh\nindex 7416ed5ffe..8a3bb4105b 100755\n--- a/t/t6501-freshen-objects.sh\n+++ b/t/t6501-freshen-objects.sh\n@@ -45,10 +45,6 @@ maybe_repack () {\n \tfi\n }\n \n-test_expect_success 'setup' '\n-\ttest_oid_init\n-'\n-\n for repack in '' true; do\n \ttitle=${repack:+repack}\n \ttitle=${title:-loose}\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex beeb2b855a..36477cb1f4 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -5,7 +5,6 @@ test_description='git filter-branch'\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n \ttest_commit A &&\n \tGIT_COMMITTER_DATE=\"@0 +0000\" GIT_AUTHOR_DATE=\"@0 +0000\" &&\n \ttest_commit --notick B &&\ndiff --git a/t/t8002-blame.sh b/t/t8002-blame.sh\nindex 557c886559..aed4a923a3 100755\n--- a/t/t8002-blame.sh\n+++ b/t/t8002-blame.sh\n@@ -6,10 +6,6 @@ test_description='git blame'\n PROG='git blame -c'\n . \"$TEST_DIRECTORY\"/annotate-tests.sh\n \n-test_expect_success 'setup' '\n-\ttest_oid_init\n-'\n-\n test_expect_success 'blame untracked file in empty repo' '\n \t>untracked &&\n \ttest_must_fail git blame untracked\ndiff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\nindex ebe79aa4ea..b871dd4f86 100755\n--- a/t/t8003-blame-corner-cases.sh\n+++ b/t/t8003-blame-corner-cases.sh\n@@ -6,8 +6,6 @@ test_description='git blame corner cases'\n pick_fc='s/^[0-9a-f^]* *\\([^ ]*\\) *(\\([^ ]*\\) .*/\\1-\\2/'\n \n test_expect_success setup '\n-\ttest_oid_init &&\n-\n \techo A A A A A >one &&\n \techo B B B B B >two &&\n \techo C C C C C >tres &&\ndiff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh\nindex 9d1aaac980..ff3338abc0 100755\n--- a/t/t9301-fast-import-notes.sh\n+++ b/t/t9301-fast-import-notes.sh\n@@ -71,7 +71,6 @@ EOF\n INPUT_END\n \n test_expect_success 'set up master branch' '\n-\ttest_oid_init &&\n \tgit fast-import <input &&\n \tgit whatchanged master\n '\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex ba79db6a17..210b9bc4b6 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -7,8 +7,6 @@ test_description='git fast-export'\n . ./test-lib.sh\n \n test_expect_success 'setup' '\n-\ttest_oid_init &&\n-\n \techo break it > file0 &&\n \tgit add file0 &&\n \ttest_tick &&\n"},{"id":"401317","messageId":"20200710024728.3100527-32-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 31/38] setup: add support for reading extensions.objectformat","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:21Z","receivedAt":"2020-07-10T02:49:10Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"The transition plan specifies extensions.objectFormat as the indication\nthat we're using a given hash in a certain repo.  Read this as one of\nthe extensions we support.  If the user has specified an invalid value,\nfail.\n\nEnsure that we don't use the value of the extension if the repository\nformat version is 0.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n setup.c | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/setup.c b/setup.c\nindex dbac2eabe8..4dbfe34c03 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -471,7 +471,16 @@ static int check_repo_format(const char *var, const char *value, void *vdata)\n \t\t\tdata->partial_clone = xstrdup(value);\n \t\t} else if (!strcmp(ext, \"worktreeconfig\"))\n \t\t\tdata->worktree_config = git_config_bool(var, value);\n-\t\telse\n+\t\telse if (!strcmp(ext, \"objectformat\")) {\n+\t\t\tint format;\n+\n+\t\t\tif (!value)\n+\t\t\t\treturn config_error_nonbool(var);\n+\t\t\tformat = hash_algo_by_name(value);\n+\t\t\tif (format == GIT_HASH_UNKNOWN)\n+\t\t\t\treturn error(\"invalid value for 'extensions.objectformat'\");\n+\t\t\tdata->hash_algo = format;\n+\t\t} else\n \t\t\tstring_list_append(&data->unknown_extensions, ext);\n \t}\n \n@@ -515,6 +524,7 @@ static int check_repository_format_gently(const char *gitdir, struct repository_\n \t\trepository_format_precious_objects = 0;\n \t\tset_repository_format_partial_clone(NULL);\n \t\trepository_format_worktree_config = 0;\n+\t\tcandidate->hash_algo = GIT_HASH_SHA1;\n \t}\n \tstring_list_clear(&candidate->unknown_extensions, 0);\n \n"},{"id":"401318","messageId":"20200710024728.3100527-26-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 25/38] t9500: ensure that algorithm info is preserved in config","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:15Z","receivedAt":"2020-07-10T02:49:13Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"When we use a hash algorithm other than SHA-1, it's important to\npreserve the hash-related values in the config file, but this test\noverwrites the config file with a new one. Ensure we copy these values\nproperly from the old config to the new one so that the repository can\nbe read if it's using SHA-256.\n\nNote that if there is no extensions.objectFormat value set, git config\nwill return unsuccessfully if we try to read it; since this is not an\nerror for us, use test_might_fail.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t9500-gitweb-standalone-no-errors.sh | 22 ++++++++++++++++------\n 1 file changed, 16 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 267ddc997d..b484e3e250 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -621,12 +621,22 @@ test_expect_success \\\n \t git config gitweb.snapshot \"zip,tgz, tbz2\" &&\n \t gitweb_run \"p=.git;a=tree\"'\n \n-cat >.git/config <<\\EOF\n-# testing noval and alternate separator\n-[gitweb]\n-\tblame\n-\tsnapshot = zip tgz\n-EOF\n+test_expect_success 'setup' '\n+\tversion=$(git config core.repositoryformatversion) &&\n+\talgo=$(test_might_fail git config extensions.objectformat) &&\n+\tcat >.git/config <<-\\EOF &&\n+\t# testing noval and alternate separator\n+\t[gitweb]\n+\t\tblame\n+\t\tsnapshot = zip tgz\n+\tEOF\n+\tgit config core.repositoryformatversion \"$version\" &&\n+\tif test -n \"$algo\"\n+\tthen\n+\t\tgit config extensions.objectformat \"$algo\"\n+\tfi\n+'\n+\n test_expect_success \\\n \t'config override: tree view, features enabled in repo config (2)' \\\n \t'gitweb_run \"p=.git;a=tree\"'\n"},{"id":"401319","messageId":"20200710024728.3100527-23-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 22/38] t9300: use $ZERO_OID instead of hard-coded object ID","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:12Z","receivedAt":"2020-07-10T02:49:14Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t9300-fast-import.sh | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 69d6fa4127..f4b3f5eaf9 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -92,7 +92,7 @@ test_expect_success 'A: create pack from stdin' '\n \tEOF\n \n \treset refs/tags/to-be-deleted\n-\tfrom 0000000000000000000000000000000000000000\n+\tfrom $ZERO_OID\n \n \ttag nested\n \tmark :6\n@@ -102,7 +102,7 @@ test_expect_success 'A: create pack from stdin' '\n \tEOF\n \n \treset refs/tags/nested\n-\tfrom 0000000000000000000000000000000000000000\n+\tfrom $ZERO_OID\n \n \ttag nested\n \tmark :7\n@@ -285,7 +285,7 @@ test_expect_success 'A: verify pack' '\n \n test_expect_success 'A: verify diff' '\n \tcat >expect <<-EOF &&\n-\t:000000 100755 0000000000000000000000000000000000000000 $(git rev-parse --verify master:file2) A\tcopy-of-file2\n+\t:000000 100755 $ZERO_OID $(git rev-parse --verify master:file2) A\tcopy-of-file2\n \tEOF\n \tgit diff-tree -M -r master verify--import-marks >actual &&\n \tcompare_diff_raw expect actual &&\n@@ -364,7 +364,7 @@ test_expect_success 'B: fail on invalid blob sha1' '\n \tCOMMIT\n \n \tfrom refs/heads/master\n-\tM 755 0000000000000000000000000000000000000001 zero1\n+\tM 755 $(echo $ZERO_OID | sed -e \"s/0$/1/\") zero1\n \n \tINPUT_END\n \n@@ -619,8 +619,8 @@ test_expect_success 'D: validate new files added' '\n \tf5id=$(echo \"$file5_data\" | git hash-object --stdin) &&\n \tf6id=$(echo \"$file6_data\" | git hash-object --stdin) &&\n \tcat >expect <<-EOF &&\n-\t:000000 100755 0000000000000000000000000000000000000000 $f6id A\tnewdir/exec.sh\n-\t:000000 100644 0000000000000000000000000000000000000000 $f5id A\tnewdir/interesting\n+\t:000000 100755 $ZERO_OID $f6id A\tnewdir/exec.sh\n+\t:000000 100644 $ZERO_OID $f5id A\tnewdir/interesting\n \tEOF\n \tgit diff-tree -M -r branch^ branch >actual &&\n \tcompare_diff_raw expect actual\n@@ -2732,7 +2732,7 @@ test_expect_success 'R: corrupt lines do not mess marks file' '\n \trm -f io.marks &&\n \tblob=$(echo hi | git hash-object --stdin) &&\n \tcat >expect <<-EOF &&\n-\t:3 0000000000000000000000000000000000000000\n+\t:3 $ZERO_OID\n \t:1 $blob\n \t:2 $blob\n \tEOF\n@@ -3083,7 +3083,7 @@ test_expect_success 'T: delete branch' '\n \tgit branch to-delete &&\n \tgit fast-import <<-EOF &&\n \treset refs/heads/to-delete\n-\tfrom 0000000000000000000000000000000000000000\n+\tfrom $ZERO_OID\n \tEOF\n \ttest_must_fail git rev-parse --verify refs/heads/to-delete\n '\n"},{"id":"401320","messageId":"20200710024728.3100527-27-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 26/38] t9700: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:16Z","receivedAt":"2020-07-10T02:49:15Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"The Perl test script for t9700 was matching on exactly 40 hex\ncharacters.  With SHA-256, we'll have 64 hex-character object IDs.\nCreate a variable with a regex which matches exactly 40 or 64 hex\ncharacters and use that to match the output.  Note that both of the uses\nof this can be anchored, which makes the code simpler, so do that as\nwell.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t9700/test.pl | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9700/test.pl b/t/t9700/test.pl\nindex 34cd01366f..071ff6d82a 100755\n--- a/t/t9700/test.pl\n+++ b/t/t9700/test.pl\n@@ -23,6 +23,8 @@ sub adjust_dirsep {\n \treturn $path;\n }\n \n+my $oid_re = qr/^[0-9a-fA-F]{40}(?:[0-9a-fA-F]{24})?$/;\n+\n BEGIN { use_ok('Git') }\n \n # set up\n@@ -93,7 +95,7 @@ sub adjust_dirsep {\n open TEMPFILE, \">$tmpfile\" or die \"Can't open $tmpfile: $!\";\n print TEMPFILE my $test_text = \"test blob, to be inserted\\n\";\n close TEMPFILE or die \"Failed writing to $tmpfile: $!\";\n-like(our $newhash = $r->hash_and_insert_object($tmpfile), qr/[0-9a-fA-F]{40}/,\n+like(our $newhash = $r->hash_and_insert_object($tmpfile), $oid_re,\n      \"hash_and_insert_object: returns hash\");\n open TEMPFILE, \"+>$tmpfile\" or die \"Can't open $tmpfile: $!\";\n is($r->cat_blob($newhash, \\*TEMPFILE), length $test_text, \"cat_blob: roundtrip size\");\n@@ -119,7 +121,7 @@ sub adjust_dirsep {\n \n # commands in sub directory\n my $last_commit = $r2->command_oneline(qw(rev-parse --verify HEAD));\n-like($last_commit, qr/^[0-9a-fA-F]{40}$/, 'rev-parse returned hash');\n+like($last_commit, $oid_re, 'rev-parse returned hash');\n my $dir_commit = $r2->command_oneline('log', '-n1', '--pretty=format:%H', '.');\n isnt($last_commit, $dir_commit, 'log . does not show last commit');\n \n"},{"id":"401321","messageId":"20200710024728.3100527-25-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 24/38] t9350: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:14Z","receivedAt":"2020-07-10T02:49:16Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test checks for several commit object sizes to verify that objects\nare encoded as expected. However, the size of a commit object differs\nbetween SHA-1 and SHA-256, since each contains a hex representation of\nthe tree's object ID. Since these are root commits, compute the size of\neach commit by using a constant plus the size of a single hex object ID.\n\nIn addition, use $ZERO_OID instead of a hard-coded object ID.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t9350-fast-export.sh | 15 ++++++++-------\n 1 file changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 690c90fb82..ba79db6a17 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -7,6 +7,7 @@ test_description='git fast-export'\n . ./test-lib.sh\n \n test_expect_success 'setup' '\n+\ttest_oid_init &&\n \n \techo break it > file0 &&\n \tgit add file0 &&\n@@ -132,12 +133,12 @@ test_expect_success 'reencoding iso-8859-7' '\n \tsed \"s/wer/i18n/\" iso-8859-7.fi |\n \t\t(cd new &&\n \t\t git fast-import &&\n-\t\t # The commit object, if not re-encoded, would be 240 bytes.\n+\t\t # The commit object, if not re-encoded, would be 200 bytes plus hash.\n \t\t # Removing the \"encoding iso-8859-7\\n\" header drops 20 bytes.\n \t\t # Re-encoding the Pi character from \\xF0 (\\360) in iso-8859-7\n \t\t # to \\xCF\\x80 (\\317\\200) in UTF-8 adds a byte.  Check for\n \t\t # the expected size.\n-\t\t test 221 -eq \"$(git cat-file -s i18n)\" &&\n+\t\t test $(($(test_oid hexsz) + 181)) -eq \"$(git cat-file -s i18n)\" &&\n \t\t # ...and for the expected translation of bytes.\n \t\t git cat-file commit i18n >actual &&\n \t\t grep $(printf \"\\317\\200\") actual &&\n@@ -164,12 +165,12 @@ test_expect_success 'preserving iso-8859-7' '\n \tsed \"s/wer/i18n-no-recoding/\" iso-8859-7.fi |\n \t\t(cd new &&\n \t\t git fast-import &&\n-\t\t # The commit object, if not re-encoded, is 240 bytes.\n+\t\t # The commit object, if not re-encoded, is 200 bytes plus hash.\n \t\t # Removing the \"encoding iso-8859-7\\n\" header would drops 20\n \t\t # bytes.  Re-encoding the Pi character from \\xF0 (\\360) in\n \t\t # iso-8859-7 to \\xCF\\x80 (\\317\\200) in UTF-8 adds a byte.\n \t\t # Check for the expected size...\n-\t\t test 240 -eq \"$(git cat-file -s i18n-no-recoding)\" &&\n+\t\t test $(($(test_oid hexsz) + 200)) -eq \"$(git cat-file -s i18n-no-recoding)\" &&\n \t\t # ...as well as the expected byte.\n \t\t git cat-file commit i18n-no-recoding >actual &&\n \t\t grep $(printf \"\\360\") actual &&\n@@ -192,7 +193,7 @@ test_expect_success 'encoding preserved if reencoding fails' '\n \t\t grep ^encoding actual &&\n \t\t # Verify that the commit has the expected size; i.e.\n \t\t # that no bytes were re-encoded to a different encoding.\n-\t\t test 252 -eq \"$(git cat-file -s i18n-invalid)\" &&\n+\t\t test $(($(test_oid hexsz) + 212)) -eq \"$(git cat-file -s i18n-invalid)\" &&\n \t\t # ...and check for the original special bytes\n \t\t grep $(printf \"\\360\") actual &&\n \t\t grep $(printf \"\\377\") actual)\n@@ -694,7 +695,7 @@ test_expect_success 'delete ref because entire history excluded' '\n \tgit fast-export to-delete ^to-delete >actual &&\n \tcat >expected <<-EOF &&\n \treset refs/heads/to-delete\n-\tfrom 0000000000000000000000000000000000000000\n+\tfrom $ZERO_OID\n \n \tEOF\n \ttest_cmp expected actual\n@@ -704,7 +705,7 @@ test_expect_success 'delete refspec' '\n \tgit fast-export --refspec :refs/heads/to-delete >actual &&\n \tcat >expected <<-EOF &&\n \treset refs/heads/to-delete\n-\tfrom 0000000000000000000000000000000000000000\n+\tfrom $ZERO_OID\n \n \tEOF\n \ttest_cmp expected actual\n"},{"id":"401322","messageId":"20200710024728.3100527-21-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 20/38] t8011: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:10Z","receivedAt":"2020-07-10T02:49:17Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Allow lines which start with either a 40- or 64-character hex object ID,\nto allow for both SHA-1 and SHA-256.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t8011-blame-split-file.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t8011-blame-split-file.sh b/t/t8011-blame-split-file.sh\nindex 831125047b..8a4626d496 100755\n--- a/t/t8011-blame-split-file.sh\n+++ b/t/t8011-blame-split-file.sh\n@@ -54,7 +54,7 @@ test_expect_success 'setup simulated porcelain' '\n \tcat >read-porcelain.pl <<-\\EOF\n \tmy $field = shift;\n \twhile (<>) {\n-\t\tif (/^[0-9a-f]{40} /) {\n+\t\tif (/^[0-9a-f]{40,64} /) {\n \t\t\tflush();\n \t\t\t$hash = $&;\n \t\t} elsif (/^$field (.*)/) {\n"},{"id":"401323","messageId":"20200710024728.3100527-31-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 30/38] builtin/verify-pack: implement an --object-format option","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:20Z","receivedAt":"2020-07-10T02:49:22Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"A recently added test in t5702 started using git verify-pack outside of\na repository.  While this poses no problems with SHA-1, with SHA-256 we\nimplicitly rely on the setup of the repository to initialize our hash\nalgorithm settings.\n\nSince we're not in a repository here, we need to provide git verify-pack\nhelp to set things up properly.  git index-pack already knows an\n--object-format option, so let's accept one as well and pass it down to\nour git index-pack invocation.  Since this argument is optional, let's\ndynamically determine the proper location to insert it into the array.\nFinally, let's make t5702 pass the proper argument on down to its git\nverify-pack caller.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n builtin/verify-pack.c  | 25 +++++++++++++++++--------\n t/t5702-protocol-v2.sh |  2 +-\n 2 files changed, 18 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/verify-pack.c b/builtin/verify-pack.c\nindex c2a1a5c504..c4090102a9 100644\n--- a/builtin/verify-pack.c\n+++ b/builtin/verify-pack.c\n@@ -7,21 +7,27 @@\n #define VERIFY_PACK_VERBOSE 01\n #define VERIFY_PACK_STAT_ONLY 02\n \n-static int verify_one_pack(const char *path, unsigned int flags)\n+static int verify_one_pack(const char *path, unsigned int flags, const char *hash_algo)\n {\n \tstruct child_process index_pack = CHILD_PROCESS_INIT;\n-\tconst char *argv[] = {\"index-pack\", NULL, NULL, NULL };\n-\tstruct strbuf arg = STRBUF_INIT;\n+\tconst char *argv[] = {\"index-pack\", NULL, NULL, NULL, NULL };\n+\tstruct strbuf arg = STRBUF_INIT, hash_arg = STRBUF_INIT;\n \tint verbose = flags & VERIFY_PACK_VERBOSE;\n \tint stat_only = flags & VERIFY_PACK_STAT_ONLY;\n \tint err;\n+\tint argno = 1;\n \n \tif (stat_only)\n-\t\targv[1] = \"--verify-stat-only\";\n+\t\targv[argno++] = \"--verify-stat-only\";\n \telse if (verbose)\n-\t\targv[1] = \"--verify-stat\";\n+\t\targv[argno++] = \"--verify-stat\";\n \telse\n-\t\targv[1] = \"--verify\";\n+\t\targv[argno++] = \"--verify\";\n+\n+\tif (hash_algo) {\n+\t\tstrbuf_addf(&hash_arg, \"--object-format=%s\", hash_algo);\n+\t\targv[argno++] = hash_arg.buf;\n+\t}\n \n \t/*\n \t * In addition to \"foo.pack\" we accept \"foo.idx\" and \"foo\";\n@@ -31,7 +37,7 @@ static int verify_one_pack(const char *path, unsigned int flags)\n \tif (strbuf_strip_suffix(&arg, \".idx\") ||\n \t    !ends_with(arg.buf, \".pack\"))\n \t\tstrbuf_addstr(&arg, \".pack\");\n-\targv[2] = arg.buf;\n+\targv[argno++] = arg.buf;\n \n \tindex_pack.argv = argv;\n \tindex_pack.git_cmd = 1;\n@@ -60,12 +66,15 @@ int cmd_verify_pack(int argc, const char **argv, const char *prefix)\n {\n \tint err = 0;\n \tunsigned int flags = 0;\n+\tconst char *object_format = NULL;\n \tint i;\n \tconst struct option verify_pack_options[] = {\n \t\tOPT_BIT('v', \"verbose\", &flags, N_(\"verbose\"),\n \t\t\tVERIFY_PACK_VERBOSE),\n \t\tOPT_BIT('s', \"stat-only\", &flags, N_(\"show statistics only\"),\n \t\t\tVERIFY_PACK_STAT_ONLY),\n+\t\tOPT_STRING(0, \"object-format\", &object_format, N_(\"hash\"),\n+\t\t\t   N_(\"specify the hash algorithm to use\")),\n \t\tOPT_END()\n \t};\n \n@@ -75,7 +84,7 @@ int cmd_verify_pack(int argc, const char **argv, const char *prefix)\n \tif (argc < 1)\n \t\tusage_with_options(verify_pack_usage, verify_pack_options);\n \tfor (i = 0; i < argc; i++) {\n-\t\tif (verify_one_pack(argv[i], flags))\n+\t\tif (verify_one_pack(argv[i], flags, object_format))\n \t\t\terr = 1;\n \t}\n \ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 1b54c35b01..7fc22171e7 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -829,7 +829,7 @@ test_expect_success 'part of packfile response provided as URI' '\n \t# Ensure that my-blob and other-blob are in separate packfiles.\n \tfor idx in http_child/.git/objects/pack/*.idx\n \tdo\n-\t\tgit verify-pack --verbose $idx >out &&\n+\t\tgit verify-pack --object-format=$(test_oid algo) --verbose $idx >out &&\n \t\t{\n \t\t\tgrep \"^[0-9a-f]\\{16,\\} \" out || :\n \t\t} >out.objectlist &&\n"},{"id":"401324","messageId":"20200710024728.3100527-35-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 34/38] t: allow testing different hash algorithms via environment","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:24Z","receivedAt":"2020-07-10T02:49:23Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"To allow developers to run the testsuite with a different algorithm than\nthe default, provide an environment variable, GIT_TEST_DEFAULT_HASH, to\nspecify the algorithm to use. Compute the fixed constants using\ntest_oid. Move the constant initialization down below the point where\ntest-lib-functions.sh is loaded so the functions are defined.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/test-lib-functions.sh | 4 +---\n t/test-lib.sh           | 3 +++\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex d243ff43f3..8848ad568a 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -1417,9 +1417,7 @@ test_set_hash () {\n \n # Detect the hash algorithm in use.\n test_detect_hash () {\n-\t# Currently we only support SHA-1, but in the future this function will\n-\t# actually detect the algorithm in use.\n-\ttest_hash_algo='sha1'\n+\ttest_hash_algo=\"${GIT_TEST_DEFAULT_HASH:-sha1}\"\n }\n \n # Load common hash metadata and common placeholder object IDs for use with\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 618a7c8d5b..307bb2207e 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -452,6 +452,9 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR\n \n+GIT_DEFAULT_HASH=\"${GIT_TEST_DEFAULT_HASH:-sha1}\"\n+export GIT_DEFAULT_HASH\n+\n # Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output\n GIT_TRACE_BARE=1\n export GIT_TRACE_BARE\n"},{"id":"401325","messageId":"20200710024728.3100527-30-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 29/38] http-fetch: set up git directory before parsing pack hashes","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:19Z","receivedAt":"2020-07-10T02:49:24Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"In dd4b732df7 (\"upload-pack: send part of packfile response as uri\",\n2020-06-10), the git http-fetch code learned how to take  ac --packfile\noption.  This option takes an argument, which is the name of a packfile\nhash, and parses it using parse_oid_hex.  It does so before calling\nsetup_git_directory.\n\nHowever, in a SHA-256 repository this fails to work, since we have not\nset the hash algorithm in use and parse_oid_hex fails as a consequence.\nTo ensure that we can parse packfile hashes of the right length, let's\nset up the git directory before we start parsing arguments.\n---\n http-fetch.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/http-fetch.c b/http-fetch.c\nindex 1df376e745..8db7eb669f 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -86,6 +86,8 @@ int cmd_main(int argc, const char **argv)\n \tint packfile = 0;\n \tstruct object_id packfile_hash;\n \n+\tsetup_git_directory();\n+\n \twhile (arg < argc && argv[arg][0] == '-') {\n \t\tconst char *p;\n \n@@ -115,8 +117,6 @@ int cmd_main(int argc, const char **argv)\n \tif (argc != arg + 2 - (commits_on_stdin || packfile))\n \t\tusage(http_fetch_usage);\n \n-\tsetup_git_directory();\n-\n \tgit_config(git_default_config, NULL);\n \n \tif (packfile) {\n"},{"id":"401326","messageId":"20200710024728.3100527-22-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 21/38] t9300: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:11Z","receivedAt":"2020-07-10T02:49:26Z","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/t9300-fast-import.sh | 107 ++++++++++++++++++++++-------------------\n 1 file changed, 58 insertions(+), 49 deletions(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex e151df81c0..69d6fa4127 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -285,7 +285,7 @@ test_expect_success 'A: verify pack' '\n \n test_expect_success 'A: verify diff' '\n \tcat >expect <<-EOF &&\n-\t:000000 100755 0000000000000000000000000000000000000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 A\tcopy-of-file2\n+\t:000000 100755 0000000000000000000000000000000000000000 $(git rev-parse --verify master:file2) A\tcopy-of-file2\n \tEOF\n \tgit diff-tree -M -r master verify--import-marks >actual &&\n \tcompare_diff_raw expect actual &&\n@@ -528,6 +528,7 @@ test_expect_success 'B: fail on invalid committer (5)' '\n test_expect_success 'C: incremental import create pack from stdin' '\n \tnewf=$(echo hi newf | git hash-object -w --stdin) &&\n \toldf=$(git rev-parse --verify master:file2) &&\n+\tthrf=$(git rev-parse --verify master:file3) &&\n \ttest_tick &&\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/branch\n@@ -570,10 +571,11 @@ test_expect_success 'C: verify commit' '\n '\n \n test_expect_success 'C: validate rename result' '\n+\tzero=$ZERO_OID &&\n \tcat >expect <<-EOF &&\n-\t:000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A\tfile2/newf\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100\tfile2\tfile2/oldf\n-\t:100644 000000 0d92e9f3374ae2947c23aa477cbc68ce598135f1 0000000000000000000000000000000000000000 D\tfile3\n+\t:000000 100755 $zero $newf A\tfile2/newf\n+\t:100644 100644 $oldf $oldf R100\tfile2\tfile2/oldf\n+\t:100644 000000 $thrf $zero D\tfile3\n \tEOF\n \tgit diff-tree -M -r master branch >actual &&\n \tcompare_diff_raw expect actual\n@@ -614,9 +616,11 @@ test_expect_success 'D: verify pack' '\n '\n \n test_expect_success 'D: validate new files added' '\n+\tf5id=$(echo \"$file5_data\" | git hash-object --stdin) &&\n+\tf6id=$(echo \"$file6_data\" | git hash-object --stdin) &&\n \tcat >expect <<-EOF &&\n-\t:000000 100755 0000000000000000000000000000000000000000 e74b7d465e52746be2b4bae983670711e6e66657 A\tnewdir/exec.sh\n-\t:000000 100644 0000000000000000000000000000000000000000 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 A\tnewdir/interesting\n+\t:000000 100755 0000000000000000000000000000000000000000 $f6id A\tnewdir/exec.sh\n+\t:000000 100644 0000000000000000000000000000000000000000 $f5id A\tnewdir/interesting\n \tEOF\n \tgit diff-tree -M -r branch^ branch >actual &&\n \tcompare_diff_raw expect actual\n@@ -779,12 +783,13 @@ test_expect_success 'H: verify pack' '\n '\n \n test_expect_success 'H: validate old files removed, new files added' '\n+\tf4id=$(git rev-parse HEAD:file4) &&\n \tcat >expect <<-EOF &&\n-\t:100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D\tfile2/newf\n-\t:100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D\tfile2/oldf\n-\t:100755 000000 85df50785d62d3b05ab03d9cbf7e4a0b49449730 0000000000000000000000000000000000000000 D\tfile4\n-\t:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100\tnewdir/interesting\th/e/l/lo\n-\t:100755 000000 e74b7d465e52746be2b4bae983670711e6e66657 0000000000000000000000000000000000000000 D\tnewdir/exec.sh\n+\t:100755 000000 $newf $zero D\tfile2/newf\n+\t:100644 000000 $oldf $zero D\tfile2/oldf\n+\t:100755 000000 $f4id $zero D\tfile4\n+\t:100644 100644 $f5id $f5id R100\tnewdir/interesting\th/e/l/lo\n+\t:100755 000000 $f6id $zero D\tnewdir/exec.sh\n \tEOF\n \tgit diff-tree -M -r H^ H >actual &&\n \tcompare_diff_raw expect actual\n@@ -935,14 +940,15 @@ test_expect_success 'L: verify internal tree sorting' '\n \tINPUT_END\n \n \tcat >expect <<-EXPECT_END &&\n-\t:100644 100644 4268632... 55d3a52... M\tb.\n-\t:040000 040000 0ae5cac... 443c768... M\tb\n-\t:100644 100644 4268632... 55d3a52... M\tba\n+\t:100644 100644 M\tb.\n+\t:040000 040000 M\tb\n+\t:100644 100644 M\tba\n \tEXPECT_END\n \n \tgit fast-import <input &&\n \tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev --raw L^ L >output &&\n-\ttest_cmp expect output\n+\tcut -d\" \" -f1,2,5 output >actual &&\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'L: nested tree copy does not corrupt deltas' '\n@@ -1004,7 +1010,7 @@ test_expect_success 'M: rename file in same subdirectory' '\n \tINPUT_END\n \n \tcat >expect <<-EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100\tfile2/newf\tfile2/n.e.w.f\n+\t:100755 100755 $newf $newf R100\tfile2/newf\tfile2/n.e.w.f\n \tEOF\n \tgit fast-import <input &&\n \tgit diff-tree -M -r M1^ M1 >actual &&\n@@ -1025,7 +1031,7 @@ test_expect_success 'M: rename file to new subdirectory' '\n \tINPUT_END\n \n \tcat >expect <<-EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100\tfile2/newf\ti/am/new/to/you\n+\t:100755 100755 $newf $newf R100\tfile2/newf\ti/am/new/to/you\n \tEOF\n \tgit fast-import <input &&\n \tgit diff-tree -M -r M2^ M2 >actual &&\n@@ -1046,7 +1052,7 @@ test_expect_success 'M: rename subdirectory to new subdirectory' '\n \tINPUT_END\n \n \tcat >expect <<-EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100\ti/am/new/to/you\tother/sub/am/new/to/you\n+\t:100755 100755 $newf $newf R100\ti/am/new/to/you\tother/sub/am/new/to/you\n \tEOF\n \tgit fast-import <input &&\n \tgit diff-tree -M -r M3^ M3 >actual &&\n@@ -1067,11 +1073,11 @@ test_expect_success 'M: rename root to subdirectory' '\n \tINPUT_END\n \n \tcat >expect <<-EOF &&\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100\tfile2/oldf\tsub/file2/oldf\n-\t:100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 R100\tfile4\tsub/file4\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100\ti/am/new/to/you\tsub/i/am/new/to/you\n-\t:100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 R100\tnewdir/exec.sh\tsub/newdir/exec.sh\n-\t:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100\tnewdir/interesting\tsub/newdir/interesting\n+\t:100644 100644 $oldf $oldf R100\tfile2/oldf\tsub/file2/oldf\n+\t:100755 100755 $f4id $f4id R100\tfile4\tsub/file4\n+\t:100755 100755 $newf $newf R100\ti/am/new/to/you\tsub/i/am/new/to/you\n+\t:100755 100755 $f6id $f6id R100\tnewdir/exec.sh\tsub/newdir/exec.sh\n+\t:100644 100644 $f5id $f5id R100\tnewdir/interesting\tsub/newdir/interesting\n \tEOF\n \tgit fast-import <input &&\n \tgit diff-tree -M -r M4^ M4 >actual &&\n@@ -1097,7 +1103,7 @@ test_expect_success 'N: copy file in same subdirectory' '\n \tINPUT_END\n \n \tcat >expect <<-EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100\tfile2/newf\tfile2/n.e.w.f\n+\t:100755 100755 $newf $newf C100\tfile2/newf\tfile2/n.e.w.f\n \tEOF\n \tgit fast-import <input &&\n \tgit diff-tree -C --find-copies-harder -r N1^ N1 >actual &&\n@@ -1129,9 +1135,9 @@ test_expect_success 'N: copy then modify subdirectory' '\n \tINPUT_END\n \n \tcat >expect <<-EOF &&\n-\t:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100\tnewdir/interesting\tfile3/file5\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100\tfile2/newf\tfile3/newf\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100\tfile2/oldf\tfile3/oldf\n+\t:100644 100644 $f5id $f5id C100\tnewdir/interesting\tfile3/file5\n+\t:100755 100755 $newf $newf C100\tfile2/newf\tfile3/newf\n+\t:100644 100644 $oldf $oldf C100\tfile2/oldf\tfile3/oldf\n \tEOF\n \tgit fast-import <input &&\n \tgit diff-tree -C --find-copies-harder -r N2^^ N2 >actual &&\n@@ -1162,9 +1168,9 @@ test_expect_success 'N: copy dirty subdirectory' '\n '\n \n test_expect_success 'N: copy directory by id' '\n-\tcat >expect <<-\\EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100\tfile2/newf\tfile3/newf\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100\tfile2/oldf\tfile3/oldf\n+\tcat >expect <<-EOF &&\n+\t:100755 100755 $newf $newf C100\tfile2/newf\tfile3/newf\n+\t:100644 100644 $oldf $oldf C100\tfile2/oldf\tfile3/oldf\n \tEOF\n \tsubdir=$(git rev-parse refs/heads/branch^0:file2) &&\n \tcat >input <<-INPUT_END &&\n@@ -1183,9 +1189,9 @@ test_expect_success 'N: copy directory by id' '\n '\n \n test_expect_success PIPE 'N: read and copy directory' '\n-\tcat >expect <<-\\EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100\tfile2/newf\tfile3/newf\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100\tfile2/oldf\tfile3/oldf\n+\tcat >expect <<-EOF &&\n+\t:100755 100755 $newf $newf C100\tfile2/newf\tfile3/newf\n+\t:100644 100644 $oldf $oldf C100\tfile2/oldf\tfile3/oldf\n \tEOF\n \tgit update-ref -d refs/heads/N4 &&\n \trm -f backflow &&\n@@ -1254,9 +1260,9 @@ test_expect_success PIPE 'N: empty directory reads as missing' '\n '\n \n test_expect_success 'N: copy root directory by tree hash' '\n-\tcat >expect <<-\\EOF &&\n-\t:100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D\tfile3/newf\n-\t:100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D\tfile3/oldf\n+\tcat >expect <<-EOF &&\n+\t:100755 000000 $newf $zero D\tfile3/newf\n+\t:100644 000000 $oldf $zero D\tfile3/oldf\n \tEOF\n \troot=$(git rev-parse refs/heads/branch^0^{tree}) &&\n \tcat >input <<-INPUT_END &&\n@@ -1275,12 +1281,12 @@ test_expect_success 'N: copy root directory by tree hash' '\n '\n \n test_expect_success 'N: copy root by path' '\n-\tcat >expect <<-\\EOF &&\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100\tfile2/newf\toldroot/file2/newf\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100\tfile2/oldf\toldroot/file2/oldf\n-\t:100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 C100\tfile4\toldroot/file4\n-\t:100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 C100\tnewdir/exec.sh\toldroot/newdir/exec.sh\n-\t:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100\tnewdir/interesting\toldroot/newdir/interesting\n+\tcat >expect <<-EOF &&\n+\t:100755 100755 $newf $newf C100\tfile2/newf\toldroot/file2/newf\n+\t:100644 100644 $oldf $oldf C100\tfile2/oldf\toldroot/file2/oldf\n+\t:100755 100755 $f4id $f4id C100\tfile4\toldroot/file4\n+\t:100755 100755 $f6id $f6id C100\tnewdir/exec.sh\toldroot/newdir/exec.sh\n+\t:100644 100644 $f5id $f5id C100\tnewdir/interesting\toldroot/newdir/interesting\n \tEOF\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/N-copy-root-path\n@@ -1340,10 +1346,10 @@ test_expect_success 'N: delete directory by copying' '\n '\n \n test_expect_success 'N: modify copied tree' '\n-\tcat >expect <<-\\EOF &&\n-\t:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100\tnewdir/interesting\tfile3/file5\n-\t:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100\tfile2/newf\tfile3/newf\n-\t:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100\tfile2/oldf\tfile3/oldf\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $f5id $f5id C100\tnewdir/interesting\tfile3/file5\n+\t:100755 100755 $newf $newf C100\tfile2/newf\tfile3/newf\n+\t:100644 100644 $oldf $oldf C100\tfile2/oldf\tfile3/oldf\n \tEOF\n \tsubdir=$(git rev-parse refs/heads/branch^0:file2) &&\n \tcat >input <<-INPUT_END &&\n@@ -3117,6 +3123,9 @@ test_expect_success 'U: initialize for U tests' '\n \n \tINPUT_END\n \n+\tf7id=$(echo \"blob 1\" | git hash-object --stdin) &&\n+\tf8id=$(echo \"sleep well\" | git hash-object --stdin) &&\n+\tf9id=$(echo \"au revoir\" | git hash-object --stdin) &&\n \tgit fast-import <input\n '\n \n@@ -3137,7 +3146,7 @@ test_expect_success 'U: filedelete file succeeds' '\n \n test_expect_success 'U: validate file delete result' '\n \tcat >expect <<-EOF &&\n-\t:100644 000000 2907ebb4bf85d91bf0716bb3bd8a68ef48d6da76 0000000000000000000000000000000000000000 D\tgood/night.txt\n+\t:100644 000000 $f8id $ZERO_OID D\tgood/night.txt\n \tEOF\n \n \tgit diff-tree -M -r U^1 U >actual &&\n@@ -3162,7 +3171,7 @@ test_expect_success 'U: filedelete directory succeeds' '\n \n test_expect_success 'U: validate directory delete result' '\n \tcat >expect <<-EOF &&\n-\t:100644 000000 69cb75792f55123d8389c156b0b41c2ff00ed507 0000000000000000000000000000000000000000 D\tgood/bye.txt\n+\t:100644 000000 $f9id $ZERO_OID D\tgood/bye.txt\n \tEOF\n \n \tgit diff-tree -M -r U^1 U >actual &&\n@@ -3187,7 +3196,7 @@ test_expect_success 'U: filedelete root succeeds' '\n \n test_expect_success 'U: validate root delete result' '\n \tcat >expect <<-EOF &&\n-\t:100644 000000 c18147dc648481eeb65dc5e66628429a64843327 0000000000000000000000000000000000000000 D\thello.c\n+\t:100644 000000 $f7id $ZERO_OID D\thello.c\n \tEOF\n \n \tgit diff-tree -M -r U^1 U >actual &&\n"},{"id":"401327","messageId":"20200710024728.3100527-20-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 19/38] t8003: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:09Z","receivedAt":"2020-07-10T02:49:27Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"One assertion in this test invokes git with core.abbrev set to \"40\".\nSince we're expecting the full hash length, use test_oid to look up the\nfull hash length for the hash in use.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t8003-blame-corner-cases.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\nindex 9130b887d2..ebe79aa4ea 100755\n--- a/t/t8003-blame-corner-cases.sh\n+++ b/t/t8003-blame-corner-cases.sh\n@@ -6,6 +6,7 @@ test_description='git blame corner cases'\n pick_fc='s/^[0-9a-f^]* *\\([^ ]*\\) *(\\([^ ]*\\) .*/\\1-\\2/'\n \n test_expect_success setup '\n+\ttest_oid_init &&\n \n \techo A A A A A >one &&\n \techo B B B B B >two &&\n@@ -306,7 +307,7 @@ test_expect_success 'blame coalesce' '\n \t$oid 1) ABC\n \t$oid 2) DEF\n \tEOF\n-\tgit -c core.abbrev=40 blame -s giraffe >actual &&\n+\tgit -c core.abbrev=$(test_oid hexsz) blame -s giraffe >actual &&\n \ttest_cmp expect actual\n '\n \n"},{"id":"401328","messageId":"20200710024728.3100527-15-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 14/38] t7400: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:04Z","receivedAt":"2020-07-10T02:49:28Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Instead of using cut with hard-coded hash sizes, use cut with fields, or\nwhere that's not possible, sed with $OID_REGEX, so that the tests are\nindependent of hash size.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t7400-submodule-basic.sh | 26 +++++++++++++-------------\n 1 file changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 956e17abb3..fec7e0299d 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -1231,7 +1231,7 @@ test_expect_success 'submodule helper list is not confused by common prefixes' '\n \tgit submodule add /dir1/b dir1/b &&\n \tgit submodule add /dir2/b dir2/b &&\n \tgit commit -m \"first submodule commit\" &&\n-\tgit submodule--helper list dir1/b |cut -c51- >actual &&\n+\tgit submodule--helper list dir1/b | cut -f 2 >actual &&\n \techo \"dir1/b\" >expect &&\n \ttest_cmp expect actual\n '\n@@ -1260,7 +1260,7 @@ test_expect_success 'submodule update --init with a specification' '\n \tpwd=$(pwd) &&\n \tgit clone file://\"$pwd\"/multisuper multisuper_clone &&\n \tgit -C multisuper_clone submodule update --init . \":(exclude)sub0\" &&\n-\tgit -C multisuper_clone submodule status |cut -c 1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1271,7 +1271,7 @@ test_expect_success 'submodule update --init with submodule.active set' '\n \tgit -C multisuper_clone config submodule.active \".\" &&\n \tgit -C multisuper_clone config --add submodule.active \":(exclude)sub0\" &&\n \tgit -C multisuper_clone submodule update --init &&\n-\tgit -C multisuper_clone submodule status |cut -c 1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1290,7 +1290,7 @@ test_expect_success 'submodule update and setting submodule.<name>.active' '\n \t-sub3\n \tEOF\n \tgit -C multisuper_clone submodule update &&\n-\tgit -C multisuper_clone submodule status |cut -c 1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1307,12 +1307,12 @@ test_expect_success 'clone active submodule without submodule url set' '\n \t\tgit submodule update &&\n \t\tgit submodule status >actual_raw &&\n \n-\t\tcut -c 1,43- actual_raw >actual &&\n+\t\tcut -d\" \" -f3- actual_raw >actual &&\n \t\tcat >expect <<-\\EOF &&\n-\t\t sub0 (test2)\n-\t\t sub1 (test2)\n-\t\t sub2 (test2)\n-\t\t sub3 (test2)\n+\t\tsub0 (test2)\n+\t\tsub1 (test2)\n+\t\tsub2 (test2)\n+\t\tsub3 (test2)\n \t\tEOF\n \t\ttest_cmp expect actual\n \t)\n@@ -1328,7 +1328,7 @@ test_expect_success 'clone --recurse-submodules with a pathspec works' '\n \tEOF\n \n \tgit clone --recurse-submodules=\"sub0\" multisuper multisuper_clone &&\n-\tgit -C multisuper_clone submodule status |cut -c1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -1345,7 +1345,7 @@ test_expect_success 'clone with multiple --recurse-submodules options' '\n \t\t  --recurse-submodules=\":(exclude)sub0\" \\\n \t\t  --recurse-submodules=\":(exclude)sub2\" \\\n \t\t  multisuper multisuper_clone &&\n-\tgit -C multisuper_clone submodule status |cut -c1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1373,7 +1373,7 @@ test_expect_success 'clone and subsequent updates correctly auto-initialize subm\n \t\t  --recurse-submodules=\":(exclude)sub4\" \\\n \t\t  multisuper multisuper_clone &&\n \n-\tgit -C multisuper_clone submodule status |cut -c1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expect actual &&\n \n \tgit -C multisuper submodule add ../sub1 sub4 &&\n@@ -1382,7 +1382,7 @@ test_expect_success 'clone and subsequent updates correctly auto-initialize subm\n \t# obtain the new superproject\n \tgit -C multisuper_clone pull &&\n \tgit -C multisuper_clone submodule update --init &&\n-\tgit -C multisuper_clone submodule status |cut -c1,43- >actual &&\n+\tgit -C multisuper_clone submodule status | sed \"s/$OID_REGEX //\" >actual &&\n \ttest_cmp expect2 actual\n '\n \n"},{"id":"401329","messageId":"20200710024728.3100527-18-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 17/38] t7508: use $ZERO_OID instead of hard-coded constant","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:07Z","receivedAt":"2020-07-10T02:49:30Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Use the ZERO_OID variable to abbreviate the all-zeros object ID for\nmaintainability and to avoid depending on a specific size for the hash.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t7508-status.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 8e969f3e36..e81759319f 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -837,7 +837,7 @@ EOF\n '\n \n cat >expect <<EOF\n-:100644 100644 $EMPTY_BLOB 0000000000000000000000000000000000000000 M\tdir1/modified\n+:100644 100644 $EMPTY_BLOB $ZERO_OID M\tdir1/modified\n EOF\n test_expect_success 'status refreshes the index' '\n \ttouch dir2/added &&\n"},{"id":"401330","messageId":"20200710024728.3100527-16-sandals@crustytoothpaste.net","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"[PATCH 15/38] t7405: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T02:47:05Z","receivedAt":"2020-07-10T02:49:31Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Use $ZERO_OID instead of hard-coding a fixed size all-zeros object ID.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t7405-submodule-merge.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7405-submodule-merge.sh b/t/t7405-submodule-merge.sh\nindex aa33978ed2..6a1e5f8232 100755\n--- a/t/t7405-submodule-merge.sh\n+++ b/t/t7405-submodule-merge.sh\n@@ -195,7 +195,7 @@ test_expect_success 'git submodule status should display the merge conflict prop\n        url = $TRASH_DIRECTORY/sub\n EOF\n        cat >expect <<EOF &&\n-U0000000000000000000000000000000000000000 sub\n+U$ZERO_OID sub\n EOF\n        git submodule status > actual &&\n        test_cmp expect actual &&\n@@ -214,7 +214,7 @@ test_expect_success 'git submodule status should display the merge conflict prop\n        url = $TRASH_DIRECTORY/sub\n EOF\n        cat >expect <<EOF &&\n-U0000000000000000000000000000000000000000 sub\n+U$ZERO_OID sub\n EOF\n        git submodule status > actual &&\n        test_cmp expect actual &&\n"},{"id":"401345","messageId":"cb17f0ce-f96c-12e9-d0dc-dbfb9a4cc9ea@gmail.com","threadId":"53832","inReplyTo":"20200710024728.3100527-37-sandals@crustytoothpaste.net","subject":"Re: [PATCH 36/38] ci: run tests with SHA-256","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-07-10T15:09:48Z","receivedAt":"2020-07-10T15:09:56Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 7/9/2020 10:47 PM, brian m. carlson wrote:\n> Now that we have Git supporting SHA-256, we'd like to make sure that we\n> don't regress that state.  Unfortunately, it's easy to do so, so to\n> help, let's run one of our CI jobs with SHA-256 as the default hash.\n> This will help us detect any problems that may occur.\n> \n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  ci/run-build-and-tests.sh | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh\n> index 17e25aade9..b41b527b15 100755\n> --- a/ci/run-build-and-tests.sh\n> +++ b/ci/run-build-and-tests.sh\n> @@ -22,6 +22,7 @@ linux-gcc)\n>  \texport GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1\n>  \texport GIT_TEST_MULTI_PACK_INDEX=1\n>  \texport GIT_TEST_ADD_I_USE_BUILTIN=1\n> +\texport GIT_TEST_DEFAULT_HASH=sha256\n\nI was hoping that we'd have a default hash setting available\nin CI, and this delivers!\n\nHowever, this place changes the mode along with a bunch of\nother \"optional\" GIT_TEST_* variables, so the sha256 mode is\nnot being tested on its own.\n\nI think that the SHA-256 support is a big enough task that\nperhaps it should be part of the \"matrix\" in the jobs list\ninside .github/workflows/main.yml. Of course, I don't\nunderstand that system enough to contribute my own patch.\nFor that reason, this patch is an excellent first step!\n\nLet's keep my thoughts on creating new parallel builds for\nSHA-256 mode as a future enhancement.\n\nThanks,\n-Stolee\n"},{"id":"401346","messageId":"68cc8fe8-3400-501a-ead5-a9c008605e74@gmail.com","threadId":"53832","inReplyTo":"20200710024728.3100527-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH 00/38] SHA-256, part 3/3","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-07-10T15:14:37Z","receivedAt":"2020-07-10T15:16:37Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 7/9/2020 10:46 PM, brian m. carlson wrote:\n> This is the final part required for the stage 4 implementation of\n> SHA-256.\n\nWOOHOO! What a milestone!\n\nAs usual, your commits are excellently organized and clear. I could\nnot find any fault in any of them.\n\nThe proof is really in the pudding: does this pass the test suite\nwhen GIT_TEST_DEFAULT_HASH=sha256? You add that as a mode to the\nCI scripts, so we will know.\n\nI made a recommendation for a different model with how to do the CI,\nbut it's super minor and can be done later. Basically, if we create\na new job for SHA-256 mode, then we can more quickly identify when\na test failure is due to that toggle and not other optional GIT_TEST_*\nvariables.\n\nI hope to play around with SHA256-enabled repos a bit later, to see\nif I can find any issues poking around on my own. I doubt I will,\nwith how thoroughly you modified the test suite.\n\nThanks for this incredible achievement!\n\n-Stolee\n"},{"id":"401371","messageId":"20200710195507.GK9782@camp.crustytoothpaste.net","threadId":"53832","inReplyTo":"68cc8fe8-3400-501a-ead5-a9c008605e74@gmail.com","subject":"Re: [PATCH 00/38] SHA-256, part 3/3","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-10T19:55:07Z","receivedAt":"2020-07-10T19:55:50Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-07-10 at 15:14:37, Derrick Stolee wrote:\n> On 7/9/2020 10:46 PM, brian m. carlson wrote:\n> > This is the final part required for the stage 4 implementation of\n> > SHA-256.\n> \n> WOOHOO! What a milestone!\n\nI'm also excited about this.  It's been a lot of work, but we're finally\nhere.\n\n> As usual, your commits are excellently organized and clear. I could\n> not find any fault in any of them.\n\nThanks.\n\n> The proof is really in the pudding: does this pass the test suite\n> when GIT_TEST_DEFAULT_HASH=sha256? You add that as a mode to the\n> CI scripts, so we will know.\n\nI've seen several cases where we've accidentally regressed things with\nSHA-256, so it seemed only prudent to set up CI.  I've run it locally on\nmy system and it works for me, but we'll see how it fares on the CI\nsystem.\n\n> I made a recommendation for a different model with how to do the CI,\n> but it's super minor and can be done later. Basically, if we create\n> a new job for SHA-256 mode, then we can more quickly identify when\n> a test failure is due to that toggle and not other optional GIT_TEST_*\n> variables.\n\nI think that's a good suggestion, and I'm familiar enough with GitHub\nActions that I think I can set up an additional job.  If I reroll, I'll\ntry to squash such a change in.\n\n> I hope to play around with SHA256-enabled repos a bit later, to see\n> if I can find any issues poking around on my own. I doubt I will,\n> with how thoroughly you modified the test suite.\n\nFor folks who are looking for a more convenient way to get patches,\nyou're welcome to grab them from the transition-stage-4 branch on\nhttps://github.com/bk2204/git.git or\nhttps://git.crustytoothpaste.net/git/bmc/git.git.  The GitHub URL has\nslightly more bandwidth and a generally better uptime, since I don't\nlive in a datacenter.\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"401374","messageId":"xmqqft9zt9dd.fsf@gitster.c.googlers.com","threadId":"53832","inReplyTo":"20200710195507.GK9782@camp.crustytoothpaste.net","subject":"Re: [PATCH 00/38] SHA-256, part 3/3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-10T20:15:10Z","receivedAt":"2020-07-10T20:15:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> On 2020-07-10 at 15:14:37, Derrick Stolee wrote:\n>> On 7/9/2020 10:46 PM, brian m. carlson wrote:\n>> > This is the final part required for the stage 4 implementation of\n>> > SHA-256.\n>> \n>> WOOHOO! What a milestone!\n>\n> I'm also excited about this.  It's been a lot of work, but we're finally\n> here.\n\nThanks.\n"},{"id":"401376","messageId":"CAN0heSqmn087O5hb7qRSVJqA4FepH78Eb7hvJjqSXk9gmywZRg@mail.gmail.com","threadId":"53832","inReplyTo":"20200710024728.3100527-38-sandals@crustytoothpaste.net","subject":"Re: [PATCH 37/38] docs: add documentation for extensions.objectFormat","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2020-07-10T20:21:27Z","receivedAt":"2020-07-10T20:21:42Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On Fri, 10 Jul 2020 at 04:50, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> diff --git a/Documentation/config/extensions.txt b/Documentation/config/extensions.txt\n> new file mode 100644\n> index 0000000000..70d69cf9ab\n> --- /dev/null\n> +++ b/Documentation/config/extensions.txt\n> @@ -0,0 +1,7 @@\n> +extensions.objectFormat::\n> +       Specify the hash algorithm to use.  The acceptable values are `sha1`\n> +       and (if supported) `sha256`.  If not specified, `sha1` is assumed.\n> ++\n> +Note that this setting should only by set by linkgit:git-init[1] or\n> +linkgit:git-clone[1].  Trying to change it after initialization will not\n> +work and will produce hard-to-diagnose issues.\n\ns/by set/be set/\n\nMartin\n"},{"id":"401393","messageId":"xmqqmu46rieb.fsf@gitster.c.googlers.com","threadId":"53832","inReplyTo":"20200710024728.3100527-12-sandals@crustytoothpaste.net","subject":"Re: [PATCH 11/38] t7063: make hash size independent","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-11T00:43:08Z","receivedAt":"2020-07-11T00:47:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> Use test_oid instead of hard-coding a fixed size all-zeros object ID.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  t/t7063-status-untracked-cache.sh | 155 ++++++++++++++++--------------\n>  1 file changed, 83 insertions(+), 72 deletions(-)\n\nThe stated objective does make sense, but ...\n\n\n> -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n> -core.excludesfile 0000000000000000000000000000000000000000\n> +info/exclude $(test_oid exclude)\n> +core.excludesfile $ZERO_OID\n>  exclude_per_dir .gitignore\n>  flags 00000006\n> -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse\n> -/done/ 0000000000000000000000000000000000000000 recurse valid\n> -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n> -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n> +/ $(test_oid root) recurse\n> +/done/ $ZERO_OID recurse valid\n> +/dthree/ $ZERO_OID recurse check_only valid\n> +/dtwo/ $ZERO_OID recurse check_only valid\n>  two\n>  EOF\n> -\ttest_cmp ../expect ../actual\n> +\ttest_might_fail test_cmp ../expect ../actual\n\nAny \"cmd\" that is run under test_might_fail that is *not* used for\nits side effect is suspect---e.g. \"we would try to remove this file\nas the test may have created it, but it is OK if the file does not\nexist and removal fails\" is sort-of understandable, but I am having\na hard time imagining in what situation it makes sense for a test to\nsay \"these two files may have the same contents but it is OK if that\nis not the case\".  There are a few others in this patch.\n\nAnother topic in flight tightens the allowed usage of test_must_fail\nand test_might_fail helpers, and that is how I found this (because\nthe tip of 'seen' does not pass the test), but regardless of that\ntightening, I am not sure what this \"these two files may or may not\nbe equal\" is trying to achieve.\n\nThanks.\n\n"},{"id":"401394","messageId":"xmqqr1tirio5.fsf@gitster.c.googlers.com","threadId":"53832","inReplyTo":"20200710195507.GK9782@camp.crustytoothpaste.net","subject":"Re: [PATCH 00/38] SHA-256, part 3/3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-11T00:37:14Z","receivedAt":"2020-07-11T00:47:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> On 2020-07-10 at 15:14:37, Derrick Stolee wrote:\n>> On 7/9/2020 10:46 PM, brian m. carlson wrote:\n>> > This is the final part required for the stage 4 implementation of\n>> > SHA-256.\n>> \n>> WOOHOO! What a milestone!\n>\n> I'm also excited about this.  It's been a lot of work, but we're finally\n> here.\n\nThis topic sits at the tip of 'seen' (formerly known as 'pu'), and\n\n    https://travis-ci.org/github/git/git/jobs/707050671\n\nshows that t7063 is broken at the tip of 'seen'.\n\n - At the tip of this topic, t7063 passes.\n - There is no other topic that touches t7063 in flight.\n - seen^1, i.e. everything other than this topic merged, passes t7063.\n\nAhh, this is an easy one.  It is an interaction between this one and\nthe dl/test-must-fail-fixes-6 topic.\n\nThere are a few hunks like this in this topic.\n\n-\ttest_cmp ../expect ../actual\n+\ttest_might_fail test_cmp ../expect ../actual\n\nand the other series tightens test_must/might_fail so that these\ntest helpers can only be used on \"git\" (other users should just use\n\"! cmd\" or \"cmd || :\" instead).\n\nI do not think it was an explicit objective for Denton's series to\ncatch the use of test_might_fail with test_cmp specifically, but I\noffhand do not think of a good use case for saying \"expect and\nactual may sometimes be the same, but they may be different\", so in\nthat sense, it contributed to find a nonsensical code.  I haven't\nread thru all the 38 patches of this series, so there may be an\nobvious reason why we may want to have such a thing expressed that I\nam missing, though...\n\nThanks.\n"},{"id":"401395","messageId":"20200711005407.GL9782@camp.crustytoothpaste.net","threadId":"53832","inReplyTo":"xmqqmu46rieb.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 11/38] t7063: make hash size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-11T00:54:07Z","receivedAt":"2020-07-11T00:54:51Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-07-11 at 00:43:08, Junio C Hamano wrote:\n> \"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n> \n> > Use test_oid instead of hard-coding a fixed size all-zeros object ID.\n> >\n> > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> > ---\n> >  t/t7063-status-untracked-cache.sh | 155 ++++++++++++++++--------------\n> >  1 file changed, 83 insertions(+), 72 deletions(-)\n> \n> The stated objective does make sense, but ...\n> \n> \n> > -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n> > -core.excludesfile 0000000000000000000000000000000000000000\n> > +info/exclude $(test_oid exclude)\n> > +core.excludesfile $ZERO_OID\n> >  exclude_per_dir .gitignore\n> >  flags 00000006\n> > -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse\n> > -/done/ 0000000000000000000000000000000000000000 recurse valid\n> > -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid\n> > -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid\n> > +/ $(test_oid root) recurse\n> > +/done/ $ZERO_OID recurse valid\n> > +/dthree/ $ZERO_OID recurse check_only valid\n> > +/dtwo/ $ZERO_OID recurse check_only valid\n> >  two\n> >  EOF\n> > -\ttest_cmp ../expect ../actual\n> > +\ttest_might_fail test_cmp ../expect ../actual\n> \n> Any \"cmd\" that is run under test_might_fail that is *not* used for\n> its side effect is suspect---e.g. \"we would try to remove this file\n> as the test may have created it, but it is OK if the file does not\n> exist and removal fails\" is sort-of understandable, but I am having\n> a hard time imagining in what situation it makes sense for a test to\n> say \"these two files may have the same contents but it is OK if that\n> is not the case\".  There are a few others in this patch.\n> \n> Another topic in flight tightens the allowed usage of test_must_fail\n> and test_might_fail helpers, and that is how I found this (because\n> the tip of 'seen' does not pass the test), but regardless of that\n> tightening, I am not sure what this \"these two files may or may not\n> be equal\" is trying to achieve.\n\nI agree this is suspect, and I'm not sure what I intended there.  The\npatch is unfortunately over two years old, so I don't recall exactly,\nbut it may have been flaky (in general) at the time I was changing the\ntest and I may have accidentally squashed that into the patch at the\ntime.\n\nThe test passes without it, so clearly the right thing is to remove the\ntest_might_fail, which I agree is bizarre.  Feel free to do that when\npicking it up, and I'll fix that in in the reroll.\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"401396","messageId":"20200711010611.GM9782@camp.crustytoothpaste.net","threadId":"53832","inReplyTo":"xmqqr1tirio5.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 00/38] SHA-256, part 3/3","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-07-11T01:06:11Z","receivedAt":"2020-07-11T01:06:22Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-07-11 at 00:37:14, Junio C Hamano wrote:\n> I do not think it was an explicit objective for Denton's series to\n> catch the use of test_might_fail with test_cmp specifically, but I\n> offhand do not think of a good use case for saying \"expect and\n> actual may sometimes be the same, but they may be different\", so in\n> that sense, it contributed to find a nonsensical code.  I haven't\n> read thru all the 38 patches of this series, so there may be an\n> obvious reason why we may want to have such a thing expressed that I\n> am missing, though...\n\nAs mentioned upthread, my patch is definitely not correct.  I've\nsquashed in a fix to remove the test_might_fail and will send out a\nreroll later this weekend.  I want to wait a little bit in case anyone\nhas immediate comments on things so as not to send out patches too\nfrequently.\n\nIf the breakage is bothersome for you, please feel free to just remove\nthose test_might_fail entries in the meantime, and the series should\nfunction correctly.\n-- \nbrian m. carlson: Houston, Texas, US\n"},{"id":"401403","messageId":"20200712021350.GA34873@generichostname","threadId":"53832","inReplyTo":"20200710024728.3100527-36-sandals@crustytoothpaste.net","subject":"Re: [PATCH 35/38] t: make SHA1 prerequisite depend on default hash","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2020-07-12T02:13:50Z","receivedAt":"2020-07-12T02:19:20Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Brian,\n\nOn Fri, Jul 10, 2020 at 02:47:25AM +0000, brian m. carlson wrote:\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 307bb2207e..30ab0428fb 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -1689,7 +1689,8 @@ test_lazy_prereq CURL '\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> +\ttest $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&\n> +\t([ -z \"$GIT_DEFAULT_HASH\" ] || [ \"$GIT_DEFAULT_HASH\" = \"sha1\" ])\n\nTiny nitpick that I noticed in passing, is there any reason why we need\na subshell here? If not, I would just switch this to a command group via {}.\n\n-Denton\n\n>  '\n>  \n>  test_lazy_prereq REBASE_P '\n"},{"id":"401415","messageId":"xmqq7dv8r61u.fsf@gitster.c.googlers.com","threadId":"53832","inReplyTo":"20200712021350.GA34873@generichostname","subject":"Re: [PATCH 35/38] t: make SHA1 prerequisite depend on default hash","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-12T17:34:21Z","receivedAt":"2020-07-12T17:34:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Denton Liu <liu.denton@gmail.com> writes:\n\n> Hi Brian,\n>\n> On Fri, Jul 10, 2020 at 02:47:25AM +0000, brian m. carlson wrote:\n>> diff --git a/t/test-lib.sh b/t/test-lib.sh\n>> index 307bb2207e..30ab0428fb 100644\n>> --- a/t/test-lib.sh\n>> +++ b/t/test-lib.sh\n>> @@ -1689,7 +1689,8 @@ test_lazy_prereq CURL '\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>> +\ttest $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&\n>> +\t([ -z \"$GIT_DEFAULT_HASH\" ] || [ \"$GIT_DEFAULT_HASH\" = \"sha1\" ])\n>\n> Tiny nitpick that I noticed in passing, is there any reason why we need\n> a subshell here? If not, I would just switch this to a command group via {}.\n\nNicely caught.  Also we do not write [] but use 'test'.\n"}]}