On Tue, Jun 26, 2018 at 5:33 PM Elijah Newren <newren@xxxxxxxxx> wrote: > On Tue, Jun 26, 2018 at 1:22 PM, Jeff King <peff@xxxxxxxx> wrote: > > Another option is to not enable this slightly-more-dangerous linting by > > default. But that would probably rob it of its usefulness, since it > > would just fall to some brave soul to later crank up the linting and fix > > everybody else's mistakes. > > This may be a dumb question, but why can't we run under errexit? If > we could do that, we wouldn't need the &&-chaining, and bash would > parse the shell for us and exit whenever one command failed. (Is the > reason for this documented somewhere? I couldn't find it...) I'm not sure if it's documented anywhere, but it has been discussed. In particular, see [1], especially [2], and [3]. Peff summed up by saying: So I dunno. I think "set -e" is kind of a dangerous lure. It works so well _most_ of the time that you start to rely on it, but it really does have some funny corner cases (even on modern shells, and for all I know, the behavior above is mandated by POSIX). [1]: https://public-inbox.org/git/xmqq384zha6s.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx/ [2]: https://public-inbox.org/git/20150320172406.GA15172@xxxxxxxx/ [3]: https://public-inbox.org/git/xmqqoannfu84.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx/