Skip to main content

Module command_stash

Module command_stash 

Source
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 === false

Structs§

StashRegion
What: Facts of one git stash region. Why: The shipped policy guards every stash form; the subcommand is reported for its diagnostics and the hatch for its bypass.

Enums§

StashSubcommand
What: The subcommand cmd_stash dispatches to (builtin/stash.c:2465-2479). An enum is a closed set of named alternatives. Why: AssumedPush is the form without a subcommand word, which Git parses as push with stricter flags (2515-2528).

Functions§

parse_stash_region
What: Parse the region after stash. Result<A, B> is “either success A or failure B”. Why: Leading wrapper flags are skipped first, so git stash --no-enforce-worktree list still dispatches to list; the rest follows the selected subcommand’s grammar.