public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Francesco Paparatto <francescopaparatto@gmail.com>
Cc: git@vger.kernel.org,  christian.couder@gmail.com,
	karthik.188@gmail.com,  jltobler@gmail.com,
	 ayu.chandekar@gmail.com, siddharthasthana31@gmail.com
Subject: Re: [GSoC PATCH] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir
Date: Fri, 27 Feb 2026 11:31:35 -0800	[thread overview]
Message-ID: <xmqqv7fioueg.fsf@gitster.g> (raw)
In-Reply-To: <20260227184538.4718-1-francescopaparatto@gmail.com> (Francesco Paparatto's message of "Fri, 27 Feb 2026 19:45:38 +0100")

Francesco Paparatto <francescopaparatto@gmail.com> writes:

> Replace old-style path assertions with modern helpers that provide
> clearer diagnostic messages on failure. That's because when test -f fails, the
> output gives no indication of what went wrong.
>
> These instances were found using: git grep "test -[efd]" t/ as suggested in the microproject ideas.

An overly long line.  Keep the display columns for a line in a patch
e-mail below ~70 columns, so that after getting quoted "> " for a
few times, the result will still fit in 80-column terminals.

>  test_expect_success 'cannot do merge w/conflicts when previous merge is unfinished' '
> -	test -d .git/NOTES_MERGE_WORKTREE &&
> +	test_path_is_dir .git/NOTES_MERGE_WORKTREE &&

OK.

> @@ -320,7 +320,7 @@ w notes on 1st commit
>  EOF
>  
>  test_expect_success 'can do merge without conflicts even if previous merge is unfinished (x => w)' '
> -	test -d .git/NOTES_MERGE_WORKTREE &&
> +	test_path_is_dir .git/NOTES_MERGE_WORKTREE &&

OK.

> @@ -564,10 +564,10 @@ EOF
>  	# NOTES_MERGE_* refs and .git/NOTES_MERGE_* state files must remain
>  	git rev-parse --verify NOTES_MERGE_PARTIAL &&
>  	git rev-parse --verify NOTES_MERGE_REF &&
> -	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&
> -	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&
> -	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
> -	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&
> +	test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&
> +	test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&
> +	test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
> +	test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&

OK.

>  	# Refs are unchanged
>  	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
>  	test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&

Here is a pair of opportunities for others that want more
microproject exercises to make sure we do not ignore failing "git"
invocations.

You do not want to address them, of course.  You've had your share
already ;-)

Thanks.



  reply	other threads:[~2026-02-27 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27 18:45 [GSoC PATCH] t3310: replace test -f/-d with test_path_is_file/test_path_is_dir Francesco Paparatto
2026-02-27 19:31 ` Junio C Hamano [this message]
2026-02-28  0:52   ` Francesco Paparatto
2026-02-28  0:59   ` [GSoC PATCH v2] " Francesco Paparatto

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=xmqqv7fioueg.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ayu.chandekar@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=francescopaparatto@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@gmail.com \
    --cc=siddharthasthana31@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