{"thread":{"id":"51978","subject":"[PATCH 01/15] t/oid-info: allow looking up hash algorithm name","startedAt":"2019-10-05T21:12:18Z","lastAt":"2019-10-08T19:40:22Z","messageCount":24,"participants":["brian m. carlson","Derrick Stolee","Bert Wesarg"],"isPatch":true,"patchVersion":1,"patchTotal":15},"messages":[{"id":"383482","messageId":"20191005211209.18237-2-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 01/15] t/oid-info: allow looking up hash algorithm name","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:11:55Z","receivedAt":"2019-10-05T21:12:18Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"The test_oid function provides a mechanism for looking up hash algorithm\ninformation, but it doesn't specify a way to discover the hash algorithm\nname.  Knowing this information is useful if one wants to invoke the\ntest-tool helper for the algorithm in use, such as in our pack\ngeneration library.\n\nWhile it's currently possible to inspect the global variable holding\nthis value, in the future we'll allow specifying an algorithm for\nstorage and an algorithm for display, so it's better to abstract this\nvalue away.  To assist with this, provide a named entry in the\nalgorithm-specific lookup table that prints the algorithm in use.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/oid-info/hash-info | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/oid-info/hash-info b/t/oid-info/hash-info\nindex ccdbfdf974..6b5ded0b34 100644\n--- a/t/oid-info/hash-info\n+++ b/t/oid-info/hash-info\n@@ -6,3 +6,6 @@ hexsz sha256:64\n \n zero sha1:0000000000000000000000000000000000000000\n zero sha256:0000000000000000000000000000000000000000000000000000000000000000\n+\n+algo sha1:sha1\n+algo sha256:sha256\n"},{"id":"383483","messageId":"20191005211209.18237-5-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 04/15] t1305: avoid comparing extensions","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:11:58Z","receivedAt":"2019-10-05T21:12:19Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"A repository using a hash other than SHA-1 will need to have an\nextension in the config file.  Ignore any extensions when comparing\nconfig files, since they don't usefully contribute to the goal of the\ntest.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t1305-config-include.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh\nindex d20b4d150d..f1e1b289f9 100755\n--- a/t/t1305-config-include.sh\n+++ b/t/t1305-config-include.sh\n@@ -63,7 +63,7 @@ test_expect_success 'listing includes option and expansion' '\n \ttest.one=1\n \tEOF\n \tgit config --list >actual.full &&\n-\tgrep -v ^core actual.full >actual &&\n+\tgrep -v -e ^core -e ^extensions actual.full >actual &&\n \ttest_cmp expect actual\n '\n \n"},{"id":"383484","messageId":"20191005211209.18237-3-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 02/15] t/oid-info: add empty tree and empty blob values","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:11:56Z","receivedAt":"2019-10-05T21:12:19Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"The testsuite will eventually learn how to run using an algorithm other\nthan SHA-1. In preparation for this, teach the test_oid family of\nfunctions how to look up the empty blob and empty tree values so they\ncan be used.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/oid-info/hash-info | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/t/oid-info/hash-info b/t/oid-info/hash-info\nindex 6b5ded0b34..d0736dd1a0 100644\n--- a/t/oid-info/hash-info\n+++ b/t/oid-info/hash-info\n@@ -9,3 +9,9 @@ zero sha256:0000000000000000000000000000000000000000000000000000000000000000\n \n algo sha1:sha1\n algo sha256:sha256\n+\n+empty_blob sha1:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n+empty_blob sha256:473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813\n+\n+empty_tree sha1:4b825dc642cb6eb9a060e54bf8d69288fbee4904\n+empty_tree sha256:6ef19b41225c5369f1c104d45d8d85efa9b057b53b14b4b9b939dd74decc5321\n"},{"id":"383485","messageId":"20191005211209.18237-1-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":null,"subject":"[PATCH 00/15] SHA-256 test fixes, part 6","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:11:54Z","receivedAt":"2019-10-05T21:12:19Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This series consists mostly of additional test fixes for SHA-256, plus\nsome test framework improvements and a new option to rev-parse.\n\nUp until now, most of the test changes have been directly related to\nfixing hash values or sizes in some way.  In other words, previous test\nfixes would be required even for a Git binary that supported only\nSHA-256 and not SHA-1.\n\nIn this series, we also introduce some test changes that deal with the\nextension that will allow the same binary to handle both.  The changes\nthemselves are relatively uninteresting, but changes like these will be\nmaking appearances in future test fix series as well.  They may appear\nbizarre and out of place at times, but rest assured that they will be\nuseful in the future.\n\nThe other notable thing in this series is the introduction of a new\nrev-parse option, --object-format.  We know, according to the transition\nplan, that we'll need to support users working with input and output\nin different hash algorithms.  Since we're starting to see this kind of\ncode appear in the codebase, it makes sense to introduce a helper that\nlets scripters determine the appropriate value, and we should introduce\nthis code sooner, rather than later, so people can start using it.\n\nWe had had some discussions about the name of options to be used for\nhash algorithms but I don't recall us coming to a definitive conclusion.\nOpinions about the name[0] are of course welcome.  I'm not particularly\nattached to any name, so whatever the consensus is works for me.\n\n[0] Possibilities include --object-format, --show-object-format, --hash,\n--show-hash, --hash-algorithm, --show-hash-algorithm, and more.\n\nbrian m. carlson (15):\n  t/oid-info: allow looking up hash algorithm name\n  t/oid-info: add empty tree and empty blob values\n  rev-parse: add an --object-format option\n  t1305: avoid comparing extensions\n  t3429: remove SHA1 annotation\n  t4010: abstract away SHA-1-specific constants\n  t4011: abstract away SHA-1-specific constants\n  t4015: abstract away SHA-1-specific constants\n  t4027: make hash-size independent\n  t4034: abstract away SHA-1-specific constants\n  t4038: abstract away SHA-1 specific constants\n  t4039: abstract away SHA-1-specific constants\n  t4044: update test to work with SHA-256\n  t4045: make hash-size independent\n  t4048: abstract away SHA-1-specific constants\n\n Documentation/git-rev-parse.txt     |  7 +++\n builtin/rev-parse.c                 | 11 ++++\n t/oid-info/hash-info                |  9 +++\n t/t1305-config-include.sh           |  2 +-\n t/t1500-rev-parse.sh                | 15 +++++\n t/t3429-rebase-edit-todo.sh         |  2 +-\n t/t4010-diff-pathspec.sh            | 20 ++++---\n t/t4011-diff-symlink.sh             | 31 ++++++----\n t/t4015-diff-whitespace.sh          | 89 ++++++++++++++++-----------\n t/t4027-diff-submodule.sh           | 16 ++---\n t/t4034-diff-words.sh               | 93 +++++++++++++++++------------\n t/t4038-diff-combined.sh            | 19 ++++--\n t/t4039-diff-assume-unchanged.sh    |  3 +-\n t/t4044-diff-index-unique-abbrev.sh | 46 +++++++++-----\n t/t4045-diff-relative.sh            |  2 +-\n t/t4048-diff-combined-binary.sh     | 58 ++++++++++--------\n 16 files changed, 268 insertions(+), 155 deletions(-)\n\n"},{"id":"383486","messageId":"20191005211209.18237-6-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 05/15] t3429: remove SHA1 annotation","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:11:59Z","receivedAt":"2019-10-05T21:12:20Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test passes successfully with SHA-256, so remove the annotation\nwhich limits it to SHA-1.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t3429-rebase-edit-todo.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3429-rebase-edit-todo.sh b/t/t3429-rebase-edit-todo.sh\nindex 76f6d306ea..63edf17114 100755\n--- a/t/t3429-rebase-edit-todo.sh\n+++ b/t/t3429-rebase-edit-todo.sh\n@@ -11,7 +11,7 @@ test_expect_success 'rebase exec modifies rebase-todo' '\n \ttest -e F\n '\n \n-test_expect_success SHA1 'loose object cache vs re-reading todo list' '\n+test_expect_success 'loose object cache vs re-reading todo list' '\n \tGIT_REBASE_TODO=.git/rebase-merge/git-rebase-todo &&\n \texport GIT_REBASE_TODO &&\n \twrite_script append-todo.sh <<-\\EOS &&\n"},{"id":"383487","messageId":"20191005211209.18237-8-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 07/15] t4011: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:01Z","receivedAt":"2019-10-05T21:12:21Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for object IDs instead of\nusing hard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4011-diff-symlink.sh | 31 +++++++++++++++++++------------\n 1 file changed, 19 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 5ae19b987d..b6934da266 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -10,10 +10,12 @@ test_description='Test diff of symlinks.\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n test_expect_success 'diff new symlink and file' '\n-\tcat >expected <<-\\EOF &&\n+\tsymlink=$(git rev-parse --short \\\n+\t\t$(printf xyzzy | git hash-object --stdin)) &&\n+\tcat >expected <<-EOF &&\n \tdiff --git a/frotz b/frotz\n \tnew file mode 120000\n-\tindex 0000000..7c465af\n+\tindex 0000000..$symlink\n \t--- /dev/null\n \t+++ b/frotz\n \t@@ -0,0 +1 @@\n@@ -21,7 +23,7 @@ test_expect_success 'diff new symlink and file' '\n \t\\ No newline at end of file\n \tdiff --git a/nitfol b/nitfol\n \tnew file mode 100644\n-\tindex 0000000..7c465af\n+\tindex 0000000..$symlink\n \t--- /dev/null\n \t+++ b/nitfol\n \t@@ -0,0 +1 @@\n@@ -46,10 +48,10 @@ test_expect_success 'diff unchanged symlink and file'  '\n '\n \n test_expect_success 'diff removed symlink and file' '\n-\tcat >expected <<-\\EOF &&\n+\tcat >expected <<-EOF &&\n \tdiff --git a/frotz b/frotz\n \tdeleted file mode 120000\n-\tindex 7c465af..0000000\n+\tindex $symlink..0000000\n \t--- a/frotz\n \t+++ /dev/null\n \t@@ -1 +0,0 @@\n@@ -57,7 +59,7 @@ test_expect_success 'diff removed symlink and file' '\n \t\\ No newline at end of file\n \tdiff --git a/nitfol b/nitfol\n \tdeleted file mode 100644\n-\tindex 7c465af..0000000\n+\tindex $symlink..0000000\n \t--- a/nitfol\n \t+++ /dev/null\n \t@@ -1 +0,0 @@\n@@ -90,9 +92,11 @@ test_expect_success 'diff identical, but newly created symlink and file' '\n '\n \n test_expect_success 'diff different symlink and file' '\n-\tcat >expected <<-\\EOF &&\n+\tnew=$(git rev-parse --short \\\n+\t\t$(printf yxyyz | git hash-object --stdin)) &&\n+\tcat >expected <<-EOF &&\n \tdiff --git a/frotz b/frotz\n-\tindex 7c465af..df1db54 120000\n+\tindex $symlink..$new 120000\n \t--- a/frotz\n \t+++ b/frotz\n \t@@ -1 +1 @@\n@@ -101,7 +105,7 @@ test_expect_success 'diff different symlink and file' '\n \t+yxyyz\n \t\\ No newline at end of file\n \tdiff --git a/nitfol b/nitfol\n-\tindex 7c465af..df1db54 100644\n+\tindex $symlink..$new 100644\n \t--- a/nitfol\n \t+++ b/nitfol\n \t@@ -1 +1 @@\n@@ -137,14 +141,17 @@ test_expect_success SYMLINKS 'setup symlinks with attributes' '\n '\n \n test_expect_success SYMLINKS 'symlinks do not respect userdiff config by path' '\n-\tcat >expect <<-\\EOF &&\n+\tfile=$(git rev-parse --short $(git hash-object file.bin)) &&\n+\tlink=$(git rev-parse --short \\\n+\t\t$(printf file.bin | git hash-object --stdin)) &&\n+\tcat >expect <<-EOF &&\n \tdiff --git a/file.bin b/file.bin\n \tnew file mode 100644\n-\tindex 0000000..d95f3ad\n+\tindex 0000000..$file\n \tBinary files /dev/null and b/file.bin differ\n \tdiff --git a/link.bin b/link.bin\n \tnew file mode 120000\n-\tindex 0000000..dce41ec\n+\tindex 0000000..$link\n \t--- /dev/null\n \t+++ b/link.bin\n \t@@ -0,0 +1 @@\n"},{"id":"383488","messageId":"20191005211209.18237-4-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 03/15] rev-parse: add an --object-format option","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:11:57Z","receivedAt":"2019-10-05T21:12:22Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Add an option to print the object format used for input, output, or\nstorage. This allows shell scripts to discover the hash algorithm in\nuse.\n\nSince the transition plan allows for multiple input algorithms, document\nthat we may provide multiple results for input, and the format that the\nresults may take. While we don't support this now, documenting it early\nmeans that script authors can future-proof their scripts for when we do.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n Documentation/git-rev-parse.txt |  7 +++++++\n builtin/rev-parse.c             | 11 +++++++++++\n t/t1500-rev-parse.sh            | 15 +++++++++++++++\n 3 files changed, 33 insertions(+)\n\ndiff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\nindex e72d332b83..8a72190940 100644\n--- a/Documentation/git-rev-parse.txt\n+++ b/Documentation/git-rev-parse.txt\n@@ -274,6 +274,13 @@ print a message to stderr and exit with nonzero status.\n \tShow the path to the shared index file in split index mode, or\n \tempty if not in split-index mode.\n \n+--object-format[=(storage|input|output)]::\n+\tShow the object format (hash algorithm) used for the repository\n+\tfor storage inside the `.git` directory, input, or output. For\n+\tinput, multiple algorithms may be printed, space-separated.\n+\tIf not specified, the default is \"storage\".\n+\n+\n Other Options\n ~~~~~~~~~~~~~\n \ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex f8bbe6d47e..8036219921 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -918,6 +918,17 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)\n \t\t\t\tshow_datestring(\"--min-age=\", arg);\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (opt_with_value(arg, \"--object-format\", &arg)) {\n+\t\t\t\tconst char *val = arg ? arg : \"storage\";\n+\n+\t\t\t\tif (strcmp(val, \"storage\") &&\n+\t\t\t\t    strcmp(val, \"input\") &&\n+\t\t\t\t    strcmp(val, \"output\"))\n+\t\t\t\t\tdie(\"unknown mode for --object-format: %s\",\n+\t\t\t\t\t    arg);\n+\t\t\t\tputs(the_hash_algo->name);\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tif (show_flag(arg) && verify)\n \t\t\t\tdie_no_single_rev(quiet);\n \t\t\tcontinue;\ndiff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh\nindex 01abee533d..fb3d81df4c 100755\n--- a/t/t1500-rev-parse.sh\n+++ b/t/t1500-rev-parse.sh\n@@ -59,6 +59,7 @@ 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 '\n@@ -131,6 +132,20 @@ test_expect_success 'rev-parse --is-shallow-repository in non-shallow repo' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'rev-parse --object-format in repo' '\n+\techo \"$(test_oid algo)\" >expect &&\n+\tgit rev-parse --object-format >actual &&\n+\ttest_cmp expect actual &&\n+\tgit rev-parse --object-format=storage >actual &&\n+\ttest_cmp expect actual &&\n+\tgit rev-parse --object-format=input >actual &&\n+\ttest_cmp expect actual &&\n+\tgit rev-parse --object-format=output >actual &&\n+\ttest_cmp expect actual &&\n+\ttest_must_fail git rev-parse --object-format=squeamish-ossifrage 2>err &&\n+\tgrep \"unknown mode for --object-format: squeamish-ossifrage\" err\n+'\n+\n test_expect_success 'showing the superproject correctly' '\n \tgit rev-parse --show-superproject-working-tree >out &&\n \ttest_must_be_empty out &&\n"},{"id":"383489","messageId":"20191005211209.18237-9-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 08/15] t4015: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:02Z","receivedAt":"2019-10-05T21:12:22Z","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/t4015-diff-whitespace.sh | 89 +++++++++++++++++++++++---------------\n 1 file changed, 53 insertions(+), 36 deletions(-)\n\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 6b087df3dc..eadaf57262 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -16,6 +16,7 @@ test_expect_success \"Ray Lehtiniemi's example\" '\n \t} while (0);\n \tEOF\n \tgit update-index --add x &&\n+\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n \n \tcat <<-\\EOF >x &&\n \tdo\n@@ -24,10 +25,11 @@ test_expect_success \"Ray Lehtiniemi's example\" '\n \t}\n \twhile (0);\n \tEOF\n+\tafter=$(git rev-parse --short $(git hash-object x)) &&\n \n-\tcat <<-\\EOF >expect &&\n+\tcat <<-EOF >expect &&\n \tdiff --git a/x b/x\n-\tindex adf3937..6edc172 100644\n+\tindex $before..$after 100644\n \t--- a/x\n \t+++ b/x\n \t@@ -1,3 +1,5 @@\n@@ -61,6 +63,7 @@ test_expect_success 'another test, without options' '\n \tEOF\n \n \tgit update-index x &&\n+\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n \n \ttr \"_\" \" \" <<-\\EOF >x &&\n \t_\twhitespace at beginning\n@@ -70,10 +73,11 @@ test_expect_success 'another test, without options' '\n \tunchanged line\n \tCR at end\n \tEOF\n+\tafter=$(git rev-parse --short $(git hash-object x)) &&\n \n-\ttr \"Q_\" \"\\015 \" <<-\\EOF >expect &&\n+\ttr \"Q_\" \"\\015 \" <<-EOF >expect &&\n \tdiff --git a/x b/x\n-\tindex d99af23..22d9f73 100644\n+\tindex $before..$after 100644\n \t--- a/x\n \t+++ b/x\n \t@@ -1,6 +1,6 @@\n@@ -108,9 +112,9 @@ test_expect_success 'another test, without options' '\n \tgit diff -w --ignore-cr-at-eol >out &&\n \ttest_must_be_empty out &&\n \n-\ttr \"Q_\" \"\\015 \" <<-\\EOF >expect &&\n+\ttr \"Q_\" \"\\015 \" <<-EOF >expect &&\n \tdiff --git a/x b/x\n-\tindex d99af23..22d9f73 100644\n+\tindex $before..$after 100644\n \t--- a/x\n \t+++ b/x\n \t@@ -1,6 +1,6 @@\n@@ -132,9 +136,9 @@ test_expect_success 'another test, without options' '\n \tgit diff -b --ignore-cr-at-eol >out &&\n \ttest_cmp expect out &&\n \n-\ttr \"Q_\" \"\\015 \" <<-\\EOF >expect &&\n+\ttr \"Q_\" \"\\015 \" <<-EOF >expect &&\n \tdiff --git a/x b/x\n-\tindex d99af23..22d9f73 100644\n+\tindex $before..$after 100644\n \t--- a/x\n \t+++ b/x\n \t@@ -1,6 +1,6 @@\n@@ -154,9 +158,9 @@ test_expect_success 'another test, without options' '\n \tgit diff --ignore-space-at-eol --ignore-cr-at-eol >out &&\n \ttest_cmp expect out &&\n \n-\ttr \"Q_\" \"\\015 \" <<-\\EOF >expect &&\n+\ttr \"Q_\" \"\\015 \" <<-EOF >expect &&\n \tdiff --git a/x b/x\n-\tindex_d99af23..22d9f73 100644\n+\tindex_$before..$after 100644\n \t--- a/x\n \t+++ b/x\n \t@@ -1,6 +1,6 @@\n@@ -786,23 +790,25 @@ test_expect_success 'whitespace-only changes not reported' '\n \ttest_must_be_empty actual\n '\n \n-cat <<EOF >expect\n-diff --git a/x b/z\n-similarity index NUM%\n-rename from x\n-rename to z\n-index 380c32a..a97b785 100644\n-EOF\n test_expect_success 'whitespace-only changes reported across renames' '\n \tgit reset --hard &&\n \tfor i in 1 2 3 4 5 6 7 8 9; do echo \"$i$i$i$i$i$i\"; done >x &&\n \tgit add x &&\n+\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n \tgit commit -m \"base\" &&\n \tsed -e \"5s/^/ /\" x >z &&\n \tgit rm x &&\n \tgit add z &&\n+\tafter=$(git rev-parse --short $(git hash-object z)) &&\n \tgit diff -w -M --cached |\n \tsed -e \"/^similarity index /s/[0-9][0-9]*/NUM/\" >actual &&\n+\tcat <<-EOF >expect &&\n+\tdiff --git a/x b/z\n+\tsimilarity index NUM%\n+\trename from x\n+\trename to z\n+\tindex $before..$after 100644\n+\tEOF\n \ttest_cmp expect actual\n '\n \n@@ -858,13 +864,15 @@ test_expect_success 'diff that introduces a line with only tabs' '\n \tgit config core.whitespace blank-at-eol &&\n \tgit reset --hard &&\n \techo \"test\" >x &&\n+\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n \tgit commit -m \"initial\" x &&\n \techo \"{NTN}\" | tr \"NT\" \"\\n\\t\" >>x &&\n+\tafter=$(git rev-parse --short $(git hash-object x)) &&\n \tgit diff --color | test_decode_color >current &&\n \n-\tcat >expected <<-\\EOF &&\n+\tcat >expected <<-EOF &&\n \t<BOLD>diff --git a/x b/x<RESET>\n-\t<BOLD>index 9daeafb..2874b91 100644<RESET>\n+\t<BOLD>index $before..$after 100644<RESET>\n \t<BOLD>--- a/x<RESET>\n \t<BOLD>+++ b/x<RESET>\n \t<CYAN>@@ -1 +1,4 @@<RESET>\n@@ -883,19 +891,21 @@ test_expect_success 'diff that introduces and removes ws breakages' '\n \t\techo \"0. blank-at-eol \" &&\n \t\techo \"1. blank-at-eol \"\n \t} >x &&\n+\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n \tgit commit -a --allow-empty -m preimage &&\n \t{\n \t\techo \"0. blank-at-eol \" &&\n \t\techo \"1. still-blank-at-eol \" &&\n \t\techo \"2. and a new line \"\n \t} >x &&\n+\tafter=$(git rev-parse --short $(git hash-object x)) &&\n \n \tgit diff --color |\n \ttest_decode_color >current &&\n \n-\tcat >expected <<-\\EOF &&\n+\tcat >expected <<-EOF &&\n \t<BOLD>diff --git a/x b/x<RESET>\n-\t<BOLD>index d0233a2..700886e 100644<RESET>\n+\t<BOLD>index $before..$after 100644<RESET>\n \t<BOLD>--- a/x<RESET>\n \t<BOLD>+++ b/x<RESET>\n \t<CYAN>@@ -1,2 +1,3 @@<RESET>\n@@ -915,16 +925,18 @@ test_expect_success 'ws-error-highlight test setup' '\n \t\techo \"0. blank-at-eol \" &&\n \t\techo \"1. blank-at-eol \"\n \t} >x &&\n+\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n \tgit commit -a --allow-empty -m preimage &&\n \t{\n \t\techo \"0. blank-at-eol \" &&\n \t\techo \"1. still-blank-at-eol \" &&\n \t\techo \"2. and a new line \"\n \t} >x &&\n+\tafter=$(git rev-parse --short $(git hash-object x)) &&\n \n-\tcat >expect.default-old <<-\\EOF &&\n+\tcat >expect.default-old <<-EOF &&\n \t<BOLD>diff --git a/x b/x<RESET>\n-\t<BOLD>index d0233a2..700886e 100644<RESET>\n+\t<BOLD>index $before..$after 100644<RESET>\n \t<BOLD>--- a/x<RESET>\n \t<BOLD>+++ b/x<RESET>\n \t<CYAN>@@ -1,2 +1,3 @@<RESET>\n@@ -934,9 +946,9 @@ test_expect_success 'ws-error-highlight test setup' '\n \t<GREEN>+<RESET><GREEN>2. and a new line<RESET><BLUE> <RESET>\n \tEOF\n \n-\tcat >expect.all <<-\\EOF &&\n+\tcat >expect.all <<-EOF &&\n \t<BOLD>diff --git a/x b/x<RESET>\n-\t<BOLD>index d0233a2..700886e 100644<RESET>\n+\t<BOLD>index $before..$after 100644<RESET>\n \t<BOLD>--- a/x<RESET>\n \t<BOLD>+++ b/x<RESET>\n \t<CYAN>@@ -1,2 +1,3 @@<RESET>\n@@ -946,9 +958,9 @@ test_expect_success 'ws-error-highlight test setup' '\n \t<GREEN>+<RESET><GREEN>2. and a new line<RESET><BLUE> <RESET>\n \tEOF\n \n-\tcat >expect.none <<-\\EOF\n+\tcat >expect.none <<-EOF\n \t<BOLD>diff --git a/x b/x<RESET>\n-\t<BOLD>index d0233a2..700886e 100644<RESET>\n+\t<BOLD>index $before..$after 100644<RESET>\n \t<BOLD>--- a/x<RESET>\n \t<BOLD>+++ b/x<RESET>\n \t<CYAN>@@ -1,2 +1,3 @@<RESET>\n@@ -1022,14 +1034,15 @@ test_expect_success 'detect moved code, complete file' '\n \tEOF\n \tgit add test.c &&\n \tgit commit -m \"add main function\" &&\n+\tfile=$(git rev-parse --short HEAD:test.c) &&\n \tgit mv test.c main.c &&\n \ttest_config color.diff.oldMoved \"normal red\" &&\n \ttest_config color.diff.newMoved \"normal green\" &&\n \tgit diff HEAD --color-moved=zebra --color --no-renames | test_decode_color >actual &&\n-\tcat >expected <<-\\EOF &&\n+\tcat >expected <<-EOF &&\n \t<BOLD>diff --git a/main.c b/main.c<RESET>\n \t<BOLD>new file mode 100644<RESET>\n-\t<BOLD>index 0000000..a986c57<RESET>\n+\t<BOLD>index 0000000..$file<RESET>\n \t<BOLD>--- /dev/null<RESET>\n \t<BOLD>+++ b/main.c<RESET>\n \t<CYAN>@@ -0,0 +1,5 @@<RESET>\n@@ -1040,7 +1053,7 @@ test_expect_success 'detect moved code, complete file' '\n \t<BGREEN>+<RESET><BGREEN>}<RESET>\n \t<BOLD>diff --git a/test.c b/test.c<RESET>\n \t<BOLD>deleted file mode 100644<RESET>\n-\t<BOLD>index a986c57..0000000<RESET>\n+\t<BOLD>index $file..0000000<RESET>\n \t<BOLD>--- a/test.c<RESET>\n \t<BOLD>+++ /dev/null<RESET>\n \t<CYAN>@@ -1,5 +0,0 @@<RESET>\n@@ -1094,6 +1107,8 @@ test_expect_success 'detect malicious moved code, inside file' '\n \tEOF\n \tgit add main.c test.c &&\n \tgit commit -m \"add main and test file\" &&\n+\tbefore_main=$(git rev-parse --short HEAD:main.c) &&\n+\tbefore_test=$(git rev-parse --short HEAD:test.c) &&\n \tcat <<-\\EOF >main.c &&\n \t\t#include<stdio.h>\n \t\tint stuff()\n@@ -1126,10 +1141,12 @@ test_expect_success 'detect malicious moved code, inside file' '\n \t\t\tbar();\n \t\t}\n \tEOF\n+\tafter_main=$(git rev-parse --short $(git hash-object main.c)) &&\n+\tafter_test=$(git rev-parse --short $(git hash-object test.c)) &&\n \tgit diff HEAD --no-renames --color-moved=zebra --color | test_decode_color >actual &&\n-\tcat <<-\\EOF >expected &&\n+\tcat <<-EOF >expected &&\n \t<BOLD>diff --git a/main.c b/main.c<RESET>\n-\t<BOLD>index 27a619c..7cf9336 100644<RESET>\n+\t<BOLD>index $before_main..$after_main 100644<RESET>\n \t<BOLD>--- a/main.c<RESET>\n \t<BOLD>+++ b/main.c<RESET>\n \t<CYAN>@@ -5,13 +5,6 @@<RESET> <RESET>printf(\"Hello \");<RESET>\n@@ -1147,7 +1164,7 @@ test_expect_success 'detect malicious moved code, inside file' '\n \t {<RESET>\n \t foo();<RESET>\n \t<BOLD>diff --git a/test.c b/test.c<RESET>\n-\t<BOLD>index 1dc1d85..2bedec9 100644<RESET>\n+\t<BOLD>index $before_test..$after_test 100644<RESET>\n \t<BOLD>--- a/test.c<RESET>\n \t<BOLD>+++ b/test.c<RESET>\n \t<CYAN>@@ -4,6 +4,13 @@<RESET> <RESET>int bar()<RESET>\n@@ -1176,9 +1193,9 @@ test_expect_success 'plain moved code, inside file' '\n \ttest_config color.diff.newMovedAlternative \"yellow\" &&\n \t# needs previous test as setup\n \tgit diff HEAD --no-renames --color-moved=plain --color | test_decode_color >actual &&\n-\tcat <<-\\EOF >expected &&\n+\tcat <<-EOF >expected &&\n \t<BOLD>diff --git a/main.c b/main.c<RESET>\n-\t<BOLD>index 27a619c..7cf9336 100644<RESET>\n+\t<BOLD>index $before_main..$after_main 100644<RESET>\n \t<BOLD>--- a/main.c<RESET>\n \t<BOLD>+++ b/main.c<RESET>\n \t<CYAN>@@ -5,13 +5,6 @@<RESET> <RESET>printf(\"Hello \");<RESET>\n@@ -1196,7 +1213,7 @@ test_expect_success 'plain moved code, inside file' '\n \t {<RESET>\n \t foo();<RESET>\n \t<BOLD>diff --git a/test.c b/test.c<RESET>\n-\t<BOLD>index 1dc1d85..2bedec9 100644<RESET>\n+\t<BOLD>index $before_test..$after_test 100644<RESET>\n \t<BOLD>--- a/test.c<RESET>\n \t<BOLD>+++ b/test.c<RESET>\n \t<CYAN>@@ -4,6 +4,13 @@<RESET> <RESET>int bar()<RESET>\n"},{"id":"383490","messageId":"20191005211209.18237-7-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 06/15] t4010: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:00Z","receivedAt":"2019-10-05T21:12:23Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for object IDs instead of\nusing hard-coded hashes.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4010-diff-pathspec.sh | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\nindex 281f8fad0c..e5ca359edf 100755\n--- a/t/t4010-diff-pathspec.sh\n+++ b/t/t4010-diff-pathspec.sh\n@@ -17,11 +17,15 @@ test_expect_success \\\n     'echo frotz >file0 &&\n      mkdir path1 &&\n      echo rezrov >path1/file1 &&\n+     before0=$(git hash-object file0) &&\n+     before1=$(git hash-object path1/file1) &&\n      git update-index --add file0 path1/file1 &&\n      tree=$(git write-tree) &&\n      echo \"$tree\" &&\n      echo nitfol >file0 &&\n      echo yomin >path1/file1 &&\n+     after0=$(git hash-object file0) &&\n+     after1=$(git hash-object path1/file1) &&\n      git update-index file0 path1/file1'\n \n cat >expected <<\\EOF\n@@ -31,32 +35,32 @@ test_expect_success \\\n     'git diff-index --cached $tree -- path >current &&\n      compare_diff_raw current expected'\n \n-cat >expected <<\\EOF\n-:100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n+cat >expected <<EOF\n+:100644 100644 $before1 $after1 M\tpath1/file1\n EOF\n test_expect_success \\\n     'limit to path1 should show path1/file1' \\\n     'git diff-index --cached $tree -- path1 >current &&\n      compare_diff_raw current expected'\n \n-cat >expected <<\\EOF\n-:100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n+cat >expected <<EOF\n+:100644 100644 $before1 $after1 M\tpath1/file1\n EOF\n test_expect_success \\\n     'limit to path1/ should show path1/file1' \\\n     'git diff-index --cached $tree -- path1/ >current &&\n      compare_diff_raw current expected'\n \n-cat >expected <<\\EOF\n-:100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n+cat >expected <<EOF\n+:100644 100644 $before1 $after1 M\tpath1/file1\n EOF\n test_expect_success \\\n     '\"*file1\" should show path1/file1' \\\n     'git diff-index --cached $tree -- \"*file1\" >current &&\n      compare_diff_raw current expected'\n \n-cat >expected <<\\EOF\n-:100644 100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df dca6b92303befc93086aa025d90a5facd7eb2812 M\tfile0\n+cat >expected <<EOF\n+:100644 100644 $before0 $after0 M\tfile0\n EOF\n test_expect_success \\\n     'limit to file0 should show file0' \\\n"},{"id":"383491","messageId":"20191005211209.18237-12-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 11/15] t4038: abstract away SHA-1 specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:05Z","receivedAt":"2019-10-05T21:12:24Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Compute several object IDs that exist in expected output, since we don't\ncare about the specific object IDs, only that the format of the output\nis syntactically correct.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4038-diff-combined.sh | 19 +++++++++++++------\n 1 file changed, 13 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\nindex d4afe12554..15fc054fdb 100755\n--- a/t/t4038-diff-combined.sh\n+++ b/t/t4038-diff-combined.sh\n@@ -440,11 +440,13 @@ test_expect_success 'setup for --combined-all-paths' '\n \tgit branch side2c &&\n \tgit checkout side1c &&\n \ttest_seq 1 10 >filename-side1c &&\n+\tside1cf=$(git hash-object filename-side1c) &&\n \tgit add filename-side1c &&\n \tgit commit -m with &&\n \tgit checkout side2c &&\n \ttest_seq 1 9 >filename-side2c &&\n \techo ten >>filename-side2c &&\n+\tside2cf=$(git hash-object filename-side2c) &&\n \tgit add filename-side2c &&\n \tgit commit -m iam &&\n \tgit checkout -b mergery side1c &&\n@@ -452,13 +454,14 @@ test_expect_success 'setup for --combined-all-paths' '\n \tgit rm filename-side1c &&\n \techo eleven >>filename-side2c &&\n \tgit mv filename-side2c filename-merged &&\n+\tmergedf=$(git hash-object filename-merged) &&\n \tgit add filename-merged &&\n \tgit commit\n '\n \n test_expect_success '--combined-all-paths and --raw' '\n-\tcat <<-\\EOF >expect &&\n-\t::100644 100644 100644 f00c965d8307308469e537302baa73048488f162 088bd5d92c2a8e0203ca8e7e4c2a5c692f6ae3f7 333b9c62519f285e1854830ade0fe1ef1d40ee1b RR\tfilename-side1c\tfilename-side2c\tfilename-merged\n+\tcat <<-EOF >expect &&\n+\t::100644 100644 100644 $side1cf $side2cf $mergedf RR\tfilename-side1c\tfilename-side2c\tfilename-merged\n \tEOF\n \tgit diff-tree -c -M --raw --combined-all-paths HEAD >actual.tmp &&\n \tsed 1d <actual.tmp >actual &&\n@@ -482,11 +485,13 @@ test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names'\n \tgit checkout side1d &&\n \ttest_seq 1 10 >\"$(printf \"file\\twith\\ttabs\")\" &&\n \tgit add file* &&\n+\tside1df=$(git hash-object *tabs) &&\n \tgit commit -m with &&\n \tgit checkout side2d &&\n \ttest_seq 1 9 >\"$(printf \"i\\tam\\ttabbed\")\" &&\n \techo ten >>\"$(printf \"i\\tam\\ttabbed\")\" &&\n \tgit add *tabbed &&\n+\tside2df=$(git hash-object *tabbed) &&\n \tgit commit -m iam &&\n \tgit checkout -b funny-names-mergery side1d &&\n \tgit merge --no-commit side2d &&\n@@ -494,12 +499,14 @@ test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names'\n \techo eleven >>\"$(printf \"i\\tam\\ttabbed\")\" &&\n \tgit mv \"$(printf \"i\\tam\\ttabbed\")\" \"$(printf \"fickle\\tnaming\")\" &&\n \tgit add fickle* &&\n-\tgit commit\n+\theadf=$(git hash-object fickle*) &&\n+\tgit commit &&\n+\thead=$(git rev-parse HEAD)\n '\n \n test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names' '\n-\tcat <<-\\EOF >expect &&\n-\t::100644 100644 100644 f00c965d8307308469e537302baa73048488f162 088bd5d92c2a8e0203ca8e7e4c2a5c692f6ae3f7 333b9c62519f285e1854830ade0fe1ef1d40ee1b RR\t\"file\\twith\\ttabs\"\t\"i\\tam\\ttabbed\"\t\"fickle\\tnaming\"\n+\tcat <<-EOF >expect &&\n+\t::100644 100644 100644 $side1df $side2df $headf RR\t\"file\\twith\\ttabs\"\t\"i\\tam\\ttabbed\"\t\"fickle\\tnaming\"\n \tEOF\n \tgit diff-tree -c -M --raw --combined-all-paths HEAD >actual.tmp &&\n \tsed 1d <actual.tmp >actual &&\n@@ -507,7 +514,7 @@ test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names'\n '\n \n test_expect_success FUNNYNAMES '--combined-all-paths and --raw -and -z and funny names' '\n-\tprintf \"aaf8087c3cbd4db8e185a2d074cf27c53cfb75d7\\0::100644 100644 100644 f00c965d8307308469e537302baa73048488f162 088bd5d92c2a8e0203ca8e7e4c2a5c692f6ae3f7 333b9c62519f285e1854830ade0fe1ef1d40ee1b RR\\0file\\twith\\ttabs\\0i\\tam\\ttabbed\\0fickle\\tnaming\\0\" >expect &&\n+\tprintf \"$head\\0::100644 100644 100644 $side1df $side2df $headf RR\\0file\\twith\\ttabs\\0i\\tam\\ttabbed\\0fickle\\tnaming\\0\" >expect &&\n \tgit diff-tree -c -M --raw --combined-all-paths -z HEAD >actual &&\n \ttest_cmp -a expect actual\n '\n"},{"id":"383492","messageId":"20191005211209.18237-13-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 12/15] t4039: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:06Z","receivedAt":"2019-10-05T21:12:24Z","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/t4039-diff-assume-unchanged.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t4039-diff-assume-unchanged.sh b/t/t4039-diff-assume-unchanged.sh\nindex 53ac44b0f0..0eb0314a8b 100755\n--- a/t/t4039-diff-assume-unchanged.sh\n+++ b/t/t4039-diff-assume-unchanged.sh\n@@ -12,6 +12,7 @@ test_expect_success 'setup' '\n \tgit commit -m zero &&\n \techo one > one &&\n \techo two > two &&\n+\tblob=$(git hash-object one) &&\n \tgit add one two &&\n \tgit commit -m onetwo &&\n \tgit update-index --assume-unchanged one &&\n@@ -20,7 +21,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'diff-index does not examine assume-unchanged entries' '\n-\tgit diff-index HEAD^ -- one | grep -q 5626abf0f72e58d7a153368ba57db4c673c0e171\n+\tgit diff-index HEAD^ -- one | grep -q $blob\n '\n \n test_expect_success 'diff-files does not examine assume-unchanged entries' '\n"},{"id":"383493","messageId":"20191005211209.18237-10-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 09/15] t4027: make hash-size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:03Z","receivedAt":"2019-10-05T21:12:25Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Instead of hard-coding the length of an object ID, look this value up\nusing the translation tables.  Similarly, compute input data for invalid\nsubmodule entries using the tables as well.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4027-diff-submodule.sh | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex 9aa8e2b39b..e29deaf4a5 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -6,6 +6,7 @@ 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(\n@@ -36,7 +37,8 @@ test_expect_success setup '\n '\n \n test_expect_success 'git diff --raw HEAD' '\n-\tgit diff --raw --abbrev=40 HEAD >actual &&\n+\thexsz=$(test_oid hexsz) &&\n+\tgit diff --raw --abbrev=$hexsz HEAD >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -245,23 +247,21 @@ test_expect_success 'git diff (empty submodule dir)' '\n '\n \n test_expect_success 'conflicted submodule setup' '\n-\n-\t# 39 efs\n-\tc=fffffffffffffffffffffffffffffffffffffff &&\n+\tc=$(test_oid ff_1) &&\n \t(\n \t\techo \"000000 $ZERO_OID 0\tsub\" &&\n \t\techo \"160000 1$c 1\tsub\" &&\n \t\techo \"160000 2$c 2\tsub\" &&\n \t\techo \"160000 3$c 3\tsub\"\n \t) | git update-index --index-info &&\n-\techo >expect.nosub '\\''diff --cc sub\n+\techo >expect.nosub \"diff --cc sub\n index 2ffffff,3ffffff..0000000\n --- a/sub\n +++ b/sub\n @@@ -1,1 -1,1 +1,1 @@@\n-- Subproject commit 2fffffffffffffffffffffffffffffffffffffff\n- -Subproject commit 3fffffffffffffffffffffffffffffffffffffff\n-++Subproject commit 0000000000000000000000000000000000000000'\\'' &&\n+- Subproject commit 2$c\n+ -Subproject commit 3$c\n+++Subproject commit $ZERO_OID\" &&\n \n \thh=$(git rev-parse HEAD) &&\n \tsed -e \"s/$ZERO_OID/$hh/\" expect.nosub >expect.withsub\n"},{"id":"383494","messageId":"20191005211209.18237-14-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 13/15] t4044: update test to work with SHA-256","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:07Z","receivedAt":"2019-10-05T21:12:25Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This test produces pseudo-collisions and tests git diff's behavior with\nthem, and is therefore sensitive to the hash in use. Update the test to\ncompute the collisions for both SHA-1 and SHA-256 using appropriate\nconstants. Move the heredocs inside the setup block so that all of the\nsetup code can be tested for failure.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4044-diff-index-unique-abbrev.sh | 46 +++++++++++++++++++----------\n 1 file changed, 30 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t4044-diff-index-unique-abbrev.sh b/t/t4044-diff-index-unique-abbrev.sh\nindex 647905e01f..4701796d10 100755\n--- a/t/t4044-diff-index-unique-abbrev.sh\n+++ b/t/t4044-diff-index-unique-abbrev.sh\n@@ -3,34 +3,48 @@\n test_description='test unique sha1 abbreviation on \"index from..to\" line'\n . ./test-lib.sh\n \n-if ! test_have_prereq SHA1\n-then\n-       skip_all='not using SHA-1 for objects'\n-       test_done\n-fi\n-\n-cat >expect_initial <<EOF\n-100644 blob 51d2738463ea4ca66f8691c91e33ce64b7d41bb1\tfoo\n-EOF\n+test_expect_success 'setup' '\n+\ttest_oid_cache <<-EOF &&\n+\tval1 sha1:4827\n+\tval1 sha256:5664\n \n-cat >expect_update <<EOF\n-100644 blob 51d2738efb4ad8a1e40bed839ab8e116f0a15e47\tfoo\n-EOF\n+\tval2 sha1:11742\n+\tval2 sha256:10625\n \n-test_expect_success 'setup' '\n-\techo 4827 > foo &&\n+\thash1 sha1:51d2738463ea4ca66f8691c91e33ce64b7d41bb1\n+\thash1 sha256:ae31dfff0af93b2c62b0098a039b38569c43b0a7e97b873000ca42d128f27350\n+\n+\thasht1 sha1:51d27384\n+\thasht1 sha256:ae31dfff\n+\n+\thash2 sha1:51d2738efb4ad8a1e40bed839ab8e116f0a15e47\n+\thash2 sha256:ae31dffada88a46fd5f53c7ed5aa25a7a8951f1d5e88456c317c8d5484d263e5\n+\n+\thasht2 sha1:51d2738e\n+\thasht2 sha256:ae31dffa\n+\tEOF\n+\n+\tcat >expect_initial <<-EOF &&\n+\t100644 blob $(test_oid hash1)\tfoo\n+\tEOF\n+\n+\tcat >expect_update <<-EOF &&\n+\t100644 blob $(test_oid hash2)\tfoo\n+\tEOF\n+\n+\techo \"$(test_oid val1)\" > foo &&\n \tgit add foo &&\n \tgit commit -m \"initial\" &&\n \tgit cat-file -p HEAD: > actual &&\n \ttest_cmp expect_initial actual &&\n-\techo 11742 > foo &&\n+\techo \"$(test_oid val2)\" > foo &&\n \tgit commit -a -m \"update\" &&\n \tgit cat-file -p HEAD: > actual &&\n \ttest_cmp expect_update actual\n '\n \n cat >expect <<EOF\n-index 51d27384..51d2738e 100644\n+index $(test_oid hasht1)..$(test_oid hasht2) 100644\n EOF\n \n test_expect_success 'diff does not produce ambiguous index line' '\n"},{"id":"383495","messageId":"20191005211209.18237-16-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 15/15] t4048: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:09Z","receivedAt":"2019-10-05T21:12: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/t4048-diff-combined-binary.sh | 58 ++++++++++++++++++---------------\n 1 file changed, 32 insertions(+), 26 deletions(-)\n\ndiff --git a/t/t4048-diff-combined-binary.sh b/t/t4048-diff-combined-binary.sh\nindex 87a8949500..7f9ad9fa3d 100755\n--- a/t/t4048-diff-combined-binary.sh\n+++ b/t/t4048-diff-combined-binary.sh\n@@ -9,24 +9,27 @@ test_expect_success 'setup binary merge conflict' '\n \tgit commit -m one &&\n \techo twoQ2 | q_to_nul >binary &&\n \tgit commit -a -m two &&\n+\ttwo=$(git rev-parse --short HEAD:binary) &&\n \tgit checkout -b branch-binary HEAD^ &&\n \techo threeQ3 | q_to_nul >binary &&\n \tgit commit -a -m three &&\n+\tthree=$(git rev-parse --short HEAD:binary) &&\n \ttest_must_fail git merge master &&\n \techo resolvedQhooray | q_to_nul >binary &&\n-\tgit commit -a -m resolved\n+\tgit commit -a -m resolved &&\n+\tres=$(git rev-parse --short HEAD:binary)\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --git a/binary b/binary\n-index 7ea6ded..9563691 100644\n+index $three..$res 100644\n Binary files a/binary and b/binary differ\n resolved\n \n diff --git a/binary b/binary\n-index 6197570..9563691 100644\n+index $two..$res 100644\n Binary files a/binary and b/binary differ\n EOF\n test_expect_success 'diff -m indicates binary-ness' '\n@@ -34,11 +37,11 @@ test_expect_success 'diff -m indicates binary-ness' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --combined binary\n-index 7ea6ded,6197570..9563691\n+index $three,$two..$res\n Binary files differ\n EOF\n test_expect_success 'diff -c indicates binary-ness' '\n@@ -46,11 +49,11 @@ test_expect_success 'diff -c indicates binary-ness' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --cc binary\n-index 7ea6ded,6197570..9563691\n+index $three,$two..$res\n Binary files differ\n EOF\n test_expect_success 'diff --cc indicates binary-ness' '\n@@ -62,23 +65,26 @@ test_expect_success 'setup non-binary with binary attribute' '\n \tgit checkout master &&\n \ttest_commit one text &&\n \ttest_commit two text &&\n+\ttwo=$(git rev-parse --short HEAD:text) &&\n \tgit checkout -b branch-text HEAD^ &&\n \ttest_commit three text &&\n+\tthree=$(git rev-parse --short HEAD:text) &&\n \ttest_must_fail git merge master &&\n \ttest_commit resolved text &&\n+\tres=$(git rev-parse --short HEAD:text) &&\n \techo text -diff >.gitattributes\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --git a/text b/text\n-index 2bdf67a..2ab19ae 100644\n+index $three..$res 100644\n Binary files a/text and b/text differ\n resolved\n \n diff --git a/text b/text\n-index f719efd..2ab19ae 100644\n+index $two..$res 100644\n Binary files a/text and b/text differ\n EOF\n test_expect_success 'diff -m respects binary attribute' '\n@@ -86,11 +92,11 @@ test_expect_success 'diff -m respects binary attribute' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --combined text\n-index 2bdf67a,f719efd..2ab19ae\n+index $three,$two..$res\n Binary files differ\n EOF\n test_expect_success 'diff -c respects binary attribute' '\n@@ -98,11 +104,11 @@ test_expect_success 'diff -c respects binary attribute' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --cc text\n-index 2bdf67a,f719efd..2ab19ae\n+index $three,$two..$res\n Binary files differ\n EOF\n test_expect_success 'diff --cc respects binary attribute' '\n@@ -115,11 +121,11 @@ test_expect_success 'setup textconv attribute' '\n \tgit config diff.upcase.textconv \"tr a-z A-Z <\"\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --git a/text b/text\n-index 2bdf67a..2ab19ae 100644\n+index $three..$res 100644\n --- a/text\n +++ b/text\n @@ -1 +1 @@\n@@ -128,7 +134,7 @@ index 2bdf67a..2ab19ae 100644\n resolved\n \n diff --git a/text b/text\n-index f719efd..2ab19ae 100644\n+index $two..$res 100644\n --- a/text\n +++ b/text\n @@ -1 +1 @@\n@@ -140,11 +146,11 @@ test_expect_success 'diff -m respects textconv attribute' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --combined text\n-index 2bdf67a,f719efd..2ab19ae\n+index $three,$two..$res\n --- a/text\n +++ b/text\n @@@ -1,1 -1,1 +1,1 @@@\n@@ -157,11 +163,11 @@ test_expect_success 'diff -c respects textconv attribute' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n resolved\n \n diff --cc text\n-index 2bdf67a,f719efd..2ab19ae\n+index $three,$two..$res\n --- a/text\n +++ b/text\n @@@ -1,1 -1,1 +1,1 @@@\n@@ -174,9 +180,9 @@ test_expect_success 'diff --cc respects textconv attribute' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n diff --combined text\n-index 2bdf67a,f719efd..2ab19ae\n+index $three,$two..$res\n --- a/text\n +++ b/text\n @@@ -1,1 -1,1 +1,1 @@@\n@@ -190,9 +196,9 @@ test_expect_success 'diff-tree plumbing does not respect textconv' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<'EOF'\n+cat >expect <<EOF\n diff --cc text\n-index 2bdf67a,f719efd..0000000\n+index $three,$two..0000000\n --- a/text\n +++ b/text\n @@@ -1,1 -1,1 +1,5 @@@\n"},{"id":"383496","messageId":"20191005211209.18237-15-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 14/15] t4045: make hash-size independent","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:08Z","receivedAt":"2019-10-05T21:12:28Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Replace a hard-coded all-zeros object ID with a use of $ZERO_OID.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4045-diff-relative.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4045-diff-relative.sh b/t/t4045-diff-relative.sh\nindex 36f8ed8a81..258808708e 100755\n--- a/t/t4045-diff-relative.sh\n+++ b/t/t4045-diff-relative.sh\n@@ -70,7 +70,7 @@ check_raw () {\n \texpect=$1\n \tshift\n \tcat >expected <<-EOF\n-\t:000000 100644 0000000000000000000000000000000000000000 $blob A\t$expect\n+\t:000000 100644 $ZERO_OID $blob A\t$expect\n \tEOF\n \ttest_expect_success \"--raw $*\" \"\n \t\tgit -C '$dir' diff --no-abbrev --raw $* HEAD^ >actual &&\n"},{"id":"383497","messageId":"20191005211209.18237-11-sandals@crustytoothpaste.net","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"[PATCH 10/15] t4034: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-05T21:12:04Z","receivedAt":"2019-10-05T21:12:28Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Adjust the test so that it computes variables for object IDs instead of\nusing hard-coded hashes.  Move some expected result heredocs around so\nthat they can use computed variables.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n t/t4034-diff-words.sh | 93 +++++++++++++++++++++++++------------------\n 1 file changed, 54 insertions(+), 39 deletions(-)\n\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex 9a93c2a3e0..fb145aa173 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -19,9 +19,11 @@ cat >post.simple <<-\\EOF\n \n \taeff = aeff * ( aaa )\n EOF\n-cat >expect.letter-runs-are-words <<-\\EOF\n+pre=$(git rev-parse --short $(git hash-object pre.simple))\n+post=$(git rev-parse --short $(git hash-object post.simple))\n+cat >expect.letter-runs-are-words <<-EOF\n \t<BOLD>diff --git a/pre b/post<RESET>\n-\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t<BOLD>index $pre..$post 100644<RESET>\n \t<BOLD>--- a/pre<RESET>\n \t<BOLD>+++ b/post<RESET>\n \t<CYAN>@@ -1,3 +1,7 @@<RESET>\n@@ -33,9 +35,9 @@ cat >expect.letter-runs-are-words <<-\\EOF\n \n \t<GREEN>aeff = aeff * ( aaa<RESET> )\n EOF\n-cat >expect.non-whitespace-is-word <<-\\EOF\n+cat >expect.non-whitespace-is-word <<-EOF\n \t<BOLD>diff --git a/pre b/post<RESET>\n-\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t<BOLD>index $pre..$post 100644<RESET>\n \t<BOLD>--- a/pre<RESET>\n \t<BOLD>+++ b/post<RESET>\n \t<CYAN>@@ -1,3 +1,7 @@<RESET>\n@@ -49,9 +51,12 @@ cat >expect.non-whitespace-is-word <<-\\EOF\n EOF\n \n word_diff () {\n+\tpre=$(git rev-parse --short $(git hash-object pre)) &&\n+\tpost=$(git rev-parse --short $(git hash-object post)) &&\n \ttest_must_fail git diff --no-index \"$@\" pre post >output &&\n \ttest_decode_color <output >output.decrypted &&\n-\ttest_cmp expect output.decrypted\n+\tsed -e \"2s/index [^ ]*/index $pre..$post/\" expect >expected\n+\ttest_cmp expected output.decrypted\n }\n \n test_language_driver () {\n@@ -77,9 +82,9 @@ test_expect_success 'set up pre and post with runs of whitespace' '\n '\n \n test_expect_success 'word diff with runs of whitespace' '\n-\tcat >expect <<-\\EOF &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1,3 +1,7 @@<RESET>\n@@ -97,9 +102,9 @@ test_expect_success 'word diff with runs of whitespace' '\n '\n \n test_expect_success '--word-diff=porcelain' '\n-\tsed 's/#.*$//' >expect <<-\\EOF &&\n+\tsed 's/#.*$//' >expect <<-EOF &&\n \t\tdiff --git a/pre b/post\n-\t\tindex 330b04f..5ed8eff 100644\n+\t\tindex $pre..$post 100644\n \t\t--- a/pre\n \t\t+++ b/post\n \t\t@@ -1,3 +1,7 @@\n@@ -121,9 +126,9 @@ test_expect_success '--word-diff=porcelain' '\n '\n \n test_expect_success '--word-diff=plain' '\n-\tcat >expect <<-\\EOF &&\n+\tcat >expect <<-EOF &&\n \t\tdiff --git a/pre b/post\n-\t\tindex 330b04f..5ed8eff 100644\n+\t\tindex $pre..$post 100644\n \t\t--- a/pre\n \t\t+++ b/post\n \t\t@@ -1,3 +1,7 @@\n@@ -140,9 +145,9 @@ test_expect_success '--word-diff=plain' '\n '\n \n test_expect_success '--word-diff=plain --color' '\n-\tcat >expect <<-\\EOF &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1,3 +1,7 @@<RESET>\n@@ -158,9 +163,9 @@ test_expect_success '--word-diff=plain --color' '\n '\n \n test_expect_success 'word diff without context' '\n-\tcat >expect <<-\\EOF &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1 +1 @@<RESET>\n@@ -207,9 +212,9 @@ test_expect_success 'command-line overrides config' '\n '\n \n test_expect_success 'command-line overrides config: --word-diff-regex' '\n-\tcat >expect <<-\\EOF &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1,3 +1,7 @@<RESET>\n@@ -234,9 +239,9 @@ test_expect_success 'setup: remove diff driver regex' '\n '\n \n test_expect_success 'use configured regex' '\n-\tcat >expect <<-\\EOF &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index 330b04f..5ed8eff 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1,3 +1,7 @@<RESET>\n@@ -254,9 +259,11 @@ test_expect_success 'use configured regex' '\n test_expect_success 'test parsing words for newline' '\n \techo \"aaa (aaa)\" >pre &&\n \techo \"aaa (aaa) aaa\" >post &&\n-\tcat >expect <<-\\EOF &&\n+\tpre=$(git rev-parse --short $(git hash-object pre)) &&\n+\tpost=$(git rev-parse --short $(git hash-object post)) &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index c29453b..be22f37 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1 +1 @@<RESET>\n@@ -268,9 +275,11 @@ test_expect_success 'test parsing words for newline' '\n test_expect_success 'test when words are only removed at the end' '\n \techo \"(:\" >pre &&\n \techo \"(\" >post &&\n-\tcat >expect <<-\\EOF &&\n+\tpre=$(git rev-parse --short $(git hash-object pre)) &&\n+\tpost=$(git rev-parse --short $(git hash-object post)) &&\n+\tcat >expect <<-EOF &&\n \t\t<BOLD>diff --git a/pre b/post<RESET>\n-\t\t<BOLD>index 289cb9d..2d06f37 100644<RESET>\n+\t\t<BOLD>index $pre..$post 100644<RESET>\n \t\t<BOLD>--- a/pre<RESET>\n \t\t<BOLD>+++ b/post<RESET>\n \t\t<CYAN>@@ -1 +1 @@<RESET>\n@@ -282,9 +291,11 @@ test_expect_success 'test when words are only removed at the end' '\n test_expect_success '--word-diff=none' '\n \techo \"(:\" >pre &&\n \techo \"(\" >post &&\n-\tcat >expect <<-\\EOF &&\n+\tpre=$(git rev-parse --short $(git hash-object pre)) &&\n+\tpost=$(git rev-parse --short $(git hash-object post)) &&\n+\tcat >expect <<-EOF &&\n \t\tdiff --git a/pre b/post\n-\t\tindex 289cb9d..2d06f37 100644\n+\t\tindex $pre..$post 100644\n \t\t--- a/pre\n \t\t+++ b/post\n \t\t@@ -1 +1 @@\n@@ -317,16 +328,6 @@ test_language_driver ruby\n test_language_driver tex\n \n test_expect_success 'word-diff with diff.sbe' '\n-\tcat >expect <<-\\EOF &&\n-\tdiff --git a/pre b/post\n-\tindex a1a53b5..bc8fe6d 100644\n-\t--- a/pre\n-\t+++ b/post\n-\t@@ -1,3 +1,3 @@\n-\ta\n-\n-\t[-b-]{+c+}\n-\tEOF\n \tcat >pre <<-\\EOF &&\n \ta\n \n@@ -337,21 +338,35 @@ test_expect_success 'word-diff with diff.sbe' '\n \n \tc\n \tEOF\n+\tpre=$(git rev-parse --short $(git hash-object pre)) &&\n+\tpost=$(git rev-parse --short $(git hash-object post)) &&\n+\tcat >expect <<-EOF &&\n+\tdiff --git a/pre b/post\n+\tindex $pre..$post 100644\n+\t--- a/pre\n+\t+++ b/post\n+\t@@ -1,3 +1,3 @@\n+\ta\n+\n+\t[-b-]{+c+}\n+\tEOF\n \ttest_config diff.suppress-blank-empty true &&\n \tword_diff --word-diff=plain\n '\n \n test_expect_success 'word-diff with no newline at EOF' '\n-\tcat >expect <<-\\EOF &&\n+\tprintf \"%s\" \"a a a a a\" >pre &&\n+\tprintf \"%s\" \"a a ab a a\" >post &&\n+\tpre=$(git rev-parse --short $(git hash-object pre)) &&\n+\tpost=$(git rev-parse --short $(git hash-object post)) &&\n+\tcat >expect <<-EOF &&\n \tdiff --git a/pre b/post\n-\tindex 7bf316e..3dd0303 100644\n+\tindex $pre..$post 100644\n \t--- a/pre\n \t+++ b/post\n \t@@ -1 +1 @@\n \ta a [-a-]{+ab+} a a\n \tEOF\n-\tprintf \"%s\" \"a a a a a\" >pre &&\n-\tprintf \"%s\" \"a a ab a a\" >post &&\n \tword_diff --word-diff=plain\n '\n \n"},{"id":"383672","messageId":"3cb91b69-7d33-12ab-de37-175592f95df7@gmail.com","threadId":"51978","inReplyTo":"20191005211209.18237-4-sandals@crustytoothpaste.net","subject":"Re: [PATCH 03/15] rev-parse: add an --object-format option","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-10-08T11:51:45Z","receivedAt":"2019-10-08T11:51:48Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 10/5/2019 5:11 PM, brian m. carlson wrote:\n> Add an option to print the object format used for input, output, or\n> storage. This allows shell scripts to discover the hash algorithm in\n> use.\n\nWhy put this in 'rev-parse'? Is a test helper not an option for this?\n\n-Stolee\n"},{"id":"383676","messageId":"4733b8a0-bfd9-a49a-01d2-1c9f2a48cdf8@gmail.com","threadId":"51978","inReplyTo":"20191005211209.18237-8-sandals@crustytoothpaste.net","subject":"Re: [PATCH 07/15] t4011: abstract away SHA-1-specific constants","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-10-08T12:21:48Z","receivedAt":"2019-10-08T12:21:51Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 10/5/2019 5:12 PM, brian m. carlson wrote:\n> Adjust the test so that it computes variables for object IDs instead of\n> using hard-coded hashes.\n\n[snip]\n\n> @@ -137,14 +141,17 @@ test_expect_success SYMLINKS 'setup symlinks with attributes' '\n>  '\n>  \n>  test_expect_success SYMLINKS 'symlinks do not respect userdiff config by path' '\n> -\tcat >expect <<-\\EOF &&\n> +\tfile=$(git rev-parse --short $(git hash-object file.bin)) &&\n> +\tlink=$(git rev-parse --short \\\n> +\t\t$(printf file.bin | git hash-object --stdin)) &&\n\nWhy this change from $(git hash-object file.bin) to\n$(printf file.bin | git hash-object --stdin)?\n\nFor that matter, why are you using the \"printf|git hash-object\"\npattern throughout your change? Seems like an unnecessary hurdle\nto me.\n\n-Stolee\n"},{"id":"383677","messageId":"bbbd3152-b7ea-f59c-afff-6c0c5b5c9612@gmail.com","threadId":"51978","inReplyTo":"20191005211209.18237-9-sandals@crustytoothpaste.net","subject":"Re: [PATCH 08/15] t4015: abstract away SHA-1-specific constants","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-10-08T12:31:24Z","receivedAt":"2019-10-08T12:31:27Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 10/5/2019 5:12 PM, brian m. carlson wrote:\n> Adjust the test so that it computes variables for object IDs instead of\n> using hard-coded hashes.\n> \n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  t/t4015-diff-whitespace.sh | 89 +++++++++++++++++++++++---------------\n>  1 file changed, 53 insertions(+), 36 deletions(-)\n> \n> diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\n> index 6b087df3dc..eadaf57262 100755\n> --- a/t/t4015-diff-whitespace.sh\n> +++ b/t/t4015-diff-whitespace.sh\n> @@ -16,6 +16,7 @@ test_expect_success \"Ray Lehtiniemi's example\" '\n>  \t} while (0);\n>  \tEOF\n>  \tgit update-index --add x &&\n> +\tbefore=$(git rev-parse --short $(git hash-object x)) &&\n\nI see you are using $(git hash-object <name>) here (no printf). Seems\nlike you could use the same pattern in the previous patch.\n\n-Stolee\n\n"},{"id":"383679","messageId":"CAKPyHN3NaBv5s9aefb8fTDeGto2tLyTa0DxTjbWO9pGRY22pPQ@mail.gmail.com","threadId":"51978","inReplyTo":"4733b8a0-bfd9-a49a-01d2-1c9f2a48cdf8@gmail.com","subject":"Re: [PATCH 07/15] t4011: abstract away SHA-1-specific constants","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2019-10-08T12:33:43Z","receivedAt":"2019-10-08T12:33:56Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Tue, Oct 8, 2019 at 2:21 PM Derrick Stolee <stolee@gmail.com> wrote:\n>\n> On 10/5/2019 5:12 PM, brian m. carlson wrote:\n> > Adjust the test so that it computes variables for object IDs instead of\n> > using hard-coded hashes.\n>\n> [snip]\n>\n> > @@ -137,14 +141,17 @@ test_expect_success SYMLINKS 'setup symlinks with attributes' '\n> >  '\n> >\n> >  test_expect_success SYMLINKS 'symlinks do not respect userdiff config by path' '\n> > -     cat >expect <<-\\EOF &&\n> > +     file=$(git rev-parse --short $(git hash-object file.bin)) &&\n> > +     link=$(git rev-parse --short \\\n> > +             $(printf file.bin | git hash-object --stdin)) &&\n>\n> Why this change from $(git hash-object file.bin) to\n> $(printf file.bin | git hash-object --stdin)?\n\nthats two different things. The first hashes the content of file\n\"file.bin\". The second hashes the literal string \"file.bin\". To avoid\nthis confusion, may I suggest to use 'printf \"%s\" \"file.bin\"', so that\nit is clear, that the literal string is meant in this context?\n\nBert\n\n>\n> For that matter, why are you using the \"printf|git hash-object\"\n> pattern throughout your change? Seems like an unnecessary hurdle\n> to me.\n>\n> -Stolee\n"},{"id":"383680","messageId":"db17a07f-1edc-f55a-8dc6-ab41287afcc6@gmail.com","threadId":"51978","inReplyTo":"CAKPyHN3NaBv5s9aefb8fTDeGto2tLyTa0DxTjbWO9pGRY22pPQ@mail.gmail.com","subject":"Re: [PATCH 07/15] t4011: abstract away SHA-1-specific constants","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-10-08T12:38:03Z","receivedAt":"2019-10-08T12:38:06Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 10/8/2019 8:33 AM, Bert Wesarg wrote:\n> On Tue, Oct 8, 2019 at 2:21 PM Derrick Stolee <stolee@gmail.com> wrote:\n>>\n>> On 10/5/2019 5:12 PM, brian m. carlson wrote:\n>>> Adjust the test so that it computes variables for object IDs instead of\n>>> using hard-coded hashes.\n>>\n>> [snip]\n>>\n>>> @@ -137,14 +141,17 @@ test_expect_success SYMLINKS 'setup symlinks with attributes' '\n>>>  '\n>>>\n>>>  test_expect_success SYMLINKS 'symlinks do not respect userdiff config by path' '\n>>> -     cat >expect <<-\\EOF &&\n>>> +     file=$(git rev-parse --short $(git hash-object file.bin)) &&\n>>> +     link=$(git rev-parse --short \\\n>>> +             $(printf file.bin | git hash-object --stdin)) &&\n>>\n>> Why this change from $(git hash-object file.bin) to\n>> $(printf file.bin | git hash-object --stdin)?\n> \n> thats two different things. The first hashes the content of file\n> \"file.bin\". The second hashes the literal string \"file.bin\". To avoid\n> this confusion, may I suggest to use 'printf \"%s\" \"file.bin\"', so that\n> it is clear, that the literal string is meant in this context?\n\nAh, and because the resulting hash is for the contents of the symlink\n(not the contents of the file), it makes sense to use printf here.\n\nThanks for the clarification!\n\n-Stolee\n"},{"id":"383681","messageId":"99b996a5-1c68-c186-b480-fdd2ed69cae9@gmail.com","threadId":"51978","inReplyTo":"20191005211209.18237-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH 00/15] SHA-256 test fixes, part 6","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-10-08T12:40:28Z","receivedAt":"2019-10-08T12:40:32Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 10/5/2019 5:11 PM, brian m. carlson wrote:\n> This series consists mostly of additional test fixes for SHA-256, plus\n> some test framework improvements and a new option to rev-parse.\n> \n> Up until now, most of the test changes have been directly related to\n> fixing hash values or sizes in some way.  In other words, previous test\n> fixes would be required even for a Git binary that supported only\n> SHA-256 and not SHA-1.\n> \n> In this series, we also introduce some test changes that deal with the\n> extension that will allow the same binary to handle both.  The changes\n> themselves are relatively uninteresting, but changes like these will be\n> making appearances in future test fix series as well.  They may appear\n> bizarre and out of place at times, but rest assured that they will be\n> useful in the future.\n> \n> The other notable thing in this series is the introduction of a new\n> rev-parse option, --object-format.  We know, according to the transition\n> plan, that we'll need to support users working with input and output\n> in different hash algorithms.  Since we're starting to see this kind of\n> code appear in the codebase, it makes sense to introduce a helper that\n> lets scripters determine the appropriate value, and we should introduce\n> this code sooner, rather than later, so people can start using it.\n> \n> We had had some discussions about the name of options to be used for\n> hash algorithms but I don't recall us coming to a definitive conclusion.\n> Opinions about the name[0] are of course welcome.  I'm not particularly\n> attached to any name, so whatever the consensus is works for me.\n> \n> [0] Possibilities include --object-format, --show-object-format, --hash,\n> --show-hash, --hash-algorithm, --show-hash-algorithm, and more.\nOutside of a question regarding using a test-tool instead of adding an\noption to 'git rev-parse', I found this series very readable.\n\nMy confusion around the printf|git hash-object stuff that is now\nresolved. The error was in my reading, not in the presentation.\n\nThanks for your continued hard work on this subject!\n\n-Stolee\n"},{"id":"383703","messageId":"20191008193104.xepgqzqvftsixkpo@camp.crustytoothpaste.net","threadId":"51978","inReplyTo":"3cb91b69-7d33-12ab-de37-175592f95df7@gmail.com","subject":"Re: [PATCH 03/15] rev-parse: add an --object-format option","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-08T19:31:04Z","receivedAt":"2019-10-08T19:31:12Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-10-08 at 11:51:45, Derrick Stolee wrote:\n> On 10/5/2019 5:11 PM, brian m. carlson wrote:\n> > Add an option to print the object format used for input, output, or\n> > storage. This allows shell scripts to discover the hash algorithm in\n> > use.\n> \n> Why put this in 'rev-parse'? Is a test helper not an option for this?\n\nWe do have a test helper for this, which is the first patch in the\nseries.  This rev-parse option is designed to be useful to scripters\nmore than anything else, and it will make an appearance in a later\nseries.\n\nI sent it here since it's vaguely useful for tests and I also wanted to\nmake sure it was available sooner rather than later so folks can start\nusing it.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"383706","messageId":"20191008194012.4s35pbwbh25rblhb@camp.crustytoothpaste.net","threadId":"51978","inReplyTo":"CAKPyHN3NaBv5s9aefb8fTDeGto2tLyTa0DxTjbWO9pGRY22pPQ@mail.gmail.com","subject":"Re: [PATCH 07/15] t4011: abstract away SHA-1-specific constants","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-08T19:40:12Z","receivedAt":"2019-10-08T19:40:22Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-10-08 at 12:33:43, Bert Wesarg wrote:\n> On Tue, Oct 8, 2019 at 2:21 PM Derrick Stolee <stolee@gmail.com> wrote:\n> >\n> > On 10/5/2019 5:12 PM, brian m. carlson wrote:\n> > > Adjust the test so that it computes variables for object IDs instead of\n> > > using hard-coded hashes.\n> >\n> > [snip]\n> >\n> > > @@ -137,14 +141,17 @@ test_expect_success SYMLINKS 'setup symlinks with attributes' '\n> > >  '\n> > >\n> > >  test_expect_success SYMLINKS 'symlinks do not respect userdiff config by path' '\n> > > -     cat >expect <<-\\EOF &&\n> > > +     file=$(git rev-parse --short $(git hash-object file.bin)) &&\n> > > +     link=$(git rev-parse --short \\\n> > > +             $(printf file.bin | git hash-object --stdin)) &&\n> >\n> > Why this change from $(git hash-object file.bin) to\n> > $(printf file.bin | git hash-object --stdin)?\n> \n> thats two different things. The first hashes the content of file\n> \"file.bin\". The second hashes the literal string \"file.bin\". To avoid\n> this confusion, may I suggest to use 'printf \"%s\" \"file.bin\"', so that\n> it is clear, that the literal string is meant in this context?\n\nThis is completely correct, and, yes, I can definitely make that change.\nIn fact, the fact that this is confusing probably means I should use a\nsuitably named shell function for this, so I'll make that change when I\nreroll.\n\n> > For that matter, why are you using the \"printf|git hash-object\"\n> > pattern throughout your change? Seems like an unnecessary hurdle\n> > to me.\n\nI would normally use echo for these types of things (because that's our\nstyle and it's more customary), but in this case the symlink contents\ndon't contain a newline, so printf is required.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}