public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Deveshi Dwivedi <deveshigurgaon@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] [GSoC] t5403: use test_path_is_file instead of test -f
Date: Thu, 01 Jan 2026 09:27:45 +0900	[thread overview]
Message-ID: <xmqqjyy2dvni.fsf@gitster.g> (raw)
In-Reply-To: <20251229185737.2328-1-deveshigurgaon@gmail.com> (Deveshi Dwivedi's message of "Mon, 29 Dec 2025 18:57:37 +0000")

Deveshi Dwivedi <deveshigurgaon@gmail•com> writes:

> Replace 'test -f' with the test_path_is_file in
> t5403-post-checkout-hook.sh. This helper provides better error
> messages when tests fail, making it easier to debug issues.

All true, so I'll queue the patch.  Thanks.

A #leftoverbit is to think about what this test checks, if it
makes sense, and if we can do better.  The expected outcome of this
clone is stable, so the input fed to the hook should also be stable.
With the same brain-cycle to write a test that checks the existence
of the output file (i.e., proving that the hook was run), we should
be able to concoct a test that validates the contents of the output.

> Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail•com>
> ---
>  t/t5403-post-checkout-hook.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
> index 978f240cda..1462e3365b 100755
> --- a/t/t5403-post-checkout-hook.sh
> +++ b/t/t5403-post-checkout-hook.sh
> @@ -109,7 +109,7 @@ test_expect_success 'post-checkout hook is triggered by clone' '
>  	echo "$@" >"$GIT_DIR/post-checkout.args"
>  	EOF
>  	git clone --template=templates . clone3 &&
> -	test -f clone3/.git/post-checkout.args
> +	test_path_is_file clone3/.git/post-checkout.args
>  '
>  
>  test_done

  reply	other threads:[~2026-01-01  0:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29 18:57 [PATCH] [GSoC] t5403: use test_path_is_file instead of test -f Deveshi Dwivedi
2026-01-01  0:27 ` Junio C Hamano [this message]
2026-01-05  5:58   ` Deveshi Dwivedi
2026-01-05 10:34     ` Junio C Hamano
2026-01-05 11:47       ` Deveshi Dwivedi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqjyy2dvni.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=deveshigurgaon@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox