Documentation ¶
Index ¶
- func AddAll()
- func AddFile(path string)
- func AreChangesAddedToBeCommited() bool
- func CreateCommit(m string)
- func IsMergeCommit(m string) bool
- func LintCommitMessage(m string) bool
- func Log() string
- func LogChangelog(firstCommit string, secondCommit string) string
- func LogCommitMessage(rev1 string, rev2 string) []string
- func LogShortHash(rev1 string, rev2 string) []string
- func ShowTopLevel() string
- func Status() string
- func TagCommit(version string)
- type Commit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreChangesAddedToBeCommited ¶
func AreChangesAddedToBeCommited() bool
AreChangesAddedToBeCommited checks if `git status` output contains `Changes to be committed` string, meaning there are currently changes staged for commit.
func CreateCommit ¶
func CreateCommit(m string)
CreateCommit runs `git commit -m` command. Exits if it fails.
func IsMergeCommit ¶
IsMergeCommit checks if a commit is a merge commit FIXME: Dirty fix to identify default merge commits
func LintCommitMessage ¶
LintCommitMessage check if a message respect the conventional commit convention TODO: apply .env file
func LogChangelog ¶
LogChangelog runs `git log --oneline --first-parent [rev1]...[rev2]`. It logs the commit history between 2 revisions. If the first one is empty, defaults to `HEAD`
func LogCommitMessage ¶
LogCommitMessage returns commit message list between 2 revisions
func LogShortHash ¶
LogShortHash returns commit short hashes list between 2 revisions
func ShowTopLevel ¶
func ShowTopLevel() string
ShowTopLevel runs `git rev-parse --show-toplevel` command. Exits if it fails.
Types ¶
type Commit ¶
type Commit struct { Hash string Type string Scope string IsBreakingChange bool IsMergeCommit bool Msg string }
Commit struct respresents a git commit object
func ParseLogOutput ¶
ParseLogOutput generate a list of git.Commit from a git log output
func (*Commit) FillFromStrMsg ¶
FillFromStrMsg fill commit information from a string inside a git.Commit object