Thread View: linux.kernel.git
11 messages
11 total messages
Started by "Shashank S via GitGitGadget"
Wed, 14 Oct 2026 07:26
[PATCH] t0081: modernize the code testing whether a file exists
Author: "Shashank S via GitGitGadget"
Date: Wed, 14 Oct 2026 07:26
Date: Wed, 14 Oct 2026 07:26
38 lines
9049 bytes
9049 bytes
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
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Usman Akinyemi
Date: Wed, 14 Oct 2026 09:49
Date: Wed, 14 Oct 2026 09:49
41 lines
10283 bytes
10283 bytes
> 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.
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Junio C Hamano
Date: Wed, 14 Oct 2026 21:47
Date: Wed, 14 Oct 2026 21:47
17 lines
10380 bytes
10380 bytes
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.
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Shashank S
Date: Thu, 15 Oct 2026 06:51
Date: Thu, 15 Oct 2026 06:51
13 lines
9461 bytes
9461 bytes
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
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Shashank S
Date: Thu, 15 Oct 2026 07:02
Date: Thu, 15 Oct 2026 07:02
16 lines
9760 bytes
9760 bytes
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
[PATCH v2] [Outreachy] t0081: modernize the code testing whether a file exists
Author: "Shashank S via GitGitGadget"
Date: Thu, 15 Oct 2026 10:47
Date: Thu, 15 Oct 2026 10:47
56 lines
9914 bytes
9914 bytes
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
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Kaartic Sivaraam
Date: Thu, 15 Oct 2026 11:43
Date: Thu, 15 Oct 2026 11:43
51 lines
9970 bytes
9970 bytes
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
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Junio C Hamano
Date: Thu, 15 Oct 2026 17:10
Date: Thu, 15 Oct 2026 17:10
25 lines
10871 bytes
10871 bytes
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?
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Kaartic Sivaraam
Date: Fri, 23 Oct 2026 06:56
Date: Fri, 23 Oct 2026 06:56
37 lines
12694 bytes
12694 bytes
On 10/15/26 22:40, Junio C Hamano wrote: > Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes: > >> 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? Got it. Does the following change read better? diff --git a/links/mentoring/soc/SoC-2026-Microprojects.md b/links/mentoring/soc/SoC-2026-Microprojects.md index 41354b50..17519e2d 100644 --- a/links/mentoring/soc/SoC-2026-Microprojects.md +++ b/links/mentoring/soc/SoC-2026-Microprojects.md @@ -49,8 +49,9 @@ with Git's dedicated test helpers like `test_path_is_file`. - 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 -- You _do not need to_ include the command you used to find the instances - in your commit message +- You can include the command you used to find the instances in your + cover letter or between the three-dash line and the diffstat, whichever + is appropriate. Do not mention it in your commit message #### Need Help? - Reference [this discussion](https://public-inbox.org/git/CAPig+cRfO8t1tdCL6MB4b9XopF3HkZ==hU83AFZ38b-2zsXDjQ@mail.gmail.com/) -- Sivaraam
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Junio C Hamano
Date: Thu, 05 Nov 2026 21:28
Date: Thu, 05 Nov 2026 21:28
24 lines
14044 bytes
14044 bytes
Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes: > Got it. Does the following change read better? > > diff --git a/links/mentoring/soc/SoC-2026-Microprojects.md > b/links/mentoring/soc/SoC-2026-Microprojects.md > index 41354b50..17519e2d 100644 > --- a/links/mentoring/soc/SoC-2026-Microprojects.md > +++ b/links/mentoring/soc/SoC-2026-Microprojects.md > @@ -49,8 +49,9 @@ with Git's dedicated test helpers like > `test_path_is_file`. > - 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 > -- You _do not need to_ include the command you used to find the instances > - in your commit message > +- You can include the command you used to find the instances in your > + cover letter or between the three-dash line and the diffstat, whichever > + is appropriate. Do not mention it in your commit message Yes, this reads much better. It clearly guides contributors to put the command below the three-dash line or in the cover letter without cluttering the commit message.
Re: [PATCH] t0081: modernize the code testing whether a file exists
Author: Kaartic Sivaraam
Date: Fri, 06 Nov 2026 07:36
Date: Fri, 06 Nov 2026 07:36
31 lines
12776 bytes
12776 bytes
On 11/6/26 02:58, Junio C Hamano wrote: > Kaartic Sivaraam <kaartic.sivaraam@gmail.com> writes: > >> Got it. Does the following change read better? >> >> diff --git a/links/mentoring/soc/SoC-2026-Microprojects.md >> b/links/mentoring/soc/SoC-2026-Microprojects.md >> index 41354b50..17519e2d 100644 >> --- a/links/mentoring/soc/SoC-2026-Microprojects.md >> +++ b/links/mentoring/soc/SoC-2026-Microprojects.md >> @@ -49,8 +49,9 @@ with Git's dedicated test helpers like >> `test_path_is_file`. >> - 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 >> -- You _do not need to_ include the command you used to find the instances >> - in your commit message >> +- You can include the command you used to find the instances in your >> + cover letter or between the three-dash line and the diffstat, whichever >> + is appropriate. Do not mention it in your commit message > > Yes, this reads much better. It clearly guides contributors to put > the command below the three-dash line or in the cover letter without > cluttering the commit message. Thank you! I've updated the description of the microproject. It should be live at https://git.github.io/SoC-2026-Microprojects/ -- Sivaraam
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads