From 0cd91a10c6038b66ecee3c1971b26ff8436f2a49 Mon Sep 17 00:00:00 2001 From: Glenn Vriesman Date: Mon, 3 Feb 2020 20:54:43 +0100 Subject: Increase internal sha size This does not change the sha size that is displayed to the user Signed-off-by: Glenn Vriesman --- pkg/commands/commit.go | 2 +- pkg/commands/commit_list_builder.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/commands') diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go index 1cfed8b29..83c739899 100644 --- a/pkg/commands/commit.go +++ b/pkg/commands/commit.go @@ -64,5 +64,5 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { tagString = utils.ColoredString(strings.Join(c.Tags, " "), color.FgMagenta) + " " } - return []string{shaColor.Sprint(c.Sha), actionString + tagString + defaultColor.Sprint(c.Name)} + return []string{shaColor.Sprint(c.Sha[:7]), actionString + tagString + defaultColor.Sprint(c.Name)} } diff --git a/pkg/commands/commit_list_builder.go b/pkg/commands/commit_list_builder.go index a467b3517..1c22ff711 100644 --- a/pkg/commands/commit_list_builder.go +++ b/pkg/commands/commit_list_builder.go @@ -288,8 +288,8 @@ func (c *CommitListBuilder) getLog(limit bool) string { limitFlag = "-30" } - c.Log.Warn(fmt.Sprintf("git log --oneline %s", limitFlag)) - result, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("git log --oneline %s", limitFlag)) + c.Log.Warn(fmt.Sprintf("git log --oneline %s --abbrev=%d", limitFlag, 20)) + result, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("git log --oneline %s --abbrev=%d", limitFlag, 20)) if err != nil { // assume if there is an error there are no commits yet for this branch return "" -- cgit v1.2.3