Skip to content

Commit

Permalink
log fmt similar to git
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjennings committed Jan 11, 2024
1 parent d3dd4b0 commit 4bad82c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/mygit/mygit.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Log(o io.Writer) error {
limit := 3
count := 0
for c, err := objects.ReadCommit(commitSha); c != nil && err == nil; c, err = objects.ReadCommit(c.Parents[0]) {
_, _ = fmt.Fprintln(o, c)
_, _ = fmt.Fprintf(o, "commit %s\nAuthor: %s <%s>\nDate: %s\n\n%8s\n", c.Sha, c.Author, c.AuthorEmail, c.AuthoredTime.String(), c.Message)
if count >= limit || len(c.Parents) == 0 {
break
}
Expand Down

0 comments on commit 4bad82c

Please sign in to comment.