Expand description
The Git command a forwarded invocation runs,
after ordinary alias expansion.
What:
The Git command a forwarded invocation actually runs,
after ordinary alias expansion.
Why:
Git expands an alias only when no built-in has that name,
reads it from alias.<name>
or alias.<name>.command,
splits it with split_cmdline quoting,
lets its leading words
be global options,
and expands again when the result is an alias.
Index-writer
coordination and the commit rules decide from the expanded command,
so
git -c alias.c=commit c is a commit (src/forwarded-command.ts).
In TS you’d write (pseudocode):
const command = await resolveForwardedCommand({ args, gitPath });Structs§
- Resolved
Command - What:
The resolved command:
the arguments after expansion,
where the subcommand is,
its
name,
and the route.
Why:
ResolvedGitCommand.
Enums§
- Route
- What: How the command was reached. Why: A shell alias or an unresolved name is never classified as a built-in.
Constants§
- MAX_
ALIAS_ EXPANSIONS - Alias expansions followed before giving up, well above any realistic chain.
Functions§
- creates_
or_ moves_ worktrees - What:
Whether a resolved command creates or moves linked worktrees.
Why:
createsOrMovesWorktrees:git worktree addandgit worktree move, decided by the first positional token afterworktree. - lookup_
alias - What:
An alias value in either of Git’s spellings,
alias.<name>first. Why:lookupAlias. - resolve_
forwarded_ command - What:
Resolve the command a forwarded invocation runs,
expanding aliases up to
MAX_ALIAS_EXPANSIONStimes; a built-in name starts no Git process. Why:resolveForwardedCommand. - split_
alias_ command - What:
Split an alias value as Git’s
split_cmdlinedoes: whitespace separates words outside quotes, single and double quotes group, and a backslash escapes the next byte except inside single quotes.Noneis an unclosed quote or a trailing backslash. Why:splitAliasCommand; bytes are kept as they are. - trim_
alias_ value - What:
An alias value with surrounding whitespace removed,
as JavaScript’s
.trim()does for text; a value that is not UTF-8 loses only ASCII whitespace. Why: The incumbent trimsgit config --getoutput, newline included, before splitting.