Less defines a compare function to determine which commit is 'earlier' by: - First use Committer.When - If Committer.When are equal then use Author.When - If Author.When also equal then compare the string value of the hash
(rhs *Commit)
| 436 | // - If Committer.When are equal then use Author.When |
| 437 | // - If Author.When also equal then compare the string value of the hash |
| 438 | func (c *Commit) Less(rhs *Commit) bool { |
| 439 | return c.Committer.When.Before(rhs.Committer.When) || |
| 440 | (c.Committer.When.Equal(rhs.Committer.When) && |
| 441 | (c.Author.When.Before(rhs.Author.When) || |
| 442 | (c.Author.When.Equal(rhs.Author.When) && bytes.Compare(c.Hash[:], rhs.Hash[:]) < 0))) |
| 443 | } |
| 444 | |
| 445 | func indent(t string) string { |
| 446 | var output []string |