Expand description
The Git 2.56.0 option table of git push and its facts.
What:
The complete git push option table of Git 2.56.0 and the facts read from it.
Why:
The atomic-push transform must know whether the caller already chose atomicity,
and the manual-push gate whether the push is a dry run;
both in every spelling Git
accepts (--at,
--no-at,
-nf),
which a list of exact tokens misses.
In TS you’d write (pseudocode):
// parsePushRegion(postSubcommandArgs): PushRegion (throws OptionError)Structs§
- Push
Region - What:
Final-state facts of one
git pushregion.boolis true or false;Vec<WrapperOccurrence>is an owned list of wrapper-flag positions. Why:atomic_statedis “the caller chose”, in either direction;dry_runis the state after the last-n,--dry-runor--no-dry-run.
Constants§
- ALL
--alland its alias--branches: every local branch.- ATOMIC
--atomic: request an atomic transaction on the remote side.- DELETE
-d,--delete: remove remote refs.- DRY_RUN
-n,--dry-run: do everything except send the updates.- FOLLOW_
TAGS --follow-tags: add the annotated tags that point into the pushed history.- FORCE
-f,--force: update a ref that is not a descendant.- FORCE_
IF_ INCLUDES --force-if-includes: a safety check that only means something with a forced push.- FORCE_
WITH_ LEASE --force-with-lease: force when the remote ref is still what the caller expected.- MIRROR
--mirror: make the remote’s refs equal the local ones.- PORCELAIN
--porcelain: machine-readable output that a script parses.- PRUNE
--prune: remove remote refs that have no local counterpart.- PUSH_
TABLE - What:
Rows of
options[]incmd_push(builtin/push.c:707-743), in source order.&[OptionSpec]is a borrowed table baked into the program. Why:--branchesis anOPT_ALIASof--all; the two names share no prefix, so the alias needs no special ambiguity handling and is a row of its own. - REPO
--repo: the destination is an option and not the first positional argument.- SET_
UPSTREAM -u,--set-upstream: record the pushed branch as the local branch’s upstream.- TAGS
--tags: every local tag.
Functions§
- parse_
push_ region - What:
Parse the region after
push.Result<A, B>is “either successAor failureB”. Why: A region Git itself would refuse yields the refusal, never a guessed fact set. - stackable_
option_ tokens - What:
The option tokens of a push that may be integrated after a rejection, or nothing when it may not.
Option<Vec<OsString>>is “the tokens, or no answer”. Why: Only a plain update of branches keeps its meaning when the wrapper merges what landed on the remote and pushes the merge; the stacked push repeats these tokens and replaces the remote and refspec arguments, so the caller’s--no-verify,--push-optionand the like still apply. A region the table refuses, a forced refspec (+src:dst) and every option inNOT_STACKABLEgive nothing.