package syw import ( "strings" "time" ) type Commit struct { Repo *Repository Hash string Parents []string CommitterName string CommitterEmail string CommitDate time.Time AuthorName string AuthorEmail string AuthorDate time.Time Message string } func (c *Commit) ParentHash() string { return c.Hash + "^" } func (c *Commit) ShortMessage() string { short, _, _ := strings.Cut(c.Message, "\n") return short } func (c *Commit) RestOfMessage() string { _, rest, _ := strings.Cut(c.Message, "\n") return strings.TrimPrefix(rest, "\n") }