Expand description
The complete Git 2.56.0 option table of git branch.
What:
The complete option table of git branch in Git 2.56.0.
Why:
Whether git branch <name> creates a branch depends on which action options were
given,
and whether a token is a name depends on each option’s arity.
Rows follow
options[] in cmd_branch (builtin/branch.c:992-1050) in source order.
In TS you’d write (pseudocode):
// export const BRANCH_TABLE: readonly OptionSpec[] = [ ... ];Constants§
- BRANCH_
TABLE - What:
pub const NAME: &[OptionSpec] = &[...]is a table baked into the program. Why:--containsand its relatives arePARSE_OPT_LASTARG_DEFAULT: they take the next token unless they are last.--color,--abbrev,--columnand--tracktake an attached value only, sogit branch --color namecreatesname. - COPY
-c,--copy.- COPY_
FORCE -C.- DELETE
-d,--delete.- DELETE_
FORCE -D.- DELETE_
MERGED --delete-merged=<pattern>.- DRY_RUN
--dry-run, valid only with--delete-merged.- EDIT_
DESCRIPTION --edit-description.- FILTER
--contains,--no-contains,--with,--without,--merged,--no-merged,--forked.- KIND
-r/--remotesand-a/--all: both change the listed kind of ref.- LIST
-l,--list.- MOVE
-m,--move.- MOVE_
FORCE -M.- POINTS_
AT --points-at=<object>.- RECURSE_
SUBMODULES --recurse-submodules: Git accepts it only when creating a branch.- SET_
UPSTREAM --set-upstream: hidden, writes the tracking mode Git refuses when creating.- SET_
UPSTREAM_ TO -u,--set-upstream-to=<upstream>.- SHOW_
CURRENT --show-current.- TRACK
-t,--track[=(direct|inherit)]: writes the tracking mode.- UNSET_
UPSTREAM --unset-upstream.