{"thread":{"id":"66528","subject":"[PATCH] t0081: modernize the code testing whether a file exists","startedAt":"2026-10-14T07:26:46Z","lastAt":"2026-10-23T06:56:51Z","messageCount":9,"participants":["Shashank S via GitGitGadget","Usman Akinyemi","Junio C Hamano","Shashank S","Kaartic Sivaraam"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"554962","messageId":"pull.2254.git.1791962806807.gitgitgadget@gmail.com","threadId":"66528","inReplyTo":null,"subject":"[PATCH] t0081: modernize the code testing whether a file exists","fromName":"Shashank S via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-14T07:26:46Z","receivedAt":"2026-10-14T07:26:46Z","isPatch":true,"sender":{"key":"shashu8660@gmail.com","avatar":null},"body":"From: Shashank <shashu8660@gmail.com>\n\nReplace the old-style shell `test -f` command with Git's modern\n`test_path_is_file`.\n\nThis instance was found using:\n`git grep \"test -[efd]\" t/'\n\nSigned-off-by: Shashank <shashu8660@gmail.com>\n---\n    [outreachy] t0081: Replace the old style 'test -f' to new\n    'test_path_is_file'\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2254\n\n t/t0081-find-pack.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh\nindex ff9d56fbf1..7d5082c487 100755\n--- a/t/t0081-find-pack.sh\n+++ b/t/t0081-find-pack.sh\n@@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '\n \t\t\".git/objects/pack/pack-\"*\".pack\") true ;;\n \t\t*) false ;;\n \tesac &&\n-\ttest -f \"$head_commit_pack\" &&\n+\ttest_path_is_file \"$head_commit_pack\" &&\n \n \t# Everything is in the same pack\n \ttest \"$head_commit_pack\" = \"$head_tree_pack\" &&\n\nbase-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n-- \ngitgitgadget\n\n"},{"id":"554989","messageId":"CAPSxiM9-F-1XKvWeEnBk=_FyKyev5pfnid4fiN-OjLYLnCTWVw@mail.gmail.com","threadId":"66528","inReplyTo":"pull.2254.git.1791962806807.gitgitgadget@gmail.com","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2026-10-14T09:49:19Z","receivedAt":"2026-10-14T09:49:19Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"> From: Shashank <shashu8660@gmail.com>\n>\n> Replace the old-style shell `test -f` command with Git's modern\n> `test_path_is_file`.\n>\n> This instance was found using:\n> `git grep \"test -[efd]\" t/'\nThis is not necessary, remove it.\n>\n> Signed-off-by: Shashank <shashu8660@gmail.com>\n> ---\n>     [outreachy] t0081: Replace the old style 'test -f' to new\n>     'test_path_is_file'\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/2254\n>\n>  t/t0081-find-pack.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh\n> index ff9d56fbf1..7d5082c487 100755\n> --- a/t/t0081-find-pack.sh\n> +++ b/t/t0081-find-pack.sh\n> @@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '\n>                 \".git/objects/pack/pack-\"*\".pack\") true ;;\n>                 *) false ;;\n>         esac &&\n> -       test -f \"$head_commit_pack\" &&\n> +       test_path_is_file \"$head_commit_pack\" &&\nlooks good to me.\n>\n>         # Everything is in the same pack\n>         test \"$head_commit_pack\" = \"$head_tree_pack\" &&\n>\n> base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n> --\n> gitgitgadget\nThanks.\n\n"},{"id":"555080","messageId":"xmqqzewgosyw.fsf@gitster.g","threadId":"66528","inReplyTo":"CAPSxiM9-F-1XKvWeEnBk=_FyKyev5pfnid4fiN-OjLYLnCTWVw@mail.gmail.com","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-14T21:47:03Z","receivedAt":"2026-10-14T21:47:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n\n>> From: Shashank <shashu8660@gmail.com>\n>>\n>> Replace the old-style shell `test -f` command with Git's modern\n>> `test_path_is_file`.\n>>\n>> This instance was found using:\n>> `git grep \"test -[efd]\" t/'\n> This is not necessary, remove it.\n\nSince many candidates are working on similar microprojects (which is\nfine) and making the same mistakes (which is expected), perhaps mentors\nshould tell them to read the review exchanges on other candidates'\npatches and learn from them, instead of or in addition to giving the\nsame advice repeatedly.\n\n"},{"id":"555100","messageId":"CANHmUQQcn8fX70NFMicOZUHTr1sYU44Avc8KER32TX1aK+rrfg@mail.gmail.com","threadId":"66528","inReplyTo":"CAPSxiM9-F-1XKvWeEnBk=_FyKyev5pfnid4fiN-OjLYLnCTWVw@mail.gmail.com","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Shashank S","fromEmail":"shashu8660@gmail.com","sentAt":"2026-10-15T06:51:02Z","receivedAt":"2026-10-15T06:51:02Z","isPatch":true,"sender":{"key":"shashu8660@gmail.com","avatar":null},"body":"On Wed, 14 Oct 2026 at 15:19, Usman Akinyemi <usmanakinyemi202@gmail.com> wrote:\n>\n> > From: Shashank <shashu8660@gmail.com>\n> >\n> > Replace the old-style shell `test -f` command with Git's modern\n> > `test_path_is_file`.\n> >\n> > This instance was found using:\n> > `git grep \"test -[efd]\" t/'\n> This is not necessary, remove it.\n\nthank you for the review , i will remove it and i will submit patch v2\n\n"},{"id":"555115","messageId":"CANHmUQR7TJ7VQJVnxMpJ3KNL5DLoMcJFR_jcg_64Vn31EVgJLQ@mail.gmail.com","threadId":"66528","inReplyTo":"xmqqzewgosyw.fsf@gitster.g","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Shashank S","fromEmail":"shashu8660@gmail.com","sentAt":"2026-10-15T07:02:37Z","receivedAt":"2026-10-15T07:02:37Z","isPatch":true,"sender":{"key":"shashu8660@gmail.com","avatar":null},"body":"On Thu, 15 Oct 2026 at 03:17, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n>\n> >> From: Shashank <shashu8660@gmail.com>\n\n> Since many candidates are working on similar microprojects (which is\n> fine) and making the same mistakes (which is expected), perhaps mentors\n> should tell them to read the review exchanges on other candidates'\n> patches and learn from them, instead of or in addition to giving the\n> same advice repeatedly.\n\nthank you for the explanation and the review , from now on i will go\nthrough the other candidates patches and look in to them and  mentor\nreviews in them and learn from that\n\n"},{"id":"555132","messageId":"pull.2254.v2.git.1792061236183.gitgitgadget@gmail.com","threadId":"66528","inReplyTo":"pull.2254.git.1791962806807.gitgitgadget@gmail.com","subject":"[PATCH v2] [Outreachy] t0081: modernize the code testing whether a file exists","fromName":"Shashank S via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-15T10:47:16Z","receivedAt":"2026-10-15T10:47:16Z","isPatch":true,"sender":{"key":"shashu8660@gmail.com","avatar":null},"body":"From: Shashank <shashu8660@gmail.com>\n\nReplace the old-style shell `test -f` command with Git's modern\n`test_path_is_file`.\n\nSigned-off-by: Shashank <shashu8660@gmail.com>\n---\n    [outreachy] t0081: Replace the old style 'test -f' to new\n    'test_path_is_file'\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2254\n\nRange-diff vs v1:\n\n 1:  906c628765 ! 1:  d4807f2751 t0081: modernize the code testing whether a file exists\n     @@ Metadata\n      Author: Shashank <shashu8660@gmail.com>\n      \n       ## Commit message ##\n     -    t0081: modernize the code testing whether a file exists\n     +    [Outreachy] t0081: modernize the code testing whether a file exists\n      \n          Replace the old-style shell `test -f` command with Git's modern\n          `test_path_is_file`.\n      \n     -    This instance was found using:\n     -    `git grep \"test -[efd]\" t/'\n     -\n          Signed-off-by: Shashank <shashu8660@gmail.com>\n      \n       ## t/t0081-find-pack.sh ##\n\n\n t/t0081-find-pack.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh\nindex ff9d56fbf1..7d5082c487 100755\n--- a/t/t0081-find-pack.sh\n+++ b/t/t0081-find-pack.sh\n@@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '\n \t\t\".git/objects/pack/pack-\"*\".pack\") true ;;\n \t\t*) false ;;\n \tesac &&\n-\ttest -f \"$head_commit_pack\" &&\n+\ttest_path_is_file \"$head_commit_pack\" &&\n \n \t# Everything is in the same pack\n \ttest \"$head_commit_pack\" = \"$head_tree_pack\" &&\n\nbase-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n-- \ngitgitgadget\n\n"},{"id":"555137","messageId":"9c905a79-22a2-4db2-b434-00ad8a287300@gmail.com","threadId":"66528","inReplyTo":"xmqqzewgosyw.fsf@gitster.g","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-10-15T11:43:33Z","receivedAt":"2026-10-15T11:43:33Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\n\nOn 10/15/26 03:17, Junio C Hamano wrote:\n> Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n> >>> From: Shashank <shashu8660@gmail.com>\n>>>\n>>> Replace the old-style shell `test -f` command with Git's modern\n>>> `test_path_is_file`.\n>>>\n>>> This instance was found using:\n>>> `git grep \"test -[efd]\" t/'\n>> This is not necessary, remove it.\n> > Since many candidates are working on similar microprojects (which is\n> fine) and making the same mistakes (which is expected), perhaps mentors\n> should tell them to read the review exchanges on other candidates'\n> patches and learn from them, instead of or in addition to giving the\n> same advice repeatedly.\n\nI agree that it is a good advice to ask candidate to read other candidates' patches. We do recommend this in our guide related to working on Microprojects:\n\n https://git.github.io/General-Microproject-Information/#research-existing-related-work\n\nThat said, I just wanted to highlight one thing. In the Microproject ideas page[1], we have the following for this specific idea:\n\n  Notes\n\n  - Start small: Pick a test file with just a few instances to convert\n  - Run the test suite after your changes to ensure nothing breaks\n  - Follow Git’s commit message style\n  - Include which command you used to find the instances in your commit\n    message\n\nSo, we can't really blame the candidates for including the command in the commit message. It is our mistake asking them to include it in the first place when we don't prefer it to be present there.\n\nI raised a PR to fix that:\n\n  https://github.com/git/git.github.io/pull/875\n\n[1]: https://git.github.io/SoC-2026-Microprojects/\n\n-- \nSivaraam\n\n\n"},{"id":"555170","messageId":"xmqqzeweopov.fsf@gitster.g","threadId":"66528","inReplyTo":"9c905a79-22a2-4db2-b434-00ad8a287300@gmail.com","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-15T17:10:08Z","receivedAt":"2026-10-15T17:10:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:\n\n> That said, I just wanted to highlight one thing. In the Microproject \n> ideas page[1], we have the following for this specific idea:\n>\n>    Notes\n>\n>    - Start small: Pick a test file with just a few instances to convert\n>    - Run the test suite after your changes to ensure nothing breaks\n>    - Follow Git’s commit message style\n>    - Include which command you used to find the instances in your commit\n>      message\n>\n> So, we can't really blame the candidates for including the command in \n> the commit message. It is our mistake asking them to include it in the \n> first place when we don't prefer it to be present there.\n>\n> I raised a PR to fix that:\n>\n>    https://github.com/git/git.github.io/pull/875\n\nI do not think your update is taking us in the right direction,\nthough.  Recommend to have it under three-dash lines instead,\nperhaps?\n\n"},{"id":"555955","messageId":"2a050885-a1c2-48d6-b561-3c2ea0a05dbf@gmail.com","threadId":"66528","inReplyTo":"xmqqzeweopov.fsf@gitster.g","subject":"Re: [PATCH] t0081: modernize the code testing whether a file exists","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-10-23T06:56:51Z","receivedAt":"2026-10-23T06:56:51Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\n\nOn 10/15/26 22:40, Junio C Hamano wrote:\n> Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:\n> >> I raised a PR to fix that:\n>>\n>>     https://github.com/git/git.github.io/pull/875\n> > I do not think your update is taking us in the right direction,\n> though.  Recommend to have it under three-dash lines instead,\n> perhaps?\n\nGot it. Does the following change read better?\n\ndiff --git a/links/mentoring/soc/SoC-2026-Microprojects.md b/links/mentoring/soc/SoC-2026-Microprojects.md\nindex 41354b50..17519e2d 100644\n--- a/links/mentoring/soc/SoC-2026-Microprojects.md\n+++ b/links/mentoring/soc/SoC-2026-Microprojects.md\n@@ -49,8 +49,9 @@ with Git's dedicated test helpers like `test_path_is_file`.\n - Start small: Pick a test file with just a few instances to convert\n - Run the test suite after your changes to ensure nothing breaks\n - Follow Git's commit message style\n-- You _do not need to_ include the command you used to find the instances\n-  in your commit message\n+- You can include the command you used to find the instances in your\n+  cover letter or between the three-dash line and the diffstat, whichever\n+  is appropriate. Do not mention it in your commit message\n\n #### Need Help?\n - Reference [this discussion](https://public-inbox.org/git/CAPig+cRfO8t1tdCL6MB4b9XopF3HkZ==hU83AFZ38b-2zsXDjQ@mail.gmail.com/)\n-- \nSivaraam\n\n\n"}]}