From: Dirk Gouders <dirk@gouders.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Eric Sunshine <ericsunshine@charter.net>,
git@vger.kernel.org, Aryan Gupta <garyan447@gmail.com>
Subject: Re: [PATCH] test-lib-functions: simplify `test_file_not_empty` failure message
Date: Sat, 02 Mar 2024 08:07:42 +0100 [thread overview]
Message-ID: <ghr0gtglhd.fsf@gouders.net> (raw)
In-Reply-To: <CAPig+cSt4Q0e+DioFiy7yjBgn5+gWNqQOYc0eCAgdYrZUp8VBQ@mail.gmail.com> (Eric Sunshine's message of "Fri, 1 Mar 2024 17:59:42 -0500")
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Fri, Mar 1, 2024 at 5:11 PM Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Sunshine <ericsunshine@charter.net> writes:
>> > A more accurate message might be "'foo' is empty but
>> > should not be (or doesn't exist)", but that's unnecessarily long-winded
>> > and adds little information that the test author couldn't discover by
>> > noticing the file's absence.
>>
>> The "adds little information" version may be
>>
>> echo "'$1' is either missing or empty, but should not be"
>>
>> And avoiding "X is Y, but should be ~Y" construct, perhaps
>>
>> echo "'$1' should be a file with non-empty contents"
>>
>> would work better? I dunno.
>
> I find "'$1' is either missing or empty, but should not be" suggestion
> clear and easily understood. I'll reroll with that.
This is a view from a position with more distance:
I find that not so easily understood -- the "but should not
be" part is rather unexpected and I feel, it doesn't provide necessary
information, e.g.:
test_path_is_executable () {
...
echo "$1 is not executable"
...
also doesn't state what is wanted and I doubt that message doesn't
clearly describe the problem.
While I looked at it: there is another `test -s` in test_grep () that
perhaps could be fixed the same way:
if test -s "$last_arg"
then
cat >&4 "$last_arg"
else
echo >&4 "<File '$last_arg' is empty>"
fi
Dirk
next prev parent reply other threads:[~2024-03-02 7:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 20:49 [PATCH] test-lib-functions: simplify `test_file_not_empty` failure message Eric Sunshine
2024-03-01 22:11 ` Junio C Hamano
2024-03-01 22:59 ` Eric Sunshine
2024-03-02 7:07 ` Dirk Gouders [this message]
2024-03-02 17:44 ` Junio C Hamano
2024-03-03 6:42 ` Dirk Gouders
2024-03-02 16:38 ` Rubén Justo
2024-03-02 18:08 ` 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=ghr0gtglhd.fsf@gouders.net \
--to=dirk@gouders.net \
--cc=ericsunshine@charter.net \
--cc=garyan447@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 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.