From: Junio C Hamano <gitster@pobox.com>
To: Marcel Telka <marcel@telka.sk>
Cc: git@vger.kernel.org
Subject: Re: Three t4150 tests does not work as expected
Date: Fri, 17 May 2024 10:55:33 -0700 [thread overview]
Message-ID: <xmqqcypkiaqy.fsf@gitster.g> (raw)
In-Reply-To: <ZkeJx97qdLoaC2H-@telcontar> (Marcel Telka's message of "Fri, 17 May 2024 18:45:59 +0200")
Marcel Telka <marcel@telka.sk> writes:
> All of them does something like:
>
> git show HEAD --format="%B" >actual
> grep -f actual expected
Wow, these commands look nonsensical in as many counts as there are
lines in there X-< [*].
It seems that they came from two patches, namely
7c096b8d (am: support --empty=<option> to handle empty patches, 2021-12-09)
9e7e41bf (am: support --allow-empty to record specific empty patches, 2021-12-09)
Most likely the author of these lines were confused and meant to use
test_cmp (which by the way should always compare actual against
expect, i.e. "test_cmp expect actual", because when the actual
output differs, that is the order of the diff we want to see in the
output to diagnose the breakage). I especially suspect that the
author did not mean "read patterns from this file", but was confused
to think that 'f' implies "match literally" somehow (the correct
spelling of that fixed-strings option is -F but still it does the
wrong thing reading from the file---it does not even ensure that
all patterns listed in the file matches).
I am not saying (as I did not check) that doing just "grep -f A B"
-> "test_cmp B A" woudl make things work. I do not think I trust
that these tests added by the same patch have a sane expectations
X-<. The outcome these tests try to verify may also need to be
corrected.
[Footnote]
* To start with, any dashed option like --format=%B should come
before a revision argument HEAD. There are many other
antipatterns in this test script, which should be cleaned up.
prev parent reply other threads:[~2024-05-17 17:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 16:45 Three t4150 tests does not work as expected Marcel Telka
2024-05-17 17:55 ` Junio C Hamano [this message]
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=xmqqcypkiaqy.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=marcel@telka.sk \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).