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,  sunshine@sunshineco.com,
	pushkarkumarsingh1970@gmail.com
Subject: Re: [PATCH v2 1/2] t5403:introduce check_post_checkout helper function
Date: Mon, 12 Jan 2026 06:48:20 -0800	[thread overview]
Message-ID: <xmqq4ioqopjf.fsf@gitster.g> (raw)
In-Reply-To: <20260112065301.1290-2-deveshigurgaon@gmail.com> (Deveshi Dwivedi's message of "Mon, 12 Jan 2026 06:53:00 +0000")

Deveshi Dwivedi <deveshigurgaon@gmail.com> writes:

> The test file repeatedly uses the same four-line pattern to validate
> post-checkout hook arguments: read the args file, then test each of
> the three values individually.
>
> Introduce a check_post_checkout helper function that encapsulates this
> pattern. This patch does not change test behavior; it prepares the
> code for improvement in the next step.
>
> Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com>
> ---
>  t/t5403-post-checkout-hook.sh | 49 ++++++++++++++++++++---------------
>  1 file changed, 28 insertions(+), 21 deletions(-)

OK.

> diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
> index 1462e3365b..7bdea25107 100755
> --- a/t/t5403-post-checkout-hook.sh
> +++ b/t/t5403-post-checkout-hook.sh
> ...
> @@ -109,7 +115,8 @@ test_expect_success 'post-checkout hook is triggered by clone' '
>  	echo "$@" >"$GIT_DIR/post-checkout.args"
>  	EOF
>  	git clone --template=templates . clone3 &&
> -	test_path_is_file clone3/.git/post-checkout.args
> +	check_post_checkout clone3/.git/post-checkout.args \
> +		"$(test_oid zero)" "$(git -C clone3 rev-parse HEAD)" 1
>  '

All other hunks are as described but this one is slightly different,
which may want a mention in the proposed log message.  We used to
only care about the fact that post-checkout hook was executed, but
now we check that we invoke the hook with expected parameters.

Other than that, this looks good; so does the next step.

Thanks.

  reply	other threads:[~2026-01-12 14:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11  7:29 [PATCH 0/2] t5403: improve post-checkout hook testing Deveshi Dwivedi
2026-01-11  7:29 ` [PATCH 1/2] t5403:introduce check_post_checkout helper function Deveshi Dwivedi
2026-01-11  7:53   ` Eric Sunshine
2026-01-11 11:01     ` Pushkar Singh
2026-01-12  6:44     ` Deveshi Dwivedi
2026-01-11 12:10   ` [PATCH] t5403: document check_post_checkout helper Pushkar Singh
2026-01-11  7:29 ` [PATCH 2/2] t5403: use test_cmp for post-checkout argument checks Deveshi Dwivedi
2026-01-12  6:52 ` [PATCH v2 0/2] t5403: improve post-checkout hook testing Deveshi Dwivedi
2026-01-12  6:53   ` [PATCH v2 1/2] t5403:introduce check_post_checkout helper function Deveshi Dwivedi
2026-01-12 14:48     ` Junio C Hamano [this message]
2026-01-12  6:53   ` [PATCH v2 2/2] t5403: use test_cmp for post-checkout argument checks Deveshi Dwivedi
2026-01-12 16:36 ` [PATCH v3 0/2] t5403: improve post-checkout hook testing Deveshi Dwivedi
2026-01-12 16:36   ` [PATCH v3 1/2] t5403:introduce check_post_checkout helper function Deveshi Dwivedi
2026-01-12 16:36   ` [PATCH v3 2/2] t5403: use test_cmp for post-checkout argument checks 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=xmqq4ioqopjf.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=deveshigurgaon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pushkarkumarsingh1970@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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