MCPcopy Create free account
hub / github.com/digininja/GitHunter / GetCommitString

Method GetCommitString

commit.go:24–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22}
23
24func (c *Commit) GetCommitString() string {
25 output := ""
26
27 output += fmt.Sprintf("Commit ID: %s\n", c.id)
28 output += fmt.Sprintf("Author: %s\n", c.author)
29 output += fmt.Sprintf("Author Date: %s\n", c.authorDate.String())
30 output += fmt.Sprintf("Commit: %s\n", c.commit)
31 output += fmt.Sprintf("Commit Date: %s\n", c.commitDate.String())
32 output += fmt.Sprintf("Comments: %s\n", c.comment)
33 output += fmt.Sprintln("Files:")
34 for _, f := range c.matchFiles {
35 output += fmt.Sprintf(" * %s\n", f.Path)
36 }
37 output += fmt.Sprintln()
38
39 return output
40}
41
42func (c *Commit) AuthorDate(line string) {
43 t, err := time.Parse("Mon Jan 2 15:04:05 2006 -0700", strings.TrimPrefix(line, "AuthorDate: "))

Callers 4

PrintCommitMethod · 0.95
FilenameSearchFunction · 0.80
CommitMessageSearchFunction · 0.80
GrepSearchFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected