Expand description
git stash subcommand dispatch and wrapper-flag positions.
What:
Which git stash subcommand a region runs in Git 2.56.0,
and where wrapper-only
flags sit in it.
Why:
The linked-worktree policy guards stash;
its escape hatch must be found in option
position of the subcommand that actually reads the arguments,
so a message or a
path that spells the hatch is forwarded untouched.
In TS you’d write (pseudocode):
// parseStashRegion(['push', '-m', '--no-enforce-worktree']).hasEscapeHatch === falseStructs§
- Stash
Region - What:
Facts of one
git stashregion. Why: The shipped policy guards every stash form; the subcommand is reported for its diagnostics and the hatch for its bypass.
Enums§
- Stash
Subcommand - What:
The subcommand
cmd_stashdispatches to (builtin/stash.c:2465-2479). Anenumis a closed set of named alternatives. Why:AssumedPushis the form without a subcommand word, which Git parses aspushwith stricter flags (2515-2528).
Functions§
- parse_
stash_ region - What:
Parse the region after
stash.Result<A, B>is “either successAor failureB”. Why: Leading wrapper flags are skipped first, sogit stash --no-enforce-worktree liststill dispatches tolist; the rest follows the selected subcommand’s grammar.