Skip to main content

Module command_branch_table

Module command_branch_table 

Source
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: --contains and its relatives are PARSE_OPT_LASTARG_DEFAULT: they take the next token unless they are last. --color, --abbrev, --column and --track take an attached value only, so git branch --color name creates name.
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/--remotes and -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.