From 435be2b693aee89ed34a2d1e7291b3b141b19717 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 6 Aug 2018 20:31:20 +0200 Subject: bug: add a Lamport logical clock to be able to sort bugs by creation time and edit time without having to rely on a timestamp --- bug/operations/add_comment.go | 3 ++- bug/operations/label_change.go | 8 ++------ bug/operations/set_status.go | 5 ----- bug/operations/set_title.go | 5 ----- 4 files changed, 4 insertions(+), 17 deletions(-) (limited to 'bug/operations') diff --git a/bug/operations/add_comment.go b/bug/operations/add_comment.go index f2e76b73..7ae6f2dd 100644 --- a/bug/operations/add_comment.go +++ b/bug/operations/add_comment.go @@ -12,7 +12,8 @@ var _ bug.Operation = AddCommentOperation{} type AddCommentOperation struct { bug.OpBase Message string - files []util.Hash + // TODO: change for a map[string]util.hash to store the filename ? + files []util.Hash } func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { diff --git a/bug/operations/label_change.go b/bug/operations/label_change.go index f289fedc..85bae595 100644 --- a/bug/operations/label_change.go +++ b/bug/operations/label_change.go @@ -2,11 +2,11 @@ package operations import ( "fmt" - "github.com/MichaelMure/git-bug/bug" - "github.com/MichaelMure/git-bug/util" "io" "io/ioutil" "sort" + + "github.com/MichaelMure/git-bug/bug" ) // LabelChangeOperation will add or remove a set of labels @@ -51,10 +51,6 @@ AddLoop: return snapshot } -func (op LabelChangeOperation) Files() []util.Hash { - return nil -} - func NewLabelChangeOperation(author bug.Person, added, removed []bug.Label) LabelChangeOperation { return LabelChangeOperation{ OpBase: bug.NewOpBase(bug.LabelChangeOp, author), diff --git a/bug/operations/set_status.go b/bug/operations/set_status.go index 87ca14bf..ed6c328c 100644 --- a/bug/operations/set_status.go +++ b/bug/operations/set_status.go @@ -2,7 +2,6 @@ package operations import ( "github.com/MichaelMure/git-bug/bug" - "github.com/MichaelMure/git-bug/util" ) // SetStatusOperation will change the status of a bug @@ -20,10 +19,6 @@ func (op SetStatusOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { return snapshot } -func (op SetStatusOperation) Files() []util.Hash { - return nil -} - func NewSetStatusOp(author bug.Person, status bug.Status) SetStatusOperation { return SetStatusOperation{ OpBase: bug.NewOpBase(bug.SetStatusOp, author), diff --git a/bug/operations/set_title.go b/bug/operations/set_title.go index d6186f41..fab01d8a 100644 --- a/bug/operations/set_title.go +++ b/bug/operations/set_title.go @@ -2,7 +2,6 @@ package operations import ( "github.com/MichaelMure/git-bug/bug" - "github.com/MichaelMure/git-bug/util" ) // SetTitleOperation will change the title of a bug @@ -20,10 +19,6 @@ func (op SetTitleOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { return snapshot } -func (op SetTitleOperation) Files() []util.Hash { - return nil -} - func NewSetTitleOp(author bug.Person, title string) SetTitleOperation { return SetTitleOperation{ OpBase: bug.NewOpBase(bug.SetTitleOp, author), -- cgit