{"modulePath":"github.com/kosli-dev/cli","version":"v0.1.41","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitview\n\n## Types\n\n```go\ntype CommitInfo struct {\n\tSha1      string   `json:\"sha1\"`\n\tMessage   string   `json:\"message\"`\n\tAuthor    string   `json:\"author\"`\n\tTimestamp int64    `json:\"timestamp\"`\n\tBranch    string   `json:\"branch\"`\n\tParents   []string `json:\"parents\"`\n}\n```\n\n```go\ntype GitView struct {\n\t// contains filtered or unexported fields\n}\n```\nGitView A read-only view of a git repository.\n\n```go\nfunc New(repositoryRoot string) (*GitView, error)\n```\nNew 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\n\n```go\nfunc (gv *GitView) BranchName() (string, error)\n```\nBranchName returns the current branch name on a repository, or an error if the repo head is not on a branch\n\n```go\nfunc (gv *GitView) ChangeLog(currentCommit, previousCommit string, logger *logger.Logger) ([]*CommitInfo, error)\n```\nChangeLog 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\n\n```go\nfunc (gv *GitView) CommitsBetween(oldest, newest string, logger *logger.Logger) ([]*CommitInfo, error)\n```\nCommitsBetween list all commits that have happened between two commits in a git repo\n\n```go\nfunc (gv *GitView) RepoUrl() (string, error)\n```\nRepoUrl returns HTTPS URL for the \\`origin\\` remote of a repo\n\n","path":"github.com/kosli-dev/cli/internal/gitview","name":"gitview","synopsis":"","isRedistributable":true}
