{"thread":{"id":"65303","subject":"[PATCH] t5315: use test_path_is_file for loose-object check","startedAt":"2026-03-19T16:03:44Z","lastAt":"2026-03-20T10:08:40Z","messageCount":7,"participants":["Bilal El Khatabi","Pablo","Junio C Hamano","BILAL EL KHATABI","Karthik Nayak"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"539394","messageId":"20260319160301.98039-1-elkhatabibilal@gmail.com","threadId":"65303","inReplyTo":null,"subject":"[PATCH] t5315: use test_path_is_file for loose-object check","fromName":"Bilal El Khatabi","fromEmail":"elkhatabibilal@gmail.com","sentAt":"2026-03-19T16:02:49Z","receivedAt":"2026-03-19T16:03:44Z","isPatch":true,"sender":{"key":"elkhatabibilal@gmail.com","avatar":"https://avatars.githubusercontent.com/u/51460731?v=4"},"body":"From: bilalobe <elkhatabibilal@gmail.com>\n\nReplace an assertion-style `test -f` check with `test_path_is_file`\nin `t/t5315-pack-objects-compression.sh`.\n\nThis aligns the test with the path-checking helpers used in Git's test\nsuite.\n\nFound with:\n  git grep \"test -[efd]\" t/\n\nSigned-off-by: bilalobe <elkhatabibilal@gmail.com>\n---\n t/t5315-pack-objects-compression.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh\nindex 8bacd96275..d0feab17b4 100755\n--- a/t/t5315-pack-objects-compression.sh\n+++ b/t/t5315-pack-objects-compression.sh\n@@ -10,7 +10,7 @@ test_expect_success setup '\n \t# make sure it resulted in a loose object\n \tob=$(sed -e \"s/\\(..\\).*/\\1/\" object-name) &&\n \tject=$(sed -e \"s/..\\(.*\\)/\\1/\" object-name) &&\n-\ttest -f .git/objects/$ob/$ject\n+\ttest_path_is_file .git/objects/$ob/$ject\n '\n \n while read expect config\n-- \n2.53.0\n\n"},{"id":"539400","messageId":"CAN5EUNR2mqpCMG0oPsDnzgZr-2yyL+S0A7p_MM62F7d4MjBuSA@mail.gmail.com","threadId":"65303","inReplyTo":"20260319160301.98039-1-elkhatabibilal@gmail.com","subject":"Re: [PATCH] t5315: use test_path_is_file for loose-object check","fromName":"Pablo","fromEmail":"pabloosabaterr@gmail.com","sentAt":"2026-03-19T16:26:31Z","receivedAt":"2026-03-19T16:26:44Z","isPatch":true,"sender":{"key":"pabloosabaterr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/63864637?v=4"},"body":"Bilal El Khatabi (<elkhatabibilal@gmail.com>) writes:\n>\n> From: bilalobe <elkhatabibilal@gmail.com>\n\nI see this is sent from Bilal El Khatabi and From has a different\nname, How do you want to be known in the community?\nPS: from Documentation/SubmittingPatches:\n\"It is common, but not required, to use some form of your real name.\nWe realize that some contributors are not comfortable doing so or\nprefer to contribute under a pseudonym or preferred name and we can\naccept your patch either way, as long as the name and email you use\nare distinctive, identifying, and not misleading.\"\n\n>\n> Replace an assertion-style `test -f` check with `test_path_is_file`\n> in `t/t5315-pack-objects-compression.sh`.\n\nTry explaining why is this change needed\n\n> This aligns the test with the path-checking helpers used in Git's test\n> suite.\n\nIt would help to explain why this is better than what was before, for\nexample that this helper reports loudly what expectation wasn't met,\ntherefore makes it easier to debug.\n\n> Found with:\n>   git grep \"test -[efd]\" t/\n\nMany are adding this prob because it is said on the microproject to\nadd the command you used to find the file, but because this is just\none instance, it's not very useful. It's better to drop it.\n\nSeeing that this is a microproject and the current date, if this is\nfor GSoC, add to the subject GSoC with PATCH \"[GSoC PATCH]\" for\nexample, and CC your possible co mentors.\n\n> Signed-off-by: bilalobe <elkhatabibilal@gmail.com>\n> ---\n>  t/t5315-pack-objects-compression.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh\n> index 8bacd96275..d0feab17b4 100755\n> --- a/t/t5315-pack-objects-compression.sh\n> +++ b/t/t5315-pack-objects-compression.sh\n> @@ -10,7 +10,7 @@ test_expect_success setup '\n>         # make sure it resulted in a loose object\n>         ob=$(sed -e \"s/\\(..\\).*/\\1/\" object-name) &&\n>         ject=$(sed -e \"s/..\\(.*\\)/\\1/\" object-name) &&\n> -       test -f .git/objects/$ob/$ject\n> +       test_path_is_file .git/objects/$ob/$ject\n>  '\n>\n\nCode seems fine\n\n>  while read expect config\n> --\n> 2.53.0\n>\n>\n"},{"id":"539414","messageId":"20260319180803.164335-1-elkhatabibilal@gmail.com","threadId":"65303","inReplyTo":"20260319160301.98039-1-elkhatabibilal@gmail.com","subject":"[GSOC PATCH v2] t5315: use test_path_is_file for loose-object check","fromName":"Bilal El Khatabi","fromEmail":"elkhatabibilal@gmail.com","sentAt":"2026-03-19T18:06:52Z","receivedAt":"2026-03-19T18:08:09Z","isPatch":true,"sender":{"key":"elkhatabibilal@gmail.com","avatar":"https://avatars.githubusercontent.com/u/51460731?v=4"},"body":"Use test_path_is_file instead of test -f when checking that the\nloose object was written to the expected path.\n\nThis uses Git's path-checking helper, which provides more specific\nfailure output than a raw test -f check.\n\nSigned-off-by: Bilal El Khatabi <elkhatabibilal@gmail.com>\n---\n t/t5315-pack-objects-compression.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh\nindex 8bacd96275..d0feab17b4 100755\n--- a/t/t5315-pack-objects-compression.sh\n+++ b/t/t5315-pack-objects-compression.sh\n@@ -10,7 +10,7 @@ test_expect_success setup '\n \t# make sure it resulted in a loose object\n \tob=$(sed -e \"s/\\(..\\).*/\\1/\" object-name) &&\n \tject=$(sed -e \"s/..\\(.*\\)/\\1/\" object-name) &&\n-\ttest -f .git/objects/$ob/$ject\n+\ttest_path_is_file .git/objects/$ob/$ject\n '\n \n while read expect config\n-- \n2.53.0\n\n"},{"id":"539415","messageId":"xmqqbjgjllb6.fsf@gitster.g","threadId":"65303","inReplyTo":"CAN5EUNR2mqpCMG0oPsDnzgZr-2yyL+S0A7p_MM62F7d4MjBuSA@mail.gmail.com","subject":"Re: [PATCH] t5315: use test_path_is_file for loose-object check","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-19T18:35:09Z","receivedAt":"2026-03-19T18:35:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pablo <pabloosabaterr@gmail.com> writes:\n\n> Seeing that this is a microproject and the current date, if this is\n> for GSoC, add to the subject GSoC with PATCH \"[GSoC PATCH]\" for\n> example, and CC your possible co mentors.\n\nThanks for noting these things for new folks.  Another thing to\nencourage is to read and be aware of what other new folks in the\ncommunity has done recently by reading\n\n    https://lore.kernel.org/git/\n\nand at least skim a handful of threads, and a few of them that are\ntitled similarly to what they are about to post in detail.\n\nThanks.\n\n"},{"id":"539417","messageId":"xmqqv7erk5oh.fsf@gitster.g","threadId":"65303","inReplyTo":"20260319180803.164335-1-elkhatabibilal@gmail.com","subject":"Re: [GSOC PATCH v2] t5315: use test_path_is_file for loose-object check","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-19T18:58:06Z","receivedAt":"2026-03-19T18:58:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bilal El Khatabi <elkhatabibilal@gmail.com> writes:\n\n> Use test_path_is_file instead of test -f when checking that the\n> loose object was written to the expected path.\n>\n> This uses Git's path-checking helper, which provides more specific\n> failure output than a raw test -f check.\n\nThese two sentences repeat almost the same thing in different\nphrasing, which starts to become a bit boring.\n\nThe gold standard way to write a proposed commit log message for\nthis project is to:\n\n - Give an observation on how the current system works in the\n   present tense (so no need to say \"Currently X is Y\", or\n   \"Previously X was Y\" to describe the state before your change;\n   just \"X is Y\" is enough), and discuss what you perceive as a\n   problem in it.\n\n - Propose a solution (optional---often, problem description\n   trivially leads to an obvious solution in reader's minds).\n\n - Give commands to somebody editing the codebase to \"make it so\",\n   instead of saying \"This commit does X\".\n\nin this order.  The above jumps directly to the execution, bypassing\nthe observation and solution.  Fully followed, it would become\nsomething like:\n\n    When a test in t5315 tries to see if a loose object file is\n    created at the expected path in the filesystem, \"test -f\" is\n    used.  If a developer breaks \"git\" in such a way that the file\n    is no longer created at this expected place, however, \"test -f\"\n    will silently fail and exits with non-zero, causing the test\n    fail, but it is not obvious which step in the &&- chained\n    commands failed.\n\n    Use test_path_is_file helper, which loudly reports the failure\n    when the expectation is not met.  When running the test with the\n    \"-v\" option, i.e., \"sh t5315-*.sh -v\", the failure would become\n    more prominent, helping the developer.\n\nWill queue.\n\n\n> Signed-off-by: Bilal El Khatabi <elkhatabibilal@gmail.com>\n> ---\n>  t/t5315-pack-objects-compression.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh\n> index 8bacd96275..d0feab17b4 100755\n> --- a/t/t5315-pack-objects-compression.sh\n> +++ b/t/t5315-pack-objects-compression.sh\n> @@ -10,7 +10,7 @@ test_expect_success setup '\n>  \t# make sure it resulted in a loose object\n>  \tob=$(sed -e \"s/\\(..\\).*/\\1/\" object-name) &&\n>  \tject=$(sed -e \"s/..\\(.*\\)/\\1/\" object-name) &&\n> -\ttest -f .git/objects/$ob/$ject\n> +\ttest_path_is_file .git/objects/$ob/$ject\n>  '\n>  \n>  while read expect config\n"},{"id":"539419","messageId":"8669d87c1b7f96dd0de37dabfb9011c8745a17c9.camel@gmail.com","threadId":"65303","inReplyTo":"xmqqv7erk5oh.fsf@gitster.g","subject":"Re: [GSOC PATCH v2] t5315: use test_path_is_file for loose-object check","fromName":"BILAL EL KHATABI","fromEmail":"elkhatabibilal@gmail.com","sentAt":"2026-03-19T19:29:17Z","receivedAt":"2026-03-19T19:29:21Z","isPatch":true,"sender":{"key":"elkhatabibilal@gmail.com","avatar":"https://avatars.githubusercontent.com/u/51460731?v=4"},"body":"Thanks, Junio and Pablo.\n\n  For the advice, will do.\n\n  I’ll also spend some time reading recent newcomer and GSoC-related\n  threads on lore before sending the next ones.\n\nBest,\nBilal\n"},{"id":"539505","messageId":"CAOLa=ZTMR67FuougYKrd-=5Ags_QPT8q6x7xjObQV_KSj2KysQ@mail.gmail.com","threadId":"65303","inReplyTo":"8669d87c1b7f96dd0de37dabfb9011c8745a17c9.camel@gmail.com","subject":"Re: [GSOC PATCH v2] t5315: use test_path_is_file for loose-object check","fromName":"Karthik Nayak","fromEmail":"karthik.188@gmail.com","sentAt":"2026-03-20T10:08:37Z","receivedAt":"2026-03-20T10:08:40Z","isPatch":true,"sender":{"key":"karthik.188@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1786334?v=4"},"body":"BILAL EL KHATABI <elkhatabibilal@gmail.com> writes:\n\n> Thanks, Junio and Pablo.\n>\n>   For the advice, will do.\n>\n>   I’ll also spend some time reading recent newcomer and GSoC-related\n>   threads on lore before sending the next ones.\n>\n> Best,\n> Bilal\n\nOne tip is to not top-post when replying :)\n\nFrom Documentation/MyFirstContribution.adoc, we have:\n\n  The Git list requires plain-text-only emails and prefers inline and\n  bottom-posting when replying to mail;\n\n- Karthik\n"}]}