Skip to main content

Module auto_push_destination

Module auto_push_destination 

Source
Expand description

Where a plain git push of one named branch goes, from the configuration and the local refs. What: Where a plain git push of one named branch would send it, decided from the configuration and the local refs, or why Git would send it nowhere. Why: The service pushes the branch a record names, which may not be the branch checked out, so it must name both sides of the push itself; naming them from a partial reading of Git’s rules pushed to places a plain git push refuses or never goes (a matching push recreating a branch the remote deleted, one of several upstream branches chosen at random, a destination that another configured refspec had already taken). Everything here follows setup_default_push_refspecs in Git’s builtin/push.c and match_push_refs in remote.c; a setting Git refuses or a form this module does not interpret becomes a skip with a note that names the setting, never a push.

In TS you’d write (pseudocode):

const named: NamedPush = await namedPush({ git, branchRef }); // push | remote-must-have | skip

Structs§

Destination
Where the plain push goes: the branch’s push remote and the ref it updates there.

Enums§

NamedPush
What the service does for one named branch whose upstream resolves.

Functions§

named_push
What: What the service does for a named branch whose upstream resolves: the remote and refs it pushes to, the one remote question that decides, or the note that explains why it pushes nothing. Why: The plain git push pushes the checked-out branch, so a push of a branch that is not checked out names both sides; the destination follows Git’s rules for the branch as if it were checked out, and a setting under which Git refuses or pushes nothing for it is a skip.
read_destination
What: The remote and the branch ref that the plain git push of this branch updates, when the settings name one. Why: The reconcile of a rejected push merges the tip of the branch the rejected push targeted, which with a push remote, a triangular setup or push.default=current is not the tracked branch. The remote ., a remote.<name>.push refspec, matching, nothing, several upstream branches and a target outside refs/heads name none, because the rejection then came from a destination this module cannot name.