Re: [PATCH v5 00/10] parseopt: add subcommand autocorrection
- From
- Jiamu Sun <39@barroit.sh>
- Date
- Apr 23, 2026, 01:14 UTC
- Message-ID
- <SY0P300MB08012E039329CC8EF7C3EB92CE2A2@SY0P300MB0801.AUSP300.PROD.OUTLOOK.COM>
- In-Reply-To
- <xmqqwlxyo7w6.fsf@gitster.g>
On Wed, Apr 22, 2026 at 05:08:41PM -0700, Junio C Hamano wrote:
> It seems that the exit status of some error path (subcommand parse > failure, presumably) has changed unexpectedly? As I am mostly > offline for this and next week, I didn't dig any further.
My fault, forgot to adjust these tests. Since subcommand parser learned to autocorrect misspelled names,
> t0040-parse-options.sh (Wstat: 256 (exited 1) Tests: 94 Failed: 1)
test-tool parse-subcommand cmd subcmd-o
in "subcommand - subcommands cannot be abbreviated" test now shows similar subcommands.
> t7900-maintenance.sh (Wstat: 256 (exited 1) Tests: 72 Failed: 1)
git maintenance barf
in "help text" test now corrects "barf" to "start".
After fixing these two, all tests pass.
---- All tests successful. Files=1043, Tests=33202, 465 wallclock secs ( 7.02 usr 2.23 sys + 1244.78 cusr 1642.22 csys = 2896.25 CPU) Result: PASS
Also, I found most error paths exit with 129 in parse-options.c, but the similar subcommand hint exits with 1. That's inconsistent, will change the exit code to 129.
--
Jiamu Sun <39@barroit.sh>
<sunjiamu@outlook.com>