MCPcopy Index your code
hub / github.com/git-bug/git-bug / runBugComment

Function runBugComment

commands/bug/bug_comment.go:28–48  ·  view source on GitHub ↗
(env *execenv.Env, args []string)

Source from the content-addressed store, hash-verified

26}
27
28func runBugComment(env *execenv.Env, args []string) error {
29 b, _, err := ResolveSelected(env.Backend, args)
30 if err != nil {
31 return err
32 }
33
34 snap := b.Snapshot()
35
36 for i, comment := range snap.Comments {
37 if i != 0 {
38 env.Out.Println()
39 }
40
41 env.Out.Printf("Author: %s\n", colors.Magenta(comment.Author.DisplayName()))
42 env.Out.Printf("Id: %s\n", colors.Cyan(comment.CombinedId().Human()))
43 env.Out.Printf("Date: %s\n\n", comment.FormatTime())
44 env.Out.Println(text.LeftPadLines(comment.Message, 4))
45 }
46
47 return nil
48}

Callers 4

TestBugCommentFunction · 0.85
TestBugCommentNewFunction · 0.85
newBugCommentCommandFunction · 0.85
TestBugCommentEditFunction · 0.85

Calls 8

ResolveSelectedFunction · 0.85
SnapshotMethod · 0.80
FormatTimeMethod · 0.80
PrintlnMethod · 0.65
PrintfMethod · 0.65
DisplayNameMethod · 0.65
CombinedIdMethod · 0.65
HumanMethod · 0.45

Tested by 3

TestBugCommentFunction · 0.68
TestBugCommentNewFunction · 0.68
TestBugCommentEditFunction · 0.68