diff options
author | Michael Muré <batolettre@gmail.com> | 2018-10-01 23:34:45 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-10-01 23:34:45 +0200 |
commit | 8ec1dd092656aed5dae22a0301bd3f85b5dabb88 (patch) | |
tree | 26ee832a2d629d48e9ac9f43fc808f17a4a77154 /bug | |
parent | f18c2d278352f556b90ad9a52c33499665e16fa2 (diff) | |
download | git-bug-8ec1dd092656aed5dae22a0301bd3f85b5dabb88.tar.gz |
github: working incremental + comment history for the first comment
Diffstat (limited to 'bug')
-rw-r--r-- | bug/operation.go | 8 | ||||
-rw-r--r-- | bug/snapshot.go | 1 | ||||
-rw-r--r-- | bug/timeline.go | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/bug/operation.go b/bug/operation.go index f42a1192..bb88af1f 100644 --- a/bug/operation.go +++ b/bug/operation.go @@ -21,6 +21,7 @@ const ( SetStatusOp LabelChangeOp EditCommentOp + NoOpOp ) // Operation define the interface to fulfill for an edit operation of a Bug @@ -43,6 +44,8 @@ type Operation interface { SetMetadata(key string, value string) // GetMetadata retrieve arbitrary metadata about the operation GetMetadata(key string) (string, bool) + // AllMetadata return all metadata for this operation + AllMetadata() map[string]string } func hashRaw(data []byte) git.Hash { @@ -145,3 +148,8 @@ func (op *OpBase) GetMetadata(key string) (string, bool) { val, ok := op.Metadata[key] return val, ok } + +// AllMetadata return all metadata for this operation +func (op *OpBase) AllMetadata() map[string]string { + return op.Metadata +} diff --git a/bug/snapshot.go b/bug/snapshot.go index 28a92961..1004b625 100644 --- a/bug/snapshot.go +++ b/bug/snapshot.go @@ -33,6 +33,7 @@ func (snap *Snapshot) HumanId() string { return fmt.Sprintf("%.8s", snap.id) } +// Deprecated:should be moved in UI code func (snap *Snapshot) Summary() string { return fmt.Sprintf("C:%d L:%d", len(snap.Comments)-1, diff --git a/bug/timeline.go b/bug/timeline.go index b5aa22a9..359389a6 100644 --- a/bug/timeline.go +++ b/bug/timeline.go @@ -56,6 +56,7 @@ func (c *CommentTimelineItem) Append(comment Comment) { c.Files = comment.Files c.LastEdit = comment.UnixTime c.History = append(c.History, CommentHistoryStep{ + Author: comment.Author, Message: comment.Message, UnixTime: comment.UnixTime, }) |