summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorpikomonde <32364823+pikomonde@users.noreply.github.com>2024-03-21 02:14:17 +0700
committerStefan Haller <stefan@haller-berlin.de>2024-04-12 08:33:47 +0200
commit170c4ecb8cca77be883f6eebcb46a7631f82ff65 (patch)
tree8d54ddc8ccb83eebfa35c4808e8224ea9e4d4864 /pkg/gui/presentation
parentde1c4957040c8f6176f05cc8c7b7e79b588071e0 (diff)
rename sha to hash 9, case: Sha
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/commits.go30
-rw-r--r--pkg/gui/presentation/reflog_commits.go6
2 files changed, 18 insertions, 18 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 357146126..1fc2c7d91 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -312,7 +312,7 @@ func displayCommit(
bisectInfo *git_commands.BisectInfo,
isYouAreHereCommit bool,
) []string {
- shaColor := getShaColor(commit, diffName, cherryPickedCommitHashSet, bisectStatus, bisectInfo)
+ hashColor := getHashColor(commit, diffName, cherryPickedCommitHashSet, bisectStatus, bisectInfo)
bisectString := getBisectStatusText(bisectStatus, bisectInfo)
actionString := ""
@@ -369,11 +369,11 @@ func displayCommit(
cols := make([]string, 0, 7)
if commit.Divergence != models.DivergenceNone {
- cols = append(cols, shaColor.Sprint(lo.Ternary(commit.Divergence == models.DivergenceLeft, "↑", "↓")))
+ cols = append(cols, hashColor.Sprint(lo.Ternary(commit.Divergence == models.DivergenceLeft, "↑", "↓")))
} else if icons.IsIconEnabled() {
- cols = append(cols, shaColor.Sprint(icons.IconForCommit(commit)))
+ cols = append(cols, hashColor.Sprint(icons.IconForCommit(commit)))
}
- cols = append(cols, shaColor.Sprint(commit.ShortHash()))
+ cols = append(cols, hashColor.Sprint(commit.ShortHash()))
cols = append(cols, bisectString)
if fullDescription {
cols = append(cols, style.FgBlue.Sprint(
@@ -410,7 +410,7 @@ func getBisectStatusColor(status BisectStatus) style.TextStyle {
return style.FgWhite
}
-func getShaColor(
+func getHashColor(
commit *models.Commit,
diffName string,
cherryPickedCommitHashSet *set.Set[string],
@@ -422,30 +422,30 @@ func getShaColor(
}
diffed := commit.Hash != "" && commit.Hash == diffName
- shaColor := theme.DefaultTextColor
+ hashColor := theme.DefaultTextColor
switch commit.Status {
case models.StatusUnpushed:
- shaColor = style.FgRed
+ hashColor = style.FgRed
case models.StatusPushed:
- shaColor = style.FgYellow
+ hashColor = style.FgYellow
case models.StatusMerged:
- shaColor = style.FgGreen
+ hashColor = style.FgGreen
case models.StatusRebasing:
- shaColor = style.FgBlue
+ hashColor = style.FgBlue
case models.StatusReflog:
- shaColor = style.FgBlue
+ hashColor = style.FgBlue
default:
}
if diffed {
- shaColor = theme.DiffTerminalColor
+ hashColor = theme.DiffTerminalColor
} else if cherryPickedCommitHashSet.Includes(commit.Hash) {
- shaColor = theme.CherryPickedCommitTextStyle
+ hashColor = theme.CherryPickedCommitTextStyle
} else if commit.Divergence == models.DivergenceRight && commit.Status != models.StatusMerged {
- shaColor = style.FgBlue
+ hashColor = style.FgBlue
}
- return shaColor
+ return hashColor
}
func actionColorMap(action todo.TodoCommand) style.TextStyle {
diff --git a/pkg/gui/presentation/reflog_commits.go b/pkg/gui/presentation/reflog_commits.go
index 243fea1a3..b40f33b23 100644
--- a/pkg/gui/presentation/reflog_commits.go
+++ b/pkg/gui/presentation/reflog_commits.go
@@ -35,7 +35,7 @@ func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription
})
}
-func reflogShaColor(cherryPicked, diffed bool) style.TextStyle {
+func reflogHashColor(cherryPicked, diffed bool) style.TextStyle {
if diffed {
return theme.DiffTerminalColor
}
@@ -64,7 +64,7 @@ func getFullDescriptionDisplayStringsForReflogCommit(c *models.Commit, attrs ref
}
return []string{
- reflogShaColor(attrs.cherryPicked, attrs.diffed).Sprint(c.ShortHash()),
+ reflogHashColor(attrs.cherryPicked, attrs.diffed).Sprint(c.ShortHash()),
style.FgMagenta.Sprint(utils.UnixToDateSmart(attrs.now, c.UnixTimestamp, attrs.timeFormat, attrs.shortTimeFormat)),
theme.DefaultTextColor.Sprint(name),
}
@@ -77,7 +77,7 @@ func getDisplayStringsForReflogCommit(c *models.Commit, attrs reflogCommitDispla
}
return []string{
- reflogShaColor(attrs.cherryPicked, attrs.diffed).Sprint(c.ShortHash()),
+ reflogHashColor(attrs.cherryPicked, attrs.diffed).Sprint(c.ShortHash()),
theme.DefaultTextColor.Sprint(name),
}
}