Documentation ¶
Index ¶
- func CommentChar() string
- func CurrentBranch() (string, error)
- func CurrentUpstreamBranch() (string, error)
- func Dir() (string, error)
- func Edit(filePrefix, message string) (string, string, error)
- func EditFile(filePrefix, message string) (string, error)
- func Fetch(remote, commit string) error
- func GetLocalRemotes() (string, error)
- func GetLocalRemotesFromFile() (string, error)
- func GetUnifiedDiff(BaseSHA string, HeadSHA string, oldPath string, newPath string) (string, error)
- func InsideGitRepo() bool
- func IsRemote(remote string) (bool, error)
- func LastCommitMessage() (string, error)
- func Log(sha1, sha2 string) (string, error)
- func New(args ...string) *exec.Cmd
- func NumberCommits(sha1, sha2 string) int
- func PagerCommand() (string, []string)
- func PathWithNameSpace(remote string) (string, error)
- func RemoteAdd(name, url, dir string) error
- func RemoteBranches(remote string) ([]string, error)
- func Remotes() ([]string, error)
- func RepoName() (string, error)
- func Show(commit1, commit2 string, reverse bool)
- func UpstreamBranch(branch string) (string, error)
- func WorkingDir() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentChar ¶
func CommentChar() string
CommentChar returns active comment char and defaults to '#'
func CurrentBranch ¶
CurrentBranch returns the currently checked out branch
func CurrentUpstreamBranch ¶
CurrentUpstreamBranch returns the upstream of the currently checked out branch
func EditFile ¶
EditFile opens a file in the users editor and returns the contents. It stores a temporary file in your .git directory or /tmp if accessed outside of a git repo.
func GetLocalRemotes ¶
GetLocalRemotes returns a string of local remote names and URLs
func GetLocalRemotesFromFile ¶
GetLocalRemotesFromFile returns a string of local remote names and URLs based on their placement within .git/config file, which holds a different ordering compared to the alternatives presented by Remotes() and GetLocalRemotes().
func GetUnifiedDiff ¶
func InsideGitRepo ¶
func InsideGitRepo() bool
InsideGitRepo returns true when the current working directory is inside the working tree of a git repo
func LastCommitMessage ¶
LastCommitMessage returns the last commits message as one line
func NumberCommits ¶
func PagerCommand ¶
PagerCommand returns the commandline and environment for the pager
func PathWithNameSpace ¶
PathWithNameSpace returns the owner/repository for the current repo Such as prarit/rhstatus Respects GitLab subgroups (https://docs.gitlab.com/ce/user/group/subgroups/)
func RemoteBranches ¶
func UpstreamBranch ¶
UpstreamBranch returns the upstream of the specified branch
func WorkingDir ¶
WorkingDir returns the full path to the root of the current git repository
Types ¶
This section is empty.