refactor(git): add upstream icons

This commit is contained in:
Jan De Dobbeleer 2021-11-08 22:56:40 +01:00 committed by Jan De Dobbeleer
parent 793ac2cd97
commit bf16671587
34 changed files with 80 additions and 77 deletions

View file

@ -42,7 +42,7 @@ You need to extend or create a custom theme with your tooltips. For example:
"trailing_diamond": "",
"properties": {
"fetch_status": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}"
}
}

View file

@ -45,7 +45,8 @@ An alternative is to use the [Posh-Git segment][poshgit]
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"display_upstream_icon": true
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
}
```
@ -63,6 +64,7 @@ You can set the following properties to `true` to enable fetching additional inf
- fetch_status: `boolean` - fetch the local changes - defaults to `false`
- fetch_stash_count: `boolean` fetch stash count - defaults to `false`
- fetch_worktree_count: `boolean` fetch worktree count - defaults to `false`
- fetch_upstream_icon: `boolean` - fetch upstream icon - defaults to `false`
### Icons
@ -87,7 +89,6 @@ You can set the following properties to `true` to enable fetching additional inf
#### Upstream
- display_upstream_icon: `boolean` - fetch upstream icon - defaults to `false`
- github_icon: `string` - icon/text to display when the upstream is Github - defaults to `\uF408 `
- gitlab_icon: `string` - icon/text to display when the upstream is Gitlab - defaults to `\uF296 `
- bitbucket_icon: `string` - icon/text to display when the upstream is Bitbucket - defaults to `\uF171 `

View file

@ -199,8 +199,8 @@ func getDefaultConfig(info string) *Config {
Background: "#fffb38",
Foreground: "#193549",
Properties: map[Property]interface{}{
DisplayStashCount: true,
DisplayUpstreamIcon: true,
FetchStashCount: true,
FetchUpstreamIcon: true,
},
},
{

View file

@ -87,15 +87,15 @@ type git struct {
}
const (
// FetchStatus shows the status of the repository
// FetchStatus fetches the status of the repository
FetchStatus Property = "fetch_status"
// FetchStashCount show stash count or not
// FetchStashCount fetches the stash count
FetchStashCount Property = "fetch_stash_count"
// FetchWorktreeCount show worktree count or not
// FetchWorktreeCount fetches the worktree count
FetchWorktreeCount Property = "fetch_worktree_count"
// FetchUpstreamIcon fetches the upstream icon
FetchUpstreamIcon Property = "fetch_upstream_icon"
// DisplayUpstreamIcon show or hide the upstream icon
DisplayUpstreamIcon Property = "display_upstream_icon"
// BranchMaxLength truncates the length of the branch name
BranchMaxLength Property = "branch_max_length"
// BranchIcon the icon to use as branch indicator
@ -187,20 +187,20 @@ func (g *git) shouldIgnoreRootRepository(rootDir string) bool {
func (g *git) string() string {
statusColorsEnabled := g.props.getBool(StatusColorsEnabled, false)
displayStatus := g.getBool(FetchStatus, DisplayStatus, false)
displayStatus := g.getBool(FetchStatus, DisplayStatus)
if !displayStatus {
g.Repo.HEAD = g.getPrettyHEADName()
}
if displayStatus || statusColorsEnabled {
g.setGitStatus()
}
if g.Repo.Upstream != "" && g.props.getBool(DisplayUpstreamIcon, false) {
if g.Repo.Upstream != "" && g.getBool(FetchUpstreamIcon, DisplayUpstreamIcon) {
g.Repo.UpstreamIcon = g.getUpstreamIcon()
}
if g.getBool(FetchStashCount, DisplayStashCount, false) {
if g.getBool(FetchStashCount, DisplayStashCount) {
g.Repo.StashCount = g.getStashContext()
}
if g.getBool(FetchWorktreeCount, DisplayWorktreeCount, false) {
if g.getBool(FetchWorktreeCount, DisplayWorktreeCount) {
g.Repo.WorktreeCount = g.getWorktreeContext()
}
// use template if available

View file

@ -7,14 +7,14 @@ import (
)
const (
// DisplayBranchStatus show branch status or not
DisplayBranchStatus Property = "display_branch_status"
// DisplayStatus shows the status of the repository
DisplayStatus Property = "display_status"
// DisplayStashCount show stash count or not
DisplayStashCount Property = "display_stash_count"
// DisplayWorktreeCount show worktree count or not
DisplayWorktreeCount Property = "display_worktree_count"
// DisplayUpstreamIcon show or hide the upstream icon
DisplayUpstreamIcon Property = "display_upstream_icon"
// LocalWorkingIcon the icon to use as the local working area changes indicator
LocalWorkingIcon Property = "local_working_icon"
@ -44,12 +44,12 @@ const (
StatusSeparatorIcon Property = "status_separator_icon"
)
func (g *git) getBool(property, legacyProperty Property, defaultValue bool) bool {
func (g *git) getBool(property, legacyProperty Property) bool {
_, found := g.props.values[legacyProperty]
if found {
return g.props.getBool(legacyProperty, defaultValue)
return g.props.getBool(legacyProperty, false)
}
return g.props.getBool(property, defaultValue)
return g.props.getBool(property, false)
}
func (g *git) renderDeprecatedString(statusColorsEnabled bool) string {
@ -63,7 +63,7 @@ func (g *git) renderDeprecatedString(statusColorsEnabled bool) string {
}
// branchName
fmt.Fprintf(buffer, "%s", g.Repo.HEAD)
if g.props.getBool(DisplayBranchStatus, false) {
if len(g.Repo.BranchStatus) > 0 {
buffer.WriteString(g.Repo.BranchStatus)
}
if g.Repo.Staging.Changed {

View file

@ -36,10 +36,10 @@
"background": "#FCA17D",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"branch_icon": "",
"fetch_status": false,
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}",
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}",
"prefix": " \u279C (",
"postfix": ") "
}

View file

@ -32,9 +32,9 @@
"foreground": "#14A5AE",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": "",
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
}
]

View file

@ -58,8 +58,8 @@
"background": "#a2c4e0",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -28,8 +28,9 @@
"foreground": "#ffffff",
"background": "#de076f",
"properties": {
"display_upstream_icon": true,
"branch_icon": ""
"fetch_upstream_icon": true,
"branch_icon": "",
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}"
}
},
{

View file

@ -62,8 +62,8 @@
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}",
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}",
"prefix": ""
}
},

View file

@ -49,8 +49,8 @@
"background": "#fffb38",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -65,9 +65,9 @@
"{{ if .Repo.Behind gt 0 }}#f17c37{{ end }}"
],
"properties": {
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"fetch_status": true,
"template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}"
}
}
]

View file

@ -36,7 +36,7 @@
"foreground": "#193549",
"background": "#fffb38",
"background_templates": [
"{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ff8c00{{ end }}",
"{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (.Repo.Ahead gt 0) (.Repo.Behind gt 0) }}#ff4500{{ end }}",
"{{ if .Repo.Ahead gt 0 }}#B388FF{{ end }}",
"{{ if .Repo.Behind gt 0 }}#B388FF{{ end }}"
@ -46,8 +46,9 @@
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"fetch_upstream_icon": true,
"branch_max_length": 25,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -58,9 +58,9 @@
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": " ",
"template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
},
"style": "powerline",
"type": "git"

View file

@ -126,10 +126,10 @@
],
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"fetch_status": true,
"prefix": "<#000000>\ue0b1 </>",
"template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}"
}
},
{

View file

@ -78,8 +78,8 @@
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -32,8 +32,8 @@
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
},
"style": "powerline",
"type": "git"

View file

@ -66,9 +66,9 @@
"background": "#242424",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": "",
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -79,8 +79,8 @@
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -37,9 +37,9 @@
"properties": {
"fetch_stash_count": true,
"fetch_status": false,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"branch_icon": "",
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}",
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}",
"prefix": " \u279C (",
"postfix": ") "
}

View file

@ -60,8 +60,8 @@
"properties": {
"branch_icon": "\ue725 ",
"fetch_status": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#ef5350> \uF046 {{ .Repo.Staging.String }}</>{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#ef5350> \uF046 {{ .Repo.Staging.String }}</>{{ end }}"
}
},
{

View file

@ -44,11 +44,11 @@
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": " on ",
"postfix": "",
"github_icon": " ",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<red> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<yellow> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<red> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<yellow> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -127,9 +127,9 @@
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": "<#ffea00>\ue0b1 </>",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -42,8 +42,8 @@
"background": "#fffb38",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -40,8 +40,8 @@
"branch_icon": "\uF126 ",
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
}
]

View file

@ -43,13 +43,13 @@
"prefix": "",
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"branch_icon": "",
"github_icon": "",
"branch_ahead_icon": "<#88C0D0>\u21e1 </>",
"branch_behind_icon": "<#88C0D0>\u21e3 </>",
"local_working_icon": "<#FFAFD7>\u002a</>",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
}
]

View file

@ -56,10 +56,10 @@
"fetch_status": true,
"fetch_stash_count": false,
"branch_max_length": 30,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": "[ ",
"postfix": " ]",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -46,10 +46,10 @@
"properties": {
"fetch_status": true,
"branch_max_length": 30,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": " [",
"postfix": "] ",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#BD6200> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#053F22> \uF046 {{ .Repo.Staging.String }}</>{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#BD6200> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#053F22> \uF046 {{ .Repo.Staging.String }}</>{{ end }}"
}
},
{

View file

@ -611,7 +611,7 @@
"description": "Icon/text to display when there are no commits in the repo",
"default": "\uF594"
},
"display_upstream_icon": {
"fetch_upstream_icon": {
"type": "boolean",
"title": "Display Upstream Icon",
"description": "Display upstream icon or not",

View file

@ -86,9 +86,9 @@
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": "<#7a7a7a>\ue0b1 </>",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -84,9 +84,9 @@
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"display_upstream_icon": true,
"fetch_upstream_icon": true,
"prefix": "<#7a7a7a>\ue0b1 </>",
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}</>{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}</>{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -24,8 +24,8 @@
"powerline_symbol": "\uE0B0",
"properties": {
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
},
"style": "powerline",
"type": "git"

View file

@ -49,8 +49,8 @@
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"display_upstream_icon": true,
"template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
"fetch_upstream_icon": true,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}"
}
},
{

View file

@ -37,8 +37,8 @@
"properties": {
"prefix": "HEAD:",
"branch_icon": "",
"display_upstream_icon": false,
"template": "{{ .Repo.HEAD }}"
"fetch_upstream_icon": false,
"template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}"
}
},
{