Documentation ¶
Index ¶
- type CommitInfo
- type GitView
- func (gv *GitView) BranchName() (string, error)
- func (gv *GitView) ChangeLog(currentCommit, previousCommit string, logger *logger.Logger) ([]*CommitInfo, error)
- func (gv *GitView) CommitsBetween(oldest, newest string, logger *logger.Logger) ([]*CommitInfo, error)
- func (gv *GitView) RepoUrl() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitInfo ¶ added in v0.1.34
type GitView ¶
type GitView struct {
// contains filtered or unexported fields
}
GitView A read-only view of a git repository.
func New ¶
New opens a git repository from the given path. It detects if the repository is bare or a normal one. If the path doesn't contain a valid repository ErrRepositoryNotExists is returned
func (*GitView) BranchName ¶
BranchName returns the current branch name on a repository, or an error if the repo head is not on a branch
func (*GitView) ChangeLog ¶
func (gv *GitView) ChangeLog(currentCommit, previousCommit string, logger *logger.Logger) ([]*CommitInfo, error)
ChangeLog attempts to collect the changelog list of commits for an artifact, the changelog is all commits between current commit and the commit from which the previous artifact in Kosli was created. If collecting the changelog fails (e.g. if git history has been rewritten, or the clone depth is too shallow), the changelog only contains the single commit info which is the current commit
func (*GitView) CommitsBetween ¶
func (gv *GitView) CommitsBetween(oldest, newest string, logger *logger.Logger) ([]*CommitInfo, error)
CommitsBetween list all commits that have happened between two commits in a git repo