All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Yuvraj Singh Chauhan <ysinghcin@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 2/2] t7412: modernize path checks to use test helper functions
Date: Wed, 4 Mar 2026 06:16:25 +0100	[thread overview]
Message-ID: <aafAKc41y4CdZmUt@pks.im> (raw)
In-Reply-To: <20260303175750.361563-2-ysinghcin@gmail.com>

On Tue, Mar 03, 2026 at 11:27:50PM +0530, Yuvraj Singh Chauhan wrote:
> Replace 11 raw 'test -f', 'test -d', and '! test -e' calls with the

This explicit number of course made me verify that you didn't miscount,
and you indeed didn't :)

> corresponding test library helpers:
> 
>   - 'test -f' -> 'test_path_is_file'
>   - 'test -d' -> 'test_path_is_dir'
>   - '! test -e' -> 'test_path_is_missing'
> 
> These helpers emit a descriptive message on failure, 
> making failing tests easier to diagnose than the silent 
> pass/fail of the raw shell primitives.

Yup, the reasoning is sound.

By the way, you have trailing whitespace in the commit message. I guess
it'll get stripped when Junio applies the patch anyway, but maybe
something to watch out for in the future.

> diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
> index 41ee035e3c..cdc7f59e12 100755
> --- a/t/t7412-submodule-absorbgitdirs.sh
> +++ b/t/t7412-submodule-absorbgitdirs.sh

The changes all look obviously correct to me. Thanks!

Patrick

  reply	other threads:[~2026-03-04  5:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 17:57 [PATCH 1/2] t7412: fix typo 'submodue' in test_description Yuvraj Singh Chauhan
2026-03-03 17:57 ` [PATCH 2/2] t7412: modernize path checks to use test helper functions Yuvraj Singh Chauhan
2026-03-04  5:16   ` Patrick Steinhardt [this message]
2026-03-04  5:16 ` [PATCH 1/2] t7412: fix typo 'submodue' in test_description Patrick Steinhardt

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=aafAKc41y4CdZmUt@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ysinghcin@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.