* [PATCH] t0081: modernize the code testing whether a file exists
@ 2026-10-14 7:26 Shashank S via GitGitGadget
2026-10-14 9:49 ` Usman Akinyemi
2026-10-15 10:47 ` [PATCH v2] [Outreachy] " Shashank S via GitGitGadget
0 siblings, 2 replies; 8+ messages in thread
From: Shashank S via GitGitGadget @ 2026-10-14 7:26 UTC (permalink / raw)
To: git
Cc: Kaartic Sivaraam, Christian Couder, Siddharth Asthana,
Usman Akinyemi, Shashank S, Shashank
From: Shashank <shashu8660@gmail.com>
Replace the old-style shell `test -f` command with Git's modern
`test_path_is_file`.
This instance was found using:
`git grep "test -[efd]" t/'
Signed-off-by: Shashank <shashu8660@gmail.com>
---
[outreachy] t0081: Replace the old style 'test -f' to new
'test_path_is_file'
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2254
t/t0081-find-pack.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh
index ff9d56fbf1..7d5082c487 100755
--- a/t/t0081-find-pack.sh
+++ b/t/t0081-find-pack.sh
@@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '
".git/objects/pack/pack-"*".pack") true ;;
*) false ;;
esac &&
- test -f "$head_commit_pack" &&
+ test_path_is_file "$head_commit_pack" &&
# Everything is in the same pack
test "$head_commit_pack" = "$head_tree_pack" &&
base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
--
gitgitgadget
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] t0081: modernize the code testing whether a file exists
2026-10-14 7:26 [PATCH] t0081: modernize the code testing whether a file exists Shashank S via GitGitGadget
@ 2026-10-14 9:49 ` Usman Akinyemi
2026-10-14 21:47 ` Junio C Hamano
2026-10-15 6:51 ` Shashank S
2026-10-15 10:47 ` [PATCH v2] [Outreachy] " Shashank S via GitGitGadget
1 sibling, 2 replies; 8+ messages in thread
From: Usman Akinyemi @ 2026-10-14 9:49 UTC (permalink / raw)
To: Shashank S via GitGitGadget
Cc: git, Kaartic Sivaraam, Christian Couder, Siddharth Asthana,
Shashank S
> From: Shashank <shashu8660@gmail.com>
>
> Replace the old-style shell `test -f` command with Git's modern
> `test_path_is_file`.
>
> This instance was found using:
> `git grep "test -[efd]" t/'
This is not necessary, remove it.
>
> Signed-off-by: Shashank <shashu8660@gmail.com>
> ---
> [outreachy] t0081: Replace the old style 'test -f' to new
> 'test_path_is_file'
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/2254
>
> t/t0081-find-pack.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh
> index ff9d56fbf1..7d5082c487 100755
> --- a/t/t0081-find-pack.sh
> +++ b/t/t0081-find-pack.sh
> @@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '
> ".git/objects/pack/pack-"*".pack") true ;;
> *) false ;;
> esac &&
> - test -f "$head_commit_pack" &&
> + test_path_is_file "$head_commit_pack" &&
looks good to me.
>
> # Everything is in the same pack
> test "$head_commit_pack" = "$head_tree_pack" &&
>
> base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
> --
> gitgitgadget
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t0081: modernize the code testing whether a file exists
2026-10-14 9:49 ` Usman Akinyemi
@ 2026-10-14 21:47 ` Junio C Hamano
2026-10-15 7:02 ` Shashank S
2026-10-15 11:43 ` Kaartic Sivaraam
2026-10-15 6:51 ` Shashank S
1 sibling, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2026-10-14 21:47 UTC (permalink / raw)
To: Usman Akinyemi
Cc: Shashank S via GitGitGadget, git, Kaartic Sivaraam,
Christian Couder, Siddharth Asthana, Shashank S
Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
>> From: Shashank <shashu8660@gmail.com>
>>
>> Replace the old-style shell `test -f` command with Git's modern
>> `test_path_is_file`.
>>
>> This instance was found using:
>> `git grep "test -[efd]" t/'
> This is not necessary, remove it.
Since many candidates are working on similar microprojects (which is
fine) and making the same mistakes (which is expected), perhaps mentors
should tell them to read the review exchanges on other candidates'
patches and learn from them, instead of or in addition to giving the
same advice repeatedly.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t0081: modernize the code testing whether a file exists
2026-10-14 21:47 ` Junio C Hamano
@ 2026-10-15 7:02 ` Shashank S
2026-10-15 11:43 ` Kaartic Sivaraam
1 sibling, 0 replies; 8+ messages in thread
From: Shashank S @ 2026-10-15 7:02 UTC (permalink / raw)
To: Junio C Hamano
Cc: Usman Akinyemi, Shashank S via GitGitGadget, git,
Kaartic Sivaraam, Christian Couder, Siddharth Asthana
On Thu, 15 Oct 2026 at 03:17, Junio C Hamano <gitster@pobox.com> wrote:
>
> Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
>
> >> From: Shashank <shashu8660@gmail.com>
> Since many candidates are working on similar microprojects (which is
> fine) and making the same mistakes (which is expected), perhaps mentors
> should tell them to read the review exchanges on other candidates'
> patches and learn from them, instead of or in addition to giving the
> same advice repeatedly.
thank you for the explanation and the review , from now on i will go
through the other candidates patches and look in to them and mentor
reviews in them and learn from that
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t0081: modernize the code testing whether a file exists
2026-10-14 21:47 ` Junio C Hamano
2026-10-15 7:02 ` Shashank S
@ 2026-10-15 11:43 ` Kaartic Sivaraam
2026-10-15 17:10 ` Junio C Hamano
1 sibling, 1 reply; 8+ messages in thread
From: Kaartic Sivaraam @ 2026-10-15 11:43 UTC (permalink / raw)
To: Junio C Hamano, Usman Akinyemi
Cc: Shashank S via GitGitGadget, git, Christian Couder,
Siddharth Asthana, Shashank S
On 10/15/26 03:17, Junio C Hamano wrote:
> Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
>
>>> From: Shashank <shashu8660@gmail.com>
>>>
>>> Replace the old-style shell `test -f` command with Git's modern
>>> `test_path_is_file`.
>>>
>>> This instance was found using:
>>> `git grep "test -[efd]" t/'
>> This is not necessary, remove it.
>
> Since many candidates are working on similar microprojects (which is
> fine) and making the same mistakes (which is expected), perhaps mentors
> should tell them to read the review exchanges on other candidates'
> patches and learn from them, instead of or in addition to giving the
> same advice repeatedly.
I 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:
https://git.github.io/General-Microproject-Information/#research-existing-related-work
That said, I just wanted to highlight one thing. In the Microproject
ideas page[1], we have the following for this specific idea:
Notes
- Start small: Pick a test file with just a few instances to convert
- Run the test suite after your changes to ensure nothing breaks
- Follow Git’s commit message style
- Include which command you used to find the instances in your commit
message
So, 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.
I raised a PR to fix that:
https://github.com/git/git.github.io/pull/875
[1]: https://git.github.io/SoC-2026-Microprojects/
--
Sivaraam
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] t0081: modernize the code testing whether a file exists
2026-10-15 11:43 ` Kaartic Sivaraam
@ 2026-10-15 17:10 ` Junio C Hamano
0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2026-10-15 17:10 UTC (permalink / raw)
To: Kaartic Sivaraam
Cc: Usman Akinyemi, Shashank S via GitGitGadget, git,
Christian Couder, Siddharth Asthana, Shashank S
Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes:
> That said, I just wanted to highlight one thing. In the Microproject
> ideas page[1], we have the following for this specific idea:
>
> Notes
>
> - Start small: Pick a test file with just a few instances to convert
> - Run the test suite after your changes to ensure nothing breaks
> - Follow Git’s commit message style
> - Include which command you used to find the instances in your commit
> message
>
> So, 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.
>
> I raised a PR to fix that:
>
> https://github.com/git/git.github.io/pull/875
I do not think your update is taking us in the right direction,
though. Recommend to have it under three-dash lines instead,
perhaps?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t0081: modernize the code testing whether a file exists
2026-10-14 9:49 ` Usman Akinyemi
2026-10-14 21:47 ` Junio C Hamano
@ 2026-10-15 6:51 ` Shashank S
1 sibling, 0 replies; 8+ messages in thread
From: Shashank S @ 2026-10-15 6:51 UTC (permalink / raw)
To: Usman Akinyemi, Junio C Hamano
Cc: Shashank S via GitGitGadget, git, Kaartic Sivaraam,
Christian Couder, Siddharth Asthana
On Wed, 14 Oct 2026 at 15:19, Usman Akinyemi <usmanakinyemi202@gmail.com> wrote:
>
> > From: Shashank <shashu8660@gmail.com>
> >
> > Replace the old-style shell `test -f` command with Git's modern
> > `test_path_is_file`.
> >
> > This instance was found using:
> > `git grep "test -[efd]" t/'
> This is not necessary, remove it.
thank you for the review , i will remove it and i will submit patch v2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] [Outreachy] t0081: modernize the code testing whether a file exists
2026-10-14 7:26 [PATCH] t0081: modernize the code testing whether a file exists Shashank S via GitGitGadget
2026-10-14 9:49 ` Usman Akinyemi
@ 2026-10-15 10:47 ` Shashank S via GitGitGadget
1 sibling, 0 replies; 8+ messages in thread
From: Shashank S via GitGitGadget @ 2026-10-15 10:47 UTC (permalink / raw)
To: git
Cc: Kaartic Sivaraam, Christian Couder, Siddharth Asthana,
Usman Akinyemi, Shashank S, Shashank
From: Shashank <shashu8660@gmail.com>
Replace the old-style shell `test -f` command with Git's modern
`test_path_is_file`.
Signed-off-by: Shashank <shashu8660@gmail.com>
---
[outreachy] t0081: Replace the old style 'test -f' to new
'test_path_is_file'
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2254
Range-diff vs v1:
1: 906c628765 ! 1: d4807f2751 t0081: modernize the code testing whether a file exists
@@ Metadata
Author: Shashank <shashu8660@gmail.com>
## Commit message ##
- t0081: modernize the code testing whether a file exists
+ [Outreachy] t0081: modernize the code testing whether a file exists
Replace the old-style shell `test -f` command with Git's modern
`test_path_is_file`.
- This instance was found using:
- `git grep "test -[efd]" t/'
-
Signed-off-by: Shashank <shashu8660@gmail.com>
## t/t0081-find-pack.sh ##
t/t0081-find-pack.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh
index ff9d56fbf1..7d5082c487 100755
--- a/t/t0081-find-pack.sh
+++ b/t/t0081-find-pack.sh
@@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '
".git/objects/pack/pack-"*".pack") true ;;
*) false ;;
esac &&
- test -f "$head_commit_pack" &&
+ test_path_is_file "$head_commit_pack" &&
# Everything is in the same pack
test "$head_commit_pack" = "$head_tree_pack" &&
base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
--
gitgitgadget
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-15 17:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 7:26 [PATCH] t0081: modernize the code testing whether a file exists Shashank S via GitGitGadget
2026-10-14 9:49 ` Usman Akinyemi
2026-10-14 21:47 ` Junio C Hamano
2026-10-15 7:02 ` Shashank S
2026-10-15 11:43 ` Kaartic Sivaraam
2026-10-15 17:10 ` Junio C Hamano
2026-10-15 6:51 ` Shashank S
2026-10-15 10:47 ` [PATCH v2] [Outreachy] " Shashank S via GitGitGadget
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.