public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ritesh Singh Jadoun <riteshjd75@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] t/pack-refs-tests: use test_path_is_missing
Date: Fri, 13 Mar 2026 22:00:34 -0700	[thread overview]
Message-ID: <xmqqfr63xax9.fsf@gitster.g> (raw)
In-Reply-To: <20260314034617.1261-1-riteshjd75@gmail.com> (Ritesh Singh Jadoun's message of "Sat, 14 Mar 2026 09:16:17 +0530")

Ritesh Singh Jadoun <riteshjd75@gmail.com> writes:

> The pack-refs tests currently use raw 'test -f' checks with negation.
> Update them to use Git's standard helper function test_path_is_missing
> for clearer failure reporting.
>
> Signed-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com>
> ---
>  t/pack-refs-tests.sh | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

> diff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh
> index dca0c77ca1..3cc4906f05 100644
> --- a/t/pack-refs-tests.sh
> +++ b/t/pack-refs-tests.sh
> @@ -61,7 +61,7 @@ test_expect_success 'see if a branch still exists after git ${pack_refs} --prune
>  test_expect_success 'see if git ${pack_refs} --prune remove ref files' '
>  	git branch f &&
>  	git ${pack_refs} --all --prune &&
> -	! test_path_is_file .git/refs/heads/f
> +	test_path_is_missing .git/refs/heads/f
>  '

This test in my tree looks like this:

        test_expect_success 'see if git ${pack_refs} --prune remove ref files' '
                git branch f &&
                git ${pack_refs} --all --prune &&
                ! test -f .git/refs/heads/f
        '

No patch that turns this instance of "! test -f" into an incorrect
use of test_path_is_file helper, i.e., "!  test_path_is_file", has
ever been accepted to my tree.  Which means that this [v2] will not
apply to my tree.

I suspect that you have two patches on top of my tree, one is a
botched attempt that turns "! test -f" into "!  test_path_is_file",
and the other one is an "oops, the previous one was a bad change, so
fix it on top with another commit" that further changes it to
"test_path_is_missing", and we are looking only at the latter patch.

We however do not work that way around here.  Until a patch is
accepted and merged to the 'next' branch, updates are expected to
come as wholesale replacements.  See Documentation/SubmittingPatches.

Even though no developer is perfect, when you are presenting your
updated work, armed with wisdom borrowed from your reviewers'
comments on your earlier attempts, you are expected to take the
opportunity to pretend to have written a series of patches that are
perfect logical progression towards the final shape of the code
without detours, change of plans, and fixing earlier mistakes made
in the series.

The final series accepted by the project will have to stay in our
history for later developers to see in "git log" output to learn
from, and a series being clean logical progression is a must for
that to happen.

In this case, if what you have is indeed a pair of patches "one went
into a wrong direction, the next corrects the course", then you
would want to squash them into a single patch that turns "! test -f
.git/refs/heads/f" that is in my tree into an improved form that is
"test_path_is_missing".  And send that as the second attempt (v2).

See also

    https://lore.kernel.org/git/xmqq34283b12.fsf@gitster.g/

Thanks.



  reply	other threads:[~2026-03-14  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-14  3:46 [PATCH v2] t/pack-refs-tests: use test_path_is_missing Ritesh Singh Jadoun
2026-03-14  5:00 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-03-14  6:05 Ritesh Singh Jadoun
2026-03-14 16:39 ` Junio C Hamano
2026-03-15  8:10 Ritesh Singh Jadoun
2026-03-16 15:25 ` Junio C Hamano

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=xmqqfr63xax9.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=riteshjd75@gmail.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