From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff King <peff@peff.net>
Cc: Michael J Gruber <git@grubix.eu>,
git@vger.kernel.org, Phillip Wood <phillip.wood123@gmail.com>,
Derrick Stolee <derrickstolee@github.com>
Subject: Re: [PATCH] t3070: make chain lint tester happy
Date: Sat, 25 Mar 2023 02:54:45 -0400 [thread overview]
Message-ID: <CAPig+cT9zjP++ECkTMjh33gzWyh_ho6n8_XYkXTHxnuGiDbnow@mail.gmail.com> (raw)
In-Reply-To: <20230325063731.GB562387@coredump.intra.peff.net>
On Sat, Mar 25, 2023 at 2:38 AM Jeff King <peff@peff.net> wrote:
> On Fri, Mar 24, 2023 at 11:17:11PM +0100, Michael J Gruber wrote:
> > 1f2e05f0b7 ("wildmatch: fix exponential behavior", 2023-03-20)
> > introduced a new test with a background process. Backgrounding
> > necessarily gives a result of 0, so that a seemingly broken && chain is
> > not really broken.
> >
> > Adjust t3070 slightly so that our chain list test recognizes the
s/list/lint/
> > construct for what it is and does not raise a false positive.
>
> Good catch. While I agree that there's no missed exit code here, I'd say
> that this is more than just a false positive. If there were any lines
> above the "&", like:
>
> foo &&
> bar &
> pid=$! &&
> ...etc...
>
> then we'd be losing the exit value of "foo". It's OK here because the
> backgrounded command is the first line of the test, but it definitely
> violates our guidelines.
This is one of a few cases chainlint recognizes specially by
suppressing the complaint about the broken &&-chain since "&" can
never fail. The fact that a broken &&-chain prior to the "&" would be
missed was considered a reasonable tradeoff rather than complaining
and asking the test author to jump through hoops just to pacify the
linter. So, there are a few known cases when a broken &&-chain is
allowed to slip through, and tightening linting to disallow those
cases would require too many churn-like changes with little or no
benefit.
> Which isn't to say that your patch needs to do anything differently. I
> just wondered if it meant we should be improving the chain linter, but I
> think it is doing the right thing to alert us here.
Now it gets confusing (for me, at least).
> > + {
> > + test-tool wildmatch wildmatch \
> > + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab \
> > + "*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a" &
> > + pid=$!
> > + } &&
>
> This looks like the right solution. I do wonder how Phillip managed to
> miss it, though, since the test script complains loudly.
I am unable to reproduce any linting errors when running this script
through chainlint, which is why I was more than a little confused by
this patch when I read it, and I was just about to ask for more
information, such as the actual error message.
next prev parent reply other threads:[~2023-03-25 6:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 16:09 [PATCH 0/3] wildmatch: fix exponential behavior Phillip Wood
2023-03-20 16:10 ` [PATCH 1/3] " Phillip Wood
2023-03-24 22:17 ` [PATCH] t3070: make chain lint tester happy Michael J Gruber
2023-03-25 6:37 ` Jeff King
2023-03-25 6:54 ` Eric Sunshine [this message]
2023-03-25 7:58 ` Jeff King
2023-03-25 8:04 ` Jeff King
2023-03-25 8:18 ` Eric Sunshine
2023-03-25 8:41 ` Jeff King
2023-03-25 8:51 ` Jeff King
2023-03-25 9:09 ` Eric Sunshine
2023-03-25 19:47 ` Jeff King
2023-03-25 9:17 ` Eric Sunshine
2023-03-26 14:30 ` Phillip Wood
2023-03-26 14:54 ` Michael J Gruber
2023-03-25 8:06 ` Eric Sunshine
2023-03-25 8:36 ` Jeff King
2023-03-20 16:10 ` [PATCH 2/3] wildmatch: avoid undefined behavior Phillip Wood
2023-03-20 16:10 ` [PATCH 3/3] wildmatch: hide internal return values Phillip Wood
2023-03-20 17:58 ` [PATCH 0/3] wildmatch: fix exponential behavior Junio C Hamano
2023-03-23 14:19 ` Derrick Stolee
2023-03-24 14:04 ` Phillip Wood
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cT9zjP++ECkTMjh33gzWyh_ho6n8_XYkXTHxnuGiDbnow@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=derrickstolee@github.com \
--cc=git@grubix.eu \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=phillip.wood123@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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).