diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-27 17:00:43 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-27 21:51:07 +1000 |
commit | f99d5f74d49109c19f7701005e636a38c9a70fdb (patch) | |
tree | 1bd6d6ca761ceec37f10935fdf7405a9277c6464 /pkg/gui/presentation/commits.go | |
parent | 30a066aa41cedabeebac0f9e747073ff33805893 (diff) |
drop merge commits when interactive rebasing just like git CLI
Diffstat (limited to 'pkg/gui/presentation/commits.go')
-rw-r--r-- | pkg/gui/presentation/commits.go | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go index 6e54e9b3a..ea61a6b26 100644 --- a/pkg/gui/presentation/commits.go +++ b/pkg/gui/presentation/commits.go @@ -32,7 +32,6 @@ func getFullDescriptionDisplayStringsForCommit(c *commands.Commit, cherryPickedC yellow := color.New(color.FgYellow) green := color.New(color.FgGreen) blue := color.New(color.FgBlue) - cyan := color.New(color.FgCyan) defaultColor := color.New(theme.DefaultTextColor) diffedColor := color.New(theme.DiffTerminalColor) @@ -66,7 +65,7 @@ func getFullDescriptionDisplayStringsForCommit(c *commands.Commit, cherryPickedC tagString := "" secondColumnString := blue.Sprint(utils.UnixToDate(c.UnixTimestamp)) if c.Action != "" { - secondColumnString = cyan.Sprint(c.Action) + secondColumnString = color.New(actionColorMap(c.Action)).Sprint(c.Action) } else if c.ExtraInfo != "" { tagColor := color.New(color.FgMagenta, color.Bold) tagString = utils.ColoredStringDirect(c.ExtraInfo, tagColor) + " " @@ -82,7 +81,6 @@ func getDisplayStringsForCommit(c *commands.Commit, cherryPickedCommitShaMap map yellow := color.New(color.FgYellow) green := color.New(color.FgGreen) blue := color.New(color.FgBlue) - cyan := color.New(color.FgCyan) defaultColor := color.New(theme.DefaultTextColor) diffedColor := color.New(theme.DiffTerminalColor) @@ -116,7 +114,7 @@ func getDisplayStringsForCommit(c *commands.Commit, cherryPickedCommitShaMap map actionString := "" tagString := "" if c.Action != "" { - actionString = cyan.Sprint(utils.WithPadding(c.Action, 7)) + " " + actionString = color.New(actionColorMap(c.Action)).Sprint(utils.WithPadding(c.Action, 7)) + " " } else if len(c.Tags) > 0 { tagColor := color.New(color.FgMagenta, color.Bold) tagString = utils.ColoredStringDirect(strings.Join(c.Tags, " "), tagColor) + " " @@ -124,3 +122,18 @@ func getDisplayStringsForCommit(c *commands.Commit, cherryPickedCommitShaMap map return []string{shaColor.Sprint(c.ShortSha()), actionString + tagString + defaultColor.Sprint(c.Name)} } + +func actionColorMap(str string) color.Attribute { + switch str { + case "pick": + return color.FgCyan + case "drop": + return color.FgRed + case "edit": + return color.FgGreen + case "fixup": + return color.FgMagenta + default: + return color.FgYellow + } +} |