{"thread":{"id":"66372","subject":"[PATCH v6 0/3] t40*: modernize","startedAt":"2026-09-22T20:22:00Z","lastAt":"2026-09-25T13:41:07Z","messageCount":8,"participants":["Mark C. Chu-Carroll","Kaartic Sivaraam","Junio C Hamano"],"isPatch":true,"patchVersion":6,"patchTotal":3},"messages":[{"id":"553015","messageId":"20260922202152.842793-2-markchucarroll@fastmail.com","threadId":"66372","inReplyTo":"20260922202152.842793-1-markchucarroll@fastmail.com","subject":"[PATCH v6 1/3] t4001: modernize","fromName":"Mark C. Chu-Carroll","fromEmail":"markchucarroll@fastmail.com","sentAt":"2026-09-22T20:21:50Z","receivedAt":"2026-09-22T20:21:57Z","isPatch":true,"body":"    Old tests were written in a different style than modern\n    ones; for better readability and test error messages,\n    update t4001 to the modern style.\n\n    * run everything inside of a test_expect_success block.\n    * write title line on the same line as test_expect_success,\n      end that line with a single quote that opens the body of the test,\n      and end the test with a single quote that closes the body.\n    * write expected output of a test to a file named \"expect\",\n      and actual output to a file named \"actual\".\n    * write here-docs using \"<<-\" syntax, so that they're indented\n      uniformly with the rest of the test.\n    * make test names more clearly reflect the functionality that\n      they test.\n\nSigned-off-by: Mark C. Chu-Carroll <markchucarroll@fastmail.com>\n---\n t/t4001-diff-rename.sh | 89 ++++++++++++++++++------------------------\n 1 file changed, 38 insertions(+), 51 deletions(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex ad474100af..1a2474af10 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -26,7 +26,7 @@ test_expect_success 'setup' '\n \tLine 14\n \tLine 15\n \tEOF\n-\tcat >expected <<-\\EOF &&\n+\tcat >expect <<-\\EOF &&\n \tdiff --git a/path0 b/path1\n \trename from path0\n \trename to path1\n@@ -42,7 +42,7 @@ test_expect_success 'setup' '\n \t Line 13\n \t Line 14\n \tEOF\n-\tcat >no-rename <<-\\EOF\n+\tcat >expect-no-rename <<-\\EOF &&\n \tdiff --git a/path0 b/path0\n \tdeleted file mode 100644\n \tindex fdbec44..0000000\n@@ -86,47 +86,34 @@ test_expect_success 'setup' '\n \t+Line 14\n \t+Line 15\n \tEOF\n+\tgit update-index --add path0\n '\n \n-test_expect_success \\\n-    'update-index --add a file.' \\\n-    'git update-index --add path0'\n-\n-test_expect_success \\\n-    'write that tree.' \\\n-    'tree=$(git write-tree) && echo $tree'\n-\n-sed -e 's/line/Line/' <path0 >path1\n-rm -f path0\n-test_expect_success \\\n-    'renamed and edited the file.' \\\n-    'git update-index --add --remove path0 path1'\n-\n-test_expect_success \\\n-    'git diff-index -p -M after rename and editing.' \\\n-    'git diff-index -p -M $tree >current'\n-\n-\n-test_expect_success \\\n-    'validate the output.' \\\n-    'compare_diff_patch current expected'\n+test_expect_success 'diff shows path0 renamed to path1 with edit' '\n+\ttree=$(git write-tree) &&\n+\tsed -e \"s/line/Line/\" <path0 >path1 &&\n+\trm -f path0 &&\n+\tgit update-index --add --remove path0 path1 &&\n+\tgit diff-index -p -M $tree >actual &&\n+\tcompare_diff_patch actual expect\n+'\n \n-test_expect_success 'test diff.renames=true' '\n-\tgit -c diff.renames=true diff --cached $tree >current &&\n-\tcompare_diff_patch current expected\n+test_expect_success 'with diff.renames=true, patch includes rename of path0 to path1' '\n+\tgit -c diff.renames=true diff --cached $tree >actual &&\n+\tcompare_diff_patch actual expect\n '\n \n-test_expect_success 'test diff.renames=false' '\n-\tgit -c diff.renames=false diff --cached $tree >current &&\n-\tcompare_diff_patch current no-rename\n+test_expect_success 'with diff.renames=false, patch does not include rename' '\n+\tgit -c diff.renames=false diff --cached $tree >actual &&\n+\tcompare_diff_patch actual expect-no-rename\n '\n \n-test_expect_success 'test diff.renames unset' '\n-\tgit diff --cached $tree >current &&\n-\tcompare_diff_patch current expected\n+test_expect_success 'with no setting for diff.renames, patch includes rename' '\n+\tgit diff --cached $tree >actual &&\n+\tcompare_diff_patch actual expect\n '\n \n-test_expect_success 'favour same basenames over different ones' '\n+test_expect_success 'diff rename favours same basenames over different ones' '\n \tcp path1 another-path &&\n \tgit add another-path &&\n \tgit commit -m 1 &&\n@@ -137,25 +124,25 @@ test_expect_success 'favour same basenames over different ones' '\n \ttest_grep \"renamed: .*path1 -> subdir/path1\" out\n '\n \n-test_expect_success 'test diff.renames=true for git status' '\n+test_expect_success 'with diff.renames=true, git status includes rename' '\n \tgit -c diff.renames=true status >out &&\n \ttest_grep \"renamed: .*path1 -> subdir/path1\" out\n '\n \n-test_expect_success 'test diff.renames=false for git status' '\n+test_expect_success 'with diff.renames=false, git status shows delete/add' '\n \tgit -c diff.renames=false status >out &&\n \ttest_grep ! \"renamed: .*path1 -> subdir/path1\" out &&\n \ttest_grep \"new file: .*subdir/path1\" out &&\n \ttest_grep \"deleted: .*[^/]path1\" out\n '\n \n-test_expect_success 'favour same basenames even with minor differences' '\n+test_expect_success 'rename logic favours same basenames even with minor differences' '\n \tgit show HEAD:path1 | sed \"s/15/16/\" > subdir/path1 &&\n \tgit status >out &&\n \ttest_grep \"renamed: .*path1 -> subdir/path1\" out\n '\n \n-test_expect_success 'two files with same basename and same content' '\n+test_expect_success 'rename logic favors common path segments for files with the same basename and content' '\n \tgit reset --hard &&\n \tmkdir -p dir/A dir/B &&\n \tcp path1 dir/A/file &&\n@@ -167,7 +154,7 @@ test_expect_success 'two files with same basename and same content' '\n \ttest_grep \"renamed: .*dir/A/file -> other-dir/A/file\" out\n '\n \n-test_expect_success 'setup for many rename source candidates' '\n+test_expect_success 'rename with many candidates' '\n \tgit reset --hard &&\n \tfor i in 0 1 2 3 4 5 6 7 8 9;\n \tdo\n@@ -184,7 +171,7 @@ test_expect_success 'setup for many rename source candidates' '\n \tgit add new-path path1 &&\n \tgit diff -l 4 -C -C --cached --name-status >actual 2>actual.err &&\n \tsed -e \"s/^\\([CM]\\)[0-9]*\t/\\1\t/\" actual >actual.munged &&\n-\tcat >expect <<-EOF &&\n+\tcat >expect <<-\\EOF &&\n \tC\tpath1\tnew-path\n \tM\tpath1\n \tEOF\n@@ -192,7 +179,7 @@ test_expect_success 'setup for many rename source candidates' '\n \ttest_grep warning actual.err\n '\n \n-test_expect_success 'rename pretty print with nothing in common' '\n+test_expect_success 'pretty-print paths with nothing in common after rename' '\n \tmkdir -p a/b/ &&\n \t: >a/b/c &&\n \tgit add a/b/c &&\n@@ -206,7 +193,7 @@ test_expect_success 'rename pretty print with nothing in common' '\n \ttest_grep \" a/b/c => c/b/a \" output\n '\n \n-test_expect_success 'rename pretty print with common prefix' '\n+test_expect_success 'pretty print paths with common prefix after rename' '\n \tmkdir -p c/d &&\n \tgit mv c/b/a c/d/e &&\n \tgit commit -m \"c/b/a -> c/d/e\" &&\n@@ -216,7 +203,7 @@ test_expect_success 'rename pretty print with common prefix' '\n \ttest_grep \" c/{b/a => d/e} \" output\n '\n \n-test_expect_success 'rename pretty print with common suffix' '\n+test_expect_success 'pretty prints paths with common suffix after rename' '\n \tmkdir d &&\n \tgit mv c/d/e d/e &&\n \tgit commit -m \"c/d/e -> d/e\" &&\n@@ -226,7 +213,7 @@ test_expect_success 'rename pretty print with common suffix' '\n \ttest_grep \" {c/d => d}/e \" output\n '\n \n-test_expect_success 'rename pretty print with common prefix and suffix' '\n+test_expect_success 'pretty prints paths with common prefix and suffix after rename' '\n \tmkdir d/f &&\n \tgit mv d/e d/f/e &&\n \tgit commit -m \"d/e -> d/f/e\" &&\n@@ -236,7 +223,7 @@ test_expect_success 'rename pretty print with common prefix and suffix' '\n \ttest_grep \" d/{ => f}/e \" output\n '\n \n-test_expect_success 'rename pretty print common prefix and suffix overlap' '\n+test_expect_success 'pretty prints paths with common prefix and suffix overlap after rename' '\n \tmkdir d/f/f &&\n \tgit mv d/f/e d/f/f/e &&\n \tgit commit -m \"d/f/e d/f/f/e\" &&\n@@ -261,7 +248,7 @@ test_expect_success 'diff-tree -l0 defaults to a big rename limit, not zero' '\n \ttest_grep \"myotherfile.*myfile\" actual\n '\n \n-test_expect_success 'basename similarity vs best similarity' '\n+test_expect_success 'rename prefers basename similarity over best similarity' '\n \tmkdir subdir &&\n \ttest_write_lines line1 line2 line3 line4 line5 \\\n \t\t\t line6 line7 line8 line9 line10 >subdir/file.txt &&\n@@ -278,14 +265,14 @@ test_expect_success 'basename similarity vs best similarity' '\n \tgit diff-tree -r -M --name-status HEAD^ HEAD >actual &&\n \t# subdir/file.txt is 88% similar to file.md, 78% similar to file.txt,\n \t# but since same basenames are checked first...\n-\tcat >expected <<-\\EOF &&\n+\tcat >expect <<-\\EOF &&\n \tA\tfile.md\n \tR078\tsubdir/file.txt\tfile.txt\n \tEOF\n-\ttest_cmp expected actual\n+\ttest_cmp expect actual\n '\n \n-test_expect_success 'last line matters too' '\n+test_expect_success 'file similarity handles missing trailing newline.' '\n \t{\n \t\ttest_write_lines a 0 1 2 3 4 5 6 7 8 9 &&\n \t\tprintf \"git ignores final up to 63 characters if not newline terminated\"\n@@ -303,10 +290,10 @@ test_expect_success 'last line matters too' '\n \tgit commit -a -m \"rename no-final-lf -> still-absent-final-lf\" &&\n \tgit diff-tree -r -M --name-status HEAD^ HEAD >actual &&\n \tsed -e \"s/^R[0-9]*\t/R\t/\" actual >actual.munged &&\n-\tcat >expected <<-\\EOF &&\n+\tcat >expect <<-\\EOF &&\n \tR\tno-final-lf\tstill-absent-final-lf\n \tEOF\n-\ttest_cmp expected actual.munged\n+\ttest_cmp expect actual.munged\n '\n \n test_done\n-- \n2.53.0\n\n"},{"id":"553013","messageId":"20260922202152.842793-1-markchucarroll@fastmail.com","threadId":"66372","inReplyTo":null,"subject":"[PATCH v6 0/3] t40*: modernize","fromName":"Mark C. Chu-Carroll","fromEmail":"markchucarroll@fastmail.com","sentAt":"2026-09-22T20:21:49Z","receivedAt":"2026-09-22T20:22:00Z","isPatch":true,"body":"Changes in v6:\n- Fix rebase error to separate commits correctly.\n\n- Link to v5: https://lore.kernel.org/git/20260922143119.3313620-1-markchucarroll@fastmail.com/T/#t\n\nChanges in v5:\n- Update t4001.sh to the correct commit version. (Argh!)\n\n- Link to v4: https://lore.kernel.org/git/20260918171847.2670739-1-markchucarroll@fastmail.com/\n\nChanges in v4:\n- use a \"test_expect_success 'setup'\" instead of setup functions\n- make capitalization in test assertions consistent.\n- improve naming of rename tests.\n- make all indentations use tabs correctly.\n\n- Link to v3: https://lore.kernel.org/all/20260917195436.1102981-1-markchucarroll@fastmail.com/\n\nChanges in v3:\n- Correct cover letter and commit message issues\n\n- Link to v2: https://lore.kernel.org/all/20260910-modernize-t4001-v2-0-ac53e9f5d717@fastmail.com/\n\nChanges in v2:\n- Merged setups into main test bodies.\n- Removed unnecessary echos.\n- Cleaned up here-docs.\n- Updated names to modern style.\n\n- Link to v1: https://patch.msgid.link/20260908-modernize-t4001-v1-0-cab3933a173f@fastmail.com\n\n\nMark C. Chu-Carroll (3):\n  t4001: modernize\n  t4009: modernize\n  t4010: modernize\n\n t/t4001-diff-rename.sh   |  89 +++++++++++-------------\n t/t4009-diff-rename-4.sh | 142 +++++++++++++++++++--------------------\n t/t4010-diff-pathspec.sh | 122 ++++++++++++++++-----------------\n 3 files changed, 167 insertions(+), 186 deletions(-)\n\n-- \n2.53.0\n\n"},{"id":"553014","messageId":"20260922202152.842793-3-markchucarroll@fastmail.com","threadId":"66372","inReplyTo":"20260922202152.842793-1-markchucarroll@fastmail.com","subject":"[PATCH v6 2/3] t4009: modernize","fromName":"Mark C. Chu-Carroll","fromEmail":"markchucarroll@fastmail.com","sentAt":"2026-09-22T20:21:51Z","receivedAt":"2026-09-22T20:22:02Z","isPatch":true,"body":"Old tests were written in a different style than modern\nones; for better readability and test error messages,\nupdate t4009 to the modern style.\n\n* run everything inside of a test_expect_success block.\n* write title line on the same line as test_expect_success,\n  end that line with a single quote that opens the body of the test,\n  and end the test with a single quote that closes the body.\n* write expected output of a test to a file named \"expect\",\n  and actual output to a file named \"actual\".\n* write here-docs using \"<<-\" syntax, so that they're indented\n  uniformly with the rest of the test.\n* make test names more clearly reflect the functionality that\n  they test.\n\nSigned-off-by: Mark C. Chu-Carroll <markchucarroll@fastmail.com>\n---\n t/t4009-diff-rename-4.sh | 142 +++++++++++++++++++--------------------\n 1 file changed, 68 insertions(+), 74 deletions(-)\n\ndiff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh\nindex 59e71e3acd..e42891ee5a 100755\n--- a/t/t4009-diff-rename-4.sh\n+++ b/t/t4009-diff-rename-4.sh\n@@ -10,68 +10,64 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n-test_expect_success \\\n-    'prepare reference tree' \\\n-    'COPYING_test_data >COPYING &&\n-     echo frotz >rezrov &&\n-    git update-index --add COPYING rezrov &&\n-    orig=$(git hash-object COPYING) &&\n-    tree=$(git write-tree) &&\n-    echo $tree'\n-\n-test_expect_success \\\n-    'prepare work tree' \\\n-    'sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&\n-    sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&\n-    rm -f COPYING &&\n-    c1=$(git hash-object COPYING.1) &&\n-    c2=$(git hash-object COPYING.2) &&\n-    git update-index --add --remove COPYING COPYING.?'\n-\n-# tree has COPYING and rezrov.  work tree has COPYING.1 and COPYING.2,\n-# both are slightly edited, and unchanged rezrov.  We say COPYING.1\n-# and COPYING.2 are based on COPYING, and do not say anything about\n-# rezrov.\n-\n-git diff-index -z -C $tree >current\n-\n-cat >expected <<EOF\n-:100644 100644 $orig $c1 C1234\n-COPYING\n-COPYING.1\n-:100644 100644 $orig $c2 R1234\n-COPYING\n-COPYING.2\n-EOF\n-\n-test_expect_success \\\n-    'validate output from rename/copy detection (#1)' \\\n-    'compare_diff_raw_z current expected'\n+test_expect_success 'setup' '\n+\t# prepare reference tree\n+\tCOPYING_test_data >COPYING &&\n+\techo frotz >rezrov &&\n+\tgit update-index --add COPYING rezrov &&\n+\torig=$(git hash-object COPYING) &&\n+\ttree=$(git write-tree) &&\n+\techo $tree &&\n+\t# prepare work tree\n+\tsed -e \"s/HOWEVER/However/\" <COPYING >COPYING.1 &&\n+\tsed -e \"s/GPL/G.P.L/g\" <COPYING >COPYING.2 &&\n+\trm -f COPYING &&\n+\tc1=$(git hash-object COPYING.1) &&\n+\tc2=$(git hash-object COPYING.2) &&\n+\tgit update-index --add --remove COPYING COPYING.?\n+'\n+\n+test_expect_success 'validate output from rename/copy detection (#1)' '\n+\t# tree has COPYING and rezrov.  work tree has COPYING.1 and COPYING.2,\n+\t# both are slightly edited, and unchanged rezrov.  We say COPYING.1\n+\t# and COPYING.2 are based on COPYING, and do not say anything about\n+\t# rezrov.\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $orig $c1 C1234\n+\tCOPYING\n+\tCOPYING.1\n+\t:100644 100644 $orig $c2 R1234\n+\tCOPYING\n+\tCOPYING.2\n+\tEOF\n+\n+\tgit diff-index -z -C $tree >actual &&\n+\tcompare_diff_raw_z actual expect\n+'\n \n ################################################################\n \n-test_expect_success \\\n-    'prepare work tree again' \\\n-    'mv COPYING.2 COPYING &&\n-     git update-index --add --remove COPYING COPYING.1 COPYING.2'\n-\n-# tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\n-# both are slightly edited, and unchanged rezrov.  We say COPYING.1\n-# is based on COPYING and COPYING is still there, and do not say anything\n-# about rezrov.\n-\n-git diff-index -z -C $tree >current\n-cat >expected <<EOF\n-:100644 100644 $orig $c2 M\n-COPYING\n-:100644 100644 $orig $c1 C1234\n-COPYING\n-COPYING.1\n-EOF\n-\n-test_expect_success \\\n-    'validate output from rename/copy detection (#2)' \\\n-    'compare_diff_raw_z current expected'\n+test_expect_success 'validate output from rename/copy detection (#2)' '\n+\t# prepare work tree again\n+\tmv COPYING.2 COPYING &&\n+\tgit update-index --add --remove COPYING COPYING.1 COPYING.2 &&\n+\n+\t# tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\n+\t# both are slightly edited, and unchanged rezrov.  We say COPYING.1\n+\t# is based on COPYING and COPYING is still there, and do not say anything\n+\t# about rezrov.\n+\n+\tgit diff-index -z -C $tree >actual &&\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $orig $c2 M\n+\tCOPYING\n+\t:100644 100644 $orig $c1 C1234\n+\tCOPYING\n+\tCOPYING.1\n+\tEOF\n+\n+\tcompare_diff_raw_z actual expect\n+'\n \n ################################################################\n \n@@ -80,20 +76,18 @@ test_expect_success \\\n # anything about rezrov or COPYING, since the revised again diff-raw\n # nows how to say Copy.\n \n-test_expect_success \\\n-    'prepare work tree once again' \\\n-    'COPYING_test_data >COPYING &&\n-     git update-index --add --remove COPYING COPYING.1'\n-\n-git diff-index -z -C --find-copies-harder $tree >current\n-cat >expected <<EOF\n-:100644 100644 $orig $c1 C1234\n-COPYING\n-COPYING.1\n-EOF\n-\n-test_expect_success \\\n-    'validate output from rename/copy detection (#3)' \\\n-    'compare_diff_raw_z current expected'\n+test_expect_success 'validate output from rename/copy detection (#3)' '\n+\t# prepare work tree once again\n+\tCOPYING_test_data >COPYING &&\n+\tgit update-index --add --remove COPYING COPYING.1 &&\n+\tgit diff-index -z -C --find-copies-harder $tree >actual &&\n+\tcat >expect <<-EOF &&\n+\t:100644 100644 $orig $c1 C1234\n+\tCOPYING\n+\tCOPYING.1\n+\tEOF\n+\n+\tcompare_diff_raw_z actual expect\n+'\n \n test_done\n-- \n2.53.0\n\n"},{"id":"553016","messageId":"20260922202152.842793-4-markchucarroll@fastmail.com","threadId":"66372","inReplyTo":"20260922202152.842793-1-markchucarroll@fastmail.com","subject":"[PATCH v6 3/3] t4010: modernize","fromName":"Mark C. Chu-Carroll","fromEmail":"markchucarroll@fastmail.com","sentAt":"2026-09-22T20:21:52Z","receivedAt":"2026-09-22T20:22:04Z","isPatch":true,"body":"Old tests were written in a different style than modern\nones; for better readability and test error messages,\nupdate t4010 to the modern style.\n\n* run everything inside of a test_expect_success block.\n* write title line on the same line as test_expect_success,\n  end that line with a single quote that opens the body of the test,\n  and end the test with a single quote that closes the body.\n* write expected output of a test to a file named \"expect\",\n  and actual output to a file named \"actual\".\n* write here-docs using \"<<-\" syntax, so that they're indented\n  uniformly with the rest of the test.\n* make test names more clearly reflect the functionality that\n  they test.\n\nSigned-off-by: Mark C. Chu-Carroll <markchucarroll@fastmail.com>\n---\n t/t4010-diff-pathspec.sh | 122 +++++++++++++++++++--------------------\n 1 file changed, 61 insertions(+), 61 deletions(-)\n\ndiff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\nindex c84c3fa05b..03b3023bee 100755\n--- a/t/t4010-diff-pathspec.sh\n+++ b/t/t4010-diff-pathspec.sh\n@@ -13,67 +13,67 @@ Prepare:\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-diff.sh ;# test-lib chdir's into trash\n \n-test_expect_success \\\n-    setup \\\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-EOF\n-test_expect_success \\\n-    'limit to path should show nothing' \\\n-    'git diff-index --cached $tree -- path >current &&\n-     compare_diff_raw current expected'\n-\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 $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 $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 $before0 $after0 M\tfile0\n-EOF\n-test_expect_success \\\n-    'limit to file0 should show file0' \\\n-    'git diff-index --cached $tree -- file0 >current &&\n-     compare_diff_raw current expected'\n-\n-cat >expected <<\\EOF\n-EOF\n-test_expect_success \\\n-    'limit to file0/ should emit nothing.' \\\n-    'git diff-index --cached $tree -- file0/ >current &&\n-     compare_diff_raw current expected'\n+test_expect_success 'setup' '\n+\techo frotz >file0 &&\n+\tmkdir path1 &&\n+\techo rezrov >path1/file1 &&\n+\tbefore0=$(git hash-object file0) &&\n+\tbefore1=$(git hash-object path1/file1) &&\n+\tgit update-index --add file0 path1/file1 &&\n+\ttree=$(git write-tree) &&\n+\techo nitfol >file0 &&\n+\techo yomin >path1/file1 &&\n+\tafter0=$(git hash-object file0) &&\n+\tafter1=$(git hash-object path1/file1) &&\n+\tgit update-index file0 path1/file1 &&\n+\t: >expected\n+'\n+\n+test_expect_success 'limit to path should show nothing' '\n+\tgit diff-index --cached $tree -- path >current &&\n+\tcompare_diff_raw current expected\n+'\n+\n+test_expect_success 'limit to path1 should show path1/file1' '\n+\tcat >expected <<-EOF &&\n+\t:100644 100644 $before1 $after1 M\tpath1/file1\n+\tEOF\n+\n+\tgit diff-index --cached $tree -- path1 >current &&\n+\tcompare_diff_raw current expected\n+'\n+\n+test_expect_success 'limit to path1/ should show path1/file1' '\n+\tcat >expected <<-EOF &&\n+\t:100644 100644 $before1 $after1 M\tpath1/file1\n+\tEOF\n+\n+\tgit diff-index --cached $tree -- path1/ >current &&\n+\tcompare_diff_raw current expected\n+'\n+test_expect_success '\"*file1\" should show path1/file1' '\n+\tcat >expected <<-EOF &&\n+\t:100644 100644 $before1 $after1 M\tpath1/file1\n+\tEOF\n+\n+\tgit diff-index --cached $tree -- \"*file1\" >current &&\n+\tcompare_diff_raw current expected\n+'\n+\n+test_expect_success 'limit to file0 should show file0' '\n+\tcat >expected <<-EOF &&\n+\t:100644 100644 $before0 $after0 M\tfile0\n+\tEOF\n+\n+\tgit diff-index --cached $tree -- file0 >current &&\n+\tcompare_diff_raw current expected\n+'\n+\n+test_expect_success 'limit to file0/ should emit nothing.' '\n+\t: >expected &&\n+\tgit diff-index --cached $tree -- file0/ >current &&\n+\tcompare_diff_raw current expected\n+'\n \n test_expect_success 'diff-tree pathspec' '\n \ttree2=$(git write-tree) &&\n-- \n2.53.0\n\n"},{"id":"553200","messageId":"067c83e4-7ff9-4e2f-9ca9-2592288bcc93@gmail.com","threadId":"66372","inReplyTo":"20260922202152.842793-1-markchucarroll@fastmail.com","subject":"Re: [PATCH v6 0/3] t40*: modernize","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-24T14:58:05Z","receivedAt":"2026-09-24T14:58:11Z","isPatch":true,"body":"On 9/23/26 01:51, Mark C. Chu-Carroll wrote:\n> Changes in v6:\n> - Fix rebase error to separate commits correctly.\n> \n> - Link to v5: https://lore.kernel.org/git/20260922143119.3313620-1-markchucarroll@fastmail.com/T/#t\n>\n\nJust a tip, you might want to use the --in-reply-to to mention the \nmessage ID of your previous iteration's cover letter. This ensures your \niterations end up in the same thread. With this, you do not need to \nmanually include links to the previous iteration.\n\nExample of such a thread: \nhttps://lore.kernel.org/git/xmqqecfez7ie.fsf@gitster.g/T/#t\n\nSee also, \"Sending v2\" section of MyFirstContribution\n\nhttps://git-scm.com/docs/MyFirstContribution#v2-git-send-email\n\n-- \nSivaraam\n\n"},{"id":"553203","messageId":"xmqqld8q4ogs.fsf@gitster.g","threadId":"66372","inReplyTo":"067c83e4-7ff9-4e2f-9ca9-2592288bcc93@gmail.com","subject":"Re: [PATCH v6 0/3] t40*: modernize","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-24T16:13:23Z","receivedAt":"2026-09-24T16:13:27Z","isPatch":true,"body":"Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:\n\n> See also, \"Sending v2\" section of MyFirstContribution\n>\n> https://git-scm.com/docs/MyFirstContribution#v2-git-send-email\n\nThanks.  It also worth noting that the section referred to from the\nbeginning of \"Sending v2\" section is also valuable.\n\nhttps://git-scm.com/docs/MyFirstContribution#reviewing\n\n"},{"id":"553213","messageId":"DLNPWO76XNMJ.45P0NL3HVZ3H@fastmail.com","threadId":"66372","inReplyTo":"067c83e4-7ff9-4e2f-9ca9-2592288bcc93@gmail.com","subject":"Re: [PATCH v6 0/3] t40*: modernize","fromName":"Mark C. Chu-Carroll","fromEmail":"markchucarroll@fastmail.com","sentAt":"2026-09-24T17:20:44Z","receivedAt":"2026-09-24T17:20:46Z","isPatch":true,"body":"On Thu Sep 24, 2026 at 10:58 AM EDT, Kaartic Sivaraam wrote:\n> On 9/23/26 01:51, Mark C. Chu-Carroll wrote:\n>> Changes in v6:\n>> - Fix rebase error to separate commits correctly.\n>> \n>> - Link to v5: https://lore.kernel.org/git/20260922143119.3313620-1-markchucarroll@fastmail.com/T/#t\n>>\n>\n> Just a tip, you might want to use the --in-reply-to to mention the \n> message ID of your previous iteration's cover letter. This ensures your \n> iterations end up in the same thread. With this, you do not need to \n> manually include links to the previous iteration.\n\nShould I resend this with the in-reply-to to attach it to the thread, or\njust leave it this time?\n\n    -Mark\n\n-- \nMark Craig Chu-Carroll (@MarkChuCarroll at gitlab)\n*** Software Tools/Math Geek - Software Engineer at Gitlab\n*** Work Email: mcarroll@gitlab.com / markchucarroll@fastmail.com\n*** Personal Blog: http://goodmath.org/blog / Personal email: markcc@gmail.com\n\n"},{"id":"553281","messageId":"efec0b1a-2b02-42d3-acd9-74155925c749@gmail.com","threadId":"66372","inReplyTo":"DLNPWO76XNMJ.45P0NL3HVZ3H@fastmail.com","subject":"Re: [PATCH v6 0/3] t40*: modernize","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-25T13:40:59Z","receivedAt":"2026-09-25T13:41:07Z","isPatch":true,"body":"On 9/24/26 22:50, Mark C. Chu-Carroll wrote:\n> On Thu Sep 24, 2026 at 10:58 AM EDT, Kaartic Sivaraam wrote:\n>>\n>> Just a tip, you might want to use the --in-reply-to to mention the\n>> message ID of your previous iteration's cover letter. This ensures your\n>> iterations end up in the same thread. With this, you do not need to\n>> manually include links to the previous iteration.\n> \n> Should I resend this with the in-reply-to to attach it to the thread, or\n> just leave it this time?\n>\n\nI may not be the best to comment. Yet, I believe it should be fine to \nstart doing that from the next version.\n\n-- \nSivaraam\n\n"}]}