Re: [PATCH 01/25] t/test-lib: introduce --chain-lint option
- From
Jeff King <peff@peff.net>
- Date
- Mar 25, 2015, 03:05 UTC
- Message-ID
- <20150325030544.GD15051@peff.net>
- In-Reply-To
- <20150325035352.Horde.wlh5PImm_EGVzNTHeSEb7g1@webmail.informatik.kit.edu>
On Wed, Mar 25, 2015 at 03:53:52AM +0100, SZEDER Gábor wrote:
Show 9 quoted lines
> > cmd1 && > > for i in a b c; do > > cmd2 $i > > done && > > cmd3 > > > > which will not notice failures of "cmd2 a" or "cmd b" > > s/cmd b/cmd2 b/ ?
Yes, but the patches are already in next, so it is sadly too late for commit message fixups.
> > - it cannot find a missing &&-chain inside a block or > > subfunction, like: > [...] > And inside subshells. [...]
Yeah, I had mentally filed them with "block", but true subshells are probably the most common place. However, I'd suspect a good portion of them are going to be the "trivial" type, especially if they involve setting up the sub-environment at the top of the subshell. E.g., something like this:
cmd1 &&
(
FOO=bar; export FOO
cmd2
) &&
cmd3does not break the outer chain (which is what --chain-lint checks). It does break the chain inside the subshell, but we never expect variable assignment or export to fail (it is nice to fix it, of course, but the main purpose in fixing the ones in my "trivial" patch was more about shutting up --chain-lint to make the real breakages more obvious).
-Peff