mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
more work on rebasing including visual indicators
This commit is contained in:
parent
cce6f405a5
commit
e0ff46fe53
10 changed files with 221 additions and 51 deletions
|
@ -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)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue