From: Jeff King Date: Thu, 02 Jul 2026 08:45:19 GMT Subject: Re: [PATCH v2 0/4] rev-parse: exit 0 on --help Message-ID: <20260702084519.GB481298@coredump.intra.peff.net> In-Reply-To: On Wed, Jul 01, 2026 at 03:06:52PM -0700, Junio C Hamano wrote: > > One of the patches is rather long because we have many cases in which > > we've hard-coded exit code 129 into our tests. However, the changes > > there should not be complex, only somewhat tedious to review. > > It is borderline for "yes, we all know it is obvious that things > should have worked this way from day one, we regret that it is not > the case, but it has been working differently and users' scripts all > have been working with the current behaviour, and it is likely that > they will all break". > > Two big things that make it much less likely, saving grace, are that > this is only about "--help" (which is unlikely to be a part of > end-user script), and this makes the invocation succeed (if we were > changing from exit 0 to exit 129, we would be breaking tons more). My big concern is a script accidentally continuing when fed "--help" and generating nonsense. But I think the eval magic explained in patch 3 makes that unlikely (any such caller was already kind-of broken). The other issue I raised in the earlier round is that a script like: cat >git-foo <<\EOF #!/bin/sh git log --my-options "$@" >output || exit 1 do_something