{"thread":{"id":"65066","subject":"[PATCH] t7605: use test_path_is_file instead of test -f","startedAt":"2026-02-24T05:34:31Z","lastAt":"2026-02-26T00:58:01Z","messageCount":3,"participants":["Mansi Singh via GitGitGadget","Lucas Seiki Oshiro"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"536913","messageId":"pull.2050.git.1771911268805.gitgitgadget@gmail.com","threadId":"65066","inReplyTo":null,"subject":"[PATCH] t7605: use test_path_is_file instead of test -f","fromName":"Mansi Singh via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-02-24T05:34:28Z","receivedAt":"2026-02-24T05:34:31Z","isPatch":true,"sender":{"key":"mansimaanu8627@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40687671?v=4"},"body":"From: Mansi <mansimaanu8627@gmail.com>\n\nReplace old-style 'test -f' path checks with the modern\ntest_path_is_file helper in the merge_c1_to_c2_cmds block.\n\nThe helper provides clearer failure messages and is the\nestablished convention in Git's test suite.\n\nThese instances were found using:\n  grep -rn \"test -[efd]\" t/ --include=\"*.sh\"\n\nSigned-off-by: Mansi <mansimaanu8627@gmail.com>\n---\n    t7605: use test_path_is_file instead of test -f\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2050%2FMansiSingh17%2Fgsoc-t7605-test-path-helpers-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2050/MansiSingh17/gsoc-t7605-test-path-helpers-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2050\n\n t/t7605-merge-resolve.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7605-merge-resolve.sh b/t/t7605-merge-resolve.sh\nindex 5d56c38546..44de97a480 100755\n--- a/t/t7605-merge-resolve.sh\n+++ b/t/t7605-merge-resolve.sh\n@@ -34,9 +34,9 @@ merge_c1_to_c2_cmds='\n \ttest \"$(git rev-parse c1)\" = \"$(git rev-parse HEAD^1)\" &&\n \ttest \"$(git rev-parse c2)\" = \"$(git rev-parse HEAD^2)\" &&\n \tgit diff --exit-code &&\n-\ttest -f c0.c &&\n-\ttest -f c1.c &&\n-\ttest -f c2.c &&\n+\ttest_path_is_file c0.c &&\n+\ttest_path_is_file c1.c &&\n+\ttest_path_is_file c2.c &&\n \ttest 3 = $(git ls-tree -r HEAD | wc -l) &&\n \ttest 3 = $(git ls-files | wc -l)\n '\n\nbase-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4\n-- \ngitgitgadget\n"},{"id":"537127","messageId":"2C345ED6-BE80-4947-A1B9-4065CB54086C@gmail.com","threadId":"65066","inReplyTo":"pull.2050.git.1771911268805.gitgitgadget@gmail.com","subject":"Re: [PATCH] t7605: use test_path_is_file instead of test -f","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T19:04:59Z","receivedAt":"2026-02-25T19:05:14Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Hi, Mansi!\n\n> Replace old-style 'test -f' path checks with the modern\n> test_path_is_file helper in the merge_c1_to_c2_cmds block.\n> \n> The helper provides clearer failure messages and is the\n> established convention in Git's test suite.\n> \n> These instances were found using:\n>  grep -rn \"test -[efd]\" t/ --include=\"*.sh\"\n\nI don't think this information is relevant to be placed in\nthe commit description. Perhaps it would better placed after\nthe scissors mark (the --- after the message) which is sent\nto the mailing list but ignored in the final commit.\n\nBtw, since we're in Git we can use Git's special powers to\ndo that. This is equivalent to your command line:\n\n   $ git grep 'test -[efd]' -- 't/*.sh'\n\nAnd this may be more useful, separating the output per file\nand using pathspecs to filter the tests (files that begin with\n\"t\") from other helper scripts inside t/:\n\n   $ git grep --heading --break 'test -[efd]' -- 't/t*.sh'\n\nI wrote a blog post about git-grep and other tools [1] that\nmay be useful for you.\n\n> - test -f c0.c &&\n> - test -f c1.c &&\n> - test -f c2.c &&\n> + test_path_is_file c0.c &&\n> + test_path_is_file c1.c &&\n> + test_path_is_file c2.c &&\n\nThe code itself looks good to me!\n\n[1] https://lucasoshiro.github.io/posts-en/2023-02-13-git-debug/#git-grep\n"},{"id":"537172","messageId":"pull.2050.v2.git.1772067478775.gitgitgadget@gmail.com","threadId":"65066","inReplyTo":"pull.2050.git.1771911268805.gitgitgadget@gmail.com","subject":"[PATCH v2] t7605: use test_path_is_file instead of test -f","fromName":"Mansi Singh via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-02-26T00:57:58Z","receivedAt":"2026-02-26T00:58:01Z","isPatch":true,"sender":{"key":"mansimaanu8627@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40687671?v=4"},"body":"From: Mansi <mansimaanu8627@gmail.com>\n\nReplace old-style 'test -f' path checks with the modern\ntest_path_is_file helper in the merge_c1_to_c2_cmds block.\n\nThe helper provides clearer failure messages and is the\nestablished convention in Git's test suite.\n\nSigned-off-by: Mansi <mansimaanu8627@gmail.com>\n---\n    t7605: use test_path_is_file instead of test -f\n    \n    cc: Lucas Seiki Oshiro lucasseikioshiro@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2050%2FMansiSingh17%2Fgsoc-t7605-test-path-helpers-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2050/MansiSingh17/gsoc-t7605-test-path-helpers-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2050\n\nRange-diff vs v1:\n\n 1:  11724e9310 ! 1:  0a0c9de263 t7605: use test_path_is_file instead of test -f\n     @@ Commit message\n          The helper provides clearer failure messages and is the\n          established convention in Git's test suite.\n      \n     -    These instances were found using:\n     -      grep -rn \"test -[efd]\" t/ --include=\"*.sh\"\n     -\n          Signed-off-by: Mansi <mansimaanu8627@gmail.com>\n      \n       ## t/t7605-merge-resolve.sh ##\n\n\n t/t7605-merge-resolve.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7605-merge-resolve.sh b/t/t7605-merge-resolve.sh\nindex 5d56c38546..44de97a480 100755\n--- a/t/t7605-merge-resolve.sh\n+++ b/t/t7605-merge-resolve.sh\n@@ -34,9 +34,9 @@ merge_c1_to_c2_cmds='\n \ttest \"$(git rev-parse c1)\" = \"$(git rev-parse HEAD^1)\" &&\n \ttest \"$(git rev-parse c2)\" = \"$(git rev-parse HEAD^2)\" &&\n \tgit diff --exit-code &&\n-\ttest -f c0.c &&\n-\ttest -f c1.c &&\n-\ttest -f c2.c &&\n+\ttest_path_is_file c0.c &&\n+\ttest_path_is_file c1.c &&\n+\ttest_path_is_file c2.c &&\n \ttest 3 = $(git ls-tree -r HEAD | wc -l) &&\n \ttest 3 = $(git ls-files | wc -l)\n '\n\nbase-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4\n-- \ngitgitgadget\n"}]}