diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-05 22:30:10 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-11 09:39:54 +1100 |
commit | e0ff46fe53503d74fc63c90fc5ddc4d9468b60d5 (patch) | |
tree | 137f8360a1416b08cc6c327ba47b07a4670366d6 /pkg/commands/commit.go | |
parent | cce6f405a5643ed46a6bc0b9fd7cf132c915c9f3 (diff) |
more work on rebasing including visual indicators
Diffstat (limited to 'pkg/commands/commit.go')
-rw-r--r-- | pkg/commands/commit.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go index 4c304271d..6ee972f9f 100644 --- a/pkg/commands/commit.go +++ b/pkg/commands/commit.go @@ -8,23 +8,30 @@ import ( type Commit struct { Sha string Name string - Pushed bool - Merged bool + Status string // one of "unpushed", "pushed", "merged", or "rebasing" DisplayString string } // GetDisplayStrings is a function. func (c *Commit) GetDisplayStrings() []string { red := color.New(color.FgRed) - yellow := color.New(color.FgGreen) - green := color.New(color.FgYellow) + yellow := color.New(color.FgYellow) + green := color.New(color.FgGreen) white := color.New(color.FgWhite) + blue := color.New(color.FgBlue) - shaColor := yellow - if c.Pushed { + var shaColor *color.Color + switch c.Status { + case "unpushed": shaColor = red - } else if !c.Merged { + case "pushed": + shaColor = yellow + case "merged": shaColor = green + case "rebasing": + shaColor = blue + default: + shaColor = white } return []string{shaColor.Sprint(c.Sha), white.Sprint(c.Name)} |