Conversation
Allow invoking StGit commands, aliases, and subcommands using any unambiguous prefix (for example, `stg del` for `stg delete`, `stg ser` for `stg series`, or `stg em s` for `stg email send`), matching StGit 1.x behavior. Enable `infer_subcommands(true)` on the base clap Command so clap accepts unambiguous prefixes for top-level and nested subcommands. Because the initial bootstrap CLI parser uses `allow_external_subcommands(true)` to avoid constructing the full command graph up front, also resolve subcommand prefixes across built-in commands, `help`, and configured aliases: - Exact matches on built-in commands, `help`, or aliases always take precedence over prefix matches. - Non-exact prefixes are checked against built-in commands, `help`, and aliases together so that a prefix shared between a built-in command and an alias (such as `res` for `reset` and `resolved`) is rejected as ambiguous. Signed-off-by: Dmitry Torokhov <dtor@google.com>
dtor
force-pushed
the
allow-shorthands
branch
from
September 30, 2026 04:21
59d75c2 to
60bee49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow invoking StGit commands, aliases, and subcommands using any unambiguous prefix (for example,
stg delforstg delete,stg serforstg series, orstg em sforstg email send), matching StGit 1.x behavior.Enable
infer_subcommands(true)on the base clap Command so clap accepts unambiguous prefixes for top-level and nested subcommands. Because the initial bootstrap CLI parser usesallow_external_subcommands(true)to avoid constructing the full command graph up front, also resolve subcommand prefixes across built-in commands,help, and configured aliases:help, or aliases always take precedence over prefix matches.help, and aliases together so that a prefix shared between a built-in command and an alias (such asresforresetandresolved) is rejected as ambiguous.