2018-09-17 21:02:30 +10:00
|
|
|
package commands
|
|
|
|
|
|
|
|
// Commit : A git commit
|
|
|
|
type Commit struct {
|
|
|
|
Sha string
|
|
|
|
Name string
|
2019-03-28 18:58:34 +09:00
|
|
|
Status string // one of "unpushed", "pushed", "merged", "rebasing" or "selected"
|
2018-09-17 21:02:30 +10:00
|
|
|
DisplayString string
|
2019-02-19 23:36:29 +11:00
|
|
|
Action string // one of "", "pick", "edit", "squash", "reword", "drop", "fixup"
|
2019-02-24 13:51:52 +11:00
|
|
|
Copied bool // to know if this commit is ready to be cherry-picked somewhere
|
2019-11-18 09:38:36 +11:00
|
|
|
Tags []string
|
2020-02-25 20:11:07 +11:00
|
|
|
ExtraInfo string // something like 'HEAD -> master, tag: v0.15.2'
|
|
|
|
Author string
|
|
|
|
Date string
|
2018-09-17 21:02:30 +10:00
|
|
|
}
|
2020-03-26 09:18:52 +11:00
|
|
|
|
|
|
|
func (c *Commit) ShortSha() string {
|
|
|
|
if len(c.Sha) < 8 {
|
|
|
|
return c.Sha
|
|
|
|
}
|
|
|
|
return c.Sha[:8]
|
|
|
|
}
|