Documentation ¶
Overview ¶
Package git is a wrapper for Git actions. The main purpose is the unify some functionality in this package.
Index ¶
- Variables
- type Git
- func (g *Git) BranchDiffCommits(branchA string, branchB string) ([]plumbing.Hash, error)
- func (g *Git) Commit(hash plumbing.Hash) (*object.Commit, error)
- func (g *Git) CommitsBetween(from plumbing.Hash, to plumbing.Hash) ([]plumbing.Hash, error)
- func (g *Git) CommitsOnBranch(branchCommit plumbing.Hash) ([]plumbing.Hash, error)
- func (g *Git) CommitsOnBranchSimple(branchCommit plumbing.Hash) ([]SimpleCommit, error)
- func (g *Git) CurrentBranch() (*plumbing.Reference, error)
- func (g *Git) CurrentCommit() (*object.Commit, error)
- func (g *Git) CurrentTag() (*Tag, error)
- func (g *Git) LatestCommitOnBranch(desiredBranch string) (*object.Commit, error)
- func (g *Git) PreviousTag(currentHash plumbing.Hash) (*Tag, error)
- func (g *Git) Tags() ([]*Tag, error)
- type SimpleCommit
- type Tag
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCommitNotOnTag is returned by CurrentTag if the commit is not on a tag ErrCommitNotOnTag = errors.New("current commit is not on a tag") )
var ErrCommonCommitFound = errors.New("common commit found")
ErrCommonCommitFound is used for identifying when the iterator has reached the common commit
var ( // ErrPrevTagNotAvailable is returned when no previous tag is found. ErrPrevTagNotAvailable = errors.New("previous tag is not available") )
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git is the struct used to house all methods in use in Commitsar.
func (*Git) BranchDiffCommits ¶
BranchDiffCommits compares commits from 2 branches and returns of a diff of them.
func (*Git) CommitsBetween ¶
CommitsBetween returns a slice of commit hashes between two commits
func (*Git) CommitsOnBranch ¶
CommitsOnBranch iterates through all references and returns commit hashes on given branch. \n Important to note is that this will provide all commits from anything the branch is connected to.
func (*Git) CommitsOnBranchSimple ¶
func (g *Git) CommitsOnBranchSimple( branchCommit plumbing.Hash, ) ([]SimpleCommit, error)
CommitsOnBranchSimple iterates through all references and returns simpleCommits on given branch. \n Important to note is that this will provide all commits from anything the branch is connected to.
func (*Git) CurrentBranch ¶
CurrentBranch returns the reference HEAD is at right now
func (*Git) CurrentCommit ¶
CurrentCommit returns the commit that HEAD is at
func (*Git) CurrentTag ¶
CurrentTag returns a Tag if the current HEAD is on a tag
func (*Git) LatestCommitOnBranch ¶
LatestCommitOnBranch resolves a revision and then returns the latest commit on it.
func (*Git) PreviousTag ¶
PreviousTag sorts tags based on when their commit happened and returns the one previous to the current.
type SimpleCommit ¶
SimpleCommit is a slimed down commit object of just Hash and Message