{"thread":{"id":"65090","subject":"[GSoC PATCH] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir","startedAt":"2026-02-27T18:45:44Z","lastAt":"2026-02-28T00:59:47Z","messageCount":4,"participants":["Francesco Paparatto","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"537317","messageId":"20260227184538.4718-1-francescopaparatto@gmail.com","threadId":"65090","inReplyTo":null,"subject":"[GSoC PATCH] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir","fromName":"Francesco Paparatto","fromEmail":"francescopaparatto@gmail.com","sentAt":"2026-02-27T18:45:38Z","receivedAt":"2026-02-27T18:45:44Z","isPatch":true,"sender":{"key":"francescopaparatto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/133123206?v=4"},"body":"Replace old-style path assertions with modern helpers that provide\nclearer diagnostic messages on failure. That's because when test -f fails, the\noutput gives no indication of what went wrong.\n\nThese instances were found using: git grep \"test -[efd]\" t/ as suggested in the microproject ideas.\n\nSigned-off-by: Francesco Paparatto <francescopaparatto@gmail.com>\n---\n t/t3310-notes-merge-manual-resolve.sh | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh\nindex 597df5ebc0..f0054b0a39 100755\n--- a/t/t3310-notes-merge-manual-resolve.sh\n+++ b/t/t3310-notes-merge-manual-resolve.sh\n@@ -260,7 +260,7 @@ test_expect_success 'change notes in z' '\n '\n \n test_expect_success 'cannot do merge w/conflicts when previous merge is unfinished' '\n-\ttest -d .git/NOTES_MERGE_WORKTREE &&\n+\ttest_path_is_dir .git/NOTES_MERGE_WORKTREE &&\n \ttest_must_fail git notes merge z >output 2>&1 &&\n \t# Output should indicate what is wrong\n \ttest_grep -q \"\\\\.git/NOTES_MERGE_\\\\* exists\" output\n@@ -320,7 +320,7 @@ w notes on 1st commit\n EOF\n \n test_expect_success 'can do merge without conflicts even if previous merge is unfinished (x => w)' '\n-\ttest -d .git/NOTES_MERGE_WORKTREE &&\n+\ttest_path_is_dir .git/NOTES_MERGE_WORKTREE &&\n \tgit notes merge x &&\n \tverify_notes w &&\n \t# Verify that other notes refs has not changed (x and y)\n@@ -564,10 +564,10 @@ EOF\n \t# NOTES_MERGE_* refs and .git/NOTES_MERGE_* state files must remain\n \tgit rev-parse --verify NOTES_MERGE_PARTIAL &&\n \tgit rev-parse --verify NOTES_MERGE_REF &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&\n \t# Refs are unchanged\n \ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/w)\" &&\n \ttest \"$(git rev-parse refs/notes/y)\" = \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" &&\n-- \n2.52.0\n\n"},{"id":"537335","messageId":"xmqqv7fioueg.fsf@gitster.g","threadId":"65090","inReplyTo":"20260227184538.4718-1-francescopaparatto@gmail.com","subject":"Re: [GSoC PATCH] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-27T19:31:35Z","receivedAt":"2026-02-27T19:31:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Francesco Paparatto <francescopaparatto@gmail.com> writes:\n\n> Replace old-style path assertions with modern helpers that provide\n> clearer diagnostic messages on failure. That's because when test -f fails, the\n> output gives no indication of what went wrong.\n>\n> These instances were found using: git grep \"test -[efd]\" t/ as suggested in the microproject ideas.\n\nAn overly long line.  Keep the display columns for a line in a patch\ne-mail below ~70 columns, so that after getting quoted \"> \" for a\nfew times, the result will still fit in 80-column terminals.\n\n>  test_expect_success 'cannot do merge w/conflicts when previous merge is unfinished' '\n> -\ttest -d .git/NOTES_MERGE_WORKTREE &&\n> +\ttest_path_is_dir .git/NOTES_MERGE_WORKTREE &&\n\nOK.\n\n> @@ -320,7 +320,7 @@ w notes on 1st commit\n>  EOF\n>  \n>  test_expect_success 'can do merge without conflicts even if previous merge is unfinished (x => w)' '\n> -\ttest -d .git/NOTES_MERGE_WORKTREE &&\n> +\ttest_path_is_dir .git/NOTES_MERGE_WORKTREE &&\n\nOK.\n\n> @@ -564,10 +564,10 @@ EOF\n>  \t# NOTES_MERGE_* refs and .git/NOTES_MERGE_* state files must remain\n>  \tgit rev-parse --verify NOTES_MERGE_PARTIAL &&\n>  \tgit rev-parse --verify NOTES_MERGE_REF &&\n> -\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&\n> -\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&\n> -\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&\n> -\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&\n> +\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&\n> +\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&\n> +\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&\n> +\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&\n\nOK.\n\n>  \t# Refs are unchanged\n>  \ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/w)\" &&\n>  \ttest \"$(git rev-parse refs/notes/y)\" = \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" &&\n\nHere is a pair of opportunities for others that want more\nmicroproject exercises to make sure we do not ignore failing \"git\"\ninvocations.\n\nYou do not want to address them, of course.  You've had your share\nalready ;-)\n\nThanks.\n\n\n"},{"id":"537368","messageId":"CAEaT9_-Uc11uW=-APEhqLUWeD0-cXoyi95wYrdazdnL1CKVt4g@mail.gmail.com","threadId":"65090","inReplyTo":"xmqqv7fioueg.fsf@gitster.g","subject":"Re: [GSoC PATCH] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir","fromName":"Francesco Paparatto","fromEmail":"francescopaparatto@gmail.com","sentAt":"2026-02-28T00:52:12Z","receivedAt":"2026-02-28T00:52:24Z","isPatch":true,"sender":{"key":"francescopaparatto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/133123206?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> An overly long line.  Keep the display columns for a line in a patch\n> e-mail below ~70 columns, so that after getting quoted \"> \" for a\n> few times, the result will still fit in 80-column terminals.\n\nThanks for the review. I'll resend with the commit message\nline wrapped.\n\nFrancesco\n"},{"id":"537369","messageId":"20260228005939.9012-1-francescopaparatto@gmail.com","threadId":"65090","inReplyTo":"xmqqv7fioueg.fsf@gitster.g","subject":"[GSoC PATCH v2] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir","fromName":"Francesco Paparatto","fromEmail":"francescopaparatto@gmail.com","sentAt":"2026-02-28T00:59:39Z","receivedAt":"2026-02-28T00:59:47Z","isPatch":true,"sender":{"key":"francescopaparatto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/133123206?v=4"},"body":"Replace old-style path assertions with modern helpers that\nprovide clearer diagnostic messages on failure. When test -f\nfails, the output gives no indication of what went wrong.\n\nThese instances were found using:\n\n  git grep \"test -[efd]\" t/\n\nas suggested in the microproject ideas.\n\nSigned-off-by: Francesco Paparatto <francescopaparatto@gmail.com>\n---\n t/t3310-notes-merge-manual-resolve.sh | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh\nindex 597df5ebc0..f0054b0a39 100755\n--- a/t/t3310-notes-merge-manual-resolve.sh\n+++ b/t/t3310-notes-merge-manual-resolve.sh\n@@ -260,7 +260,7 @@ test_expect_success 'change notes in z' '\n '\n \n test_expect_success 'cannot do merge w/conflicts when previous merge is unfinished' '\n-\ttest -d .git/NOTES_MERGE_WORKTREE &&\n+\ttest_path_is_dir .git/NOTES_MERGE_WORKTREE &&\n \ttest_must_fail git notes merge z >output 2>&1 &&\n \t# Output should indicate what is wrong\n \ttest_grep -q \"\\\\.git/NOTES_MERGE_\\\\* exists\" output\n@@ -320,7 +320,7 @@ w notes on 1st commit\n EOF\n \n test_expect_success 'can do merge without conflicts even if previous merge is unfinished (x => w)' '\n-\ttest -d .git/NOTES_MERGE_WORKTREE &&\n+\ttest_path_is_dir .git/NOTES_MERGE_WORKTREE &&\n \tgit notes merge x &&\n \tverify_notes w &&\n \t# Verify that other notes refs has not changed (x and y)\n@@ -564,10 +564,10 @@ EOF\n \t# NOTES_MERGE_* refs and .git/NOTES_MERGE_* state files must remain\n \tgit rev-parse --verify NOTES_MERGE_PARTIAL &&\n \tgit rev-parse --verify NOTES_MERGE_REF &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&\n-\ttest -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&\n+\ttest_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&\n \t# Refs are unchanged\n \ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/w)\" &&\n \ttest \"$(git rev-parse refs/notes/y)\" = \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" &&\n-- \n2.52.0\n\n"}]}