From: Jiamu Sun <39@barroit.sh> Date: Thu, 16 Apr 2026 02:24:56 GMT Subject: Re: [PATCH v4 07/10] parseopt: autocorrect mistyped subcommands Message-ID: In-Reply-To: On Wed, Apr 15, 2026 at 10:55:00AM -0700, Junio C Hamano wrote: > Either do that (which is probably conceptually simpler), or explain > in the proposed log message why they have to be different. My gut > feeling is that you should start from identical settings that has > been used for years, and then in a separate topic propose to improve > the parameters to improve the behaviour for both main commands and > sub commands at the same time, but that is largely because there Agreed. I will change the subcommand autocorrection behavior to be the same as the main command in the next revision. > weren't any explanation why subcommands correction should behave > differently from main commands ("Correction for main commands > behaves strangely and I do not want to inherit it" is not a good > explanation as it invites a natural question "if you have a better > behaviour you can use for subcommand correction, can't it be used > also for main commands? If not, why not?"). > Currently, command autocorrection skips all prefix matched commands. In my mind, this shouldn't happen because "branc" can indeed be autocorrected to "branch". I studied the old thread, but didn't find any explanation that expands on why it's doing that. Instead of skipping that, applying the autocorrect handling to that case would be better, maybe? But for this patch, I'll keep them the same. -- Jiamu Sun <39@barroit.sh>