From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Rodrigo Michelassi <rodmichelassi@gmail.com>,
git@vger.kernel.org, icaselli@usp.br
Subject: Re: [PATCH] replace 'test -[efd]' with 'test_path_is_[file,dir,executable]'
Date: Sun, 15 Jun 2025 21:15:19 -0700 [thread overview]
Message-ID: <xmqq1prk490o.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cT1VfY8QiUvrrV3-obTBP1439b6iwaebJtGwML5MScnQA@mail.gmail.com> (Eric Sunshine's message of "Sun, 15 Jun 2025 23:39:56 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
> Thanks for the patch. See below for some comments...
>
> On Sun, Jun 15, 2025 at 10:08 PM Rodrigo Michelassi
> <rodmichelassi@gmail.com> wrote:
>> From: rodrigocmichelassi <rodmichelassi@gmail.com>
>
> The From: header name/address should match your Signed-off-by:
> trailer, so you'll probably need to adjust your mailer settings.
This is an in-body header most likely added by git-send-email, so
the name string is what the commit object recorded as its author.
What needs to be adjusted is not the mailer settings, but user.name,
if that is indeed the case.
>> replace 'test -[efd]' with 'test_path_is_[file,dir,executable]'
>
> Let's prefix the subject with the area you're touching. In this case,
> the test number would be appropriate, so:
>
> t2400: replace 'test -[efd]' with test_path_* calls
Excellent.
>> 'test_path_is_file', 'test_path_is_dir' and 'test_file_is_executable' are modern path checking methods in Git's development. Replace the basic shell commands 'test -f', 'test -d' and 'test -e', respectively, with this approach
>
> A better way to convince reviewers that this is a good idea is to
> explain why these functions are superior. In this case, it's because
> they emit useful diagnostic information when they detect a failing
> condition, whereas `test` itself does not.
>
> Please wrap the commit message at about the 72-column mark.
Good.
>> Signed-off-by: Rodrigo Michelassi <rodmichelassi@gmail.com>
>>
>> Co-authored-by: Isabella Caselli <icaselli@usp.br>
>> Signed-off-by: Isabella Caselli <icaselli@usp.br>
>
> You'll probably want to order these trailers like this:
>
> Co-authored-by: Isabella Caselli <icaselli@usp.br>
> Signed-off-by: Isabella Caselli <icaselli@usp.br>
> Signed-off-by: Rodrigo Michelassi <rodmichelassi@gmail.com>
Very true. And without a blank line in between.
I too spotted the misuse of negation in the test script you spotted.
Thanks for explaining why they are bad and what should be used
instead.
next prev parent reply other threads:[~2025-06-16 4:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 2:08 [PATCH] replace 'test -[efd]' with 'test_path_is_[file,dir,executable]' Rodrigo Michelassi
2025-06-16 3:39 ` Eric Sunshine
2025-06-16 4:15 ` Junio C Hamano [this message]
2025-06-16 4:17 ` Eric Sunshine
2025-06-16 3:53 ` Carlo Marcelo Arenas Belón
2025-06-16 4:16 ` 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=xmqq1prk490o.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=icaselli@usp.br \
--cc=rodmichelassi@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