Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GitRemoteRegex = regexp.MustCompile(`^([^\t\n\f\r ]+)[\t\n\v\f\r ]+(git@github\.com:|(http[s]?|git):\/\/github\.com\/)([a-zA-Z0-9]{1}[a-zA-Z0-9-]*)\/([a-zA-Z0-9_.-]+)(\.git|[^\t\n\f\r ])+.*$`)
GitRemoteRegex is a regex for pulling account owner from the output of `git remote -v`
Functions ¶
func Branch ¶
Branch determines the git branch in the repo located at `top`. Two attempts are made to determine branch. First:
git rev-parse -q --abbrev-ref HEAD
If the current working directory is not on a branch, the result will return "HEAD". In this case, branch will be estimated by parsing the output of the following:
git branch -ar --contains $(git rev-parse -q HEAD)
func RemoteAccount ¶
RemoteAccount returns the github account as determined by the output of `git remote -v`
Types ¶
type Status ¶
type Status uint8
Status is a type for reporting the status of a git repo
const ( // StatusUpToDate means the local repo matches origin StatusUpToDate Status = iota // StatusNeedToPull means the local repo needs to pull from the remote StatusNeedToPull // StatusNeedToPush means the local repo needs to be pushed to the remote StatusNeedToPush // StatusDiverged means the local repo has diverged from the remote StatusDiverged )
Click to show internal directories.
Click to hide internal directories.

