Documentation
¶
Overview ¶
Package gitx starts the git commands Djinn runs, each with a deadline: a git that talks to a remote (over ssh, a stalled connection or a prompt nobody sees) or waits on a lock never holds Djinn for good (W504).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Local is the longest a git command that stays in the repository may run: a merge or a checkout of a large one. Local = 10 * time.Minute // Network is the longest a git command that reaches a remote may run: fetch, push, ls-remote. Network = 5 * time.Minute // WaitDelay is how long a git killed at its deadline may keep its output open: an ssh it started may hold it. WaitDelay = 5 * time.Second )
Functions ¶
func Command ¶
func Command(ctx context.Context, dir string, args ...string) (cmd *exec.Cmd, cancel context.CancelFunc)
Command is git with args, run in dir, never prompting for credentials, killed at the earlier of ctx's deadline and its own: Network for a command that reaches a remote, Local otherwise. Call cancel once it has run: it logs it.
func FetchBranch ¶ added in v0.1.2
FetchBranch fetches branch from remote into its remote-tracking ref, refs/remotes/<remote>/<branch>, with the person's own credentials: what the remote holds of it now. It returns that commit; "" when the remote has no such branch, its remote-tracking ref then left as it was; an error when the remote did not answer.
Types ¶
This section is empty.