You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ability to configure branch color patterns using regex (#4130)
- **PR Description**
Add ability to specify color patterns in the `branchColorPatterns`
config using regex, ex. `JIRA-\d+` would match all branch names in the
form `JIRA-456`.
Example config:
```yaml
gui:
branchColorPatterns:
'docs/.+': 'black' # make all branches prefixed with docs/ have a black color
'feature/collapse-all': 'red' # make a specfic branch name red
'IDEA-\d+': 'blue' # make all branches with the prefix `IDEA-` followed by a digit, blue
```
Copy file name to clipboardExpand all lines: docs/Config.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -832,14 +832,17 @@ gui:
832
832
833
833
## Custom Branch Color
834
834
835
-
You can customize the color of branches based on the branch prefix:
835
+
You can customize the color of branches based on branch patterns (regular expressions):
836
836
837
837
```yaml
838
838
gui:
839
-
branchColors:
840
-
'docs': '#11aaff' # use a light blue for branches beginning with 'docs/'
839
+
branchColorPatterns:
840
+
'^docs/': '#11aaff' # use a light blue for branches beginning with 'docs/'
841
+
'ISSUE-\d+': '#ff5733' # use a bright orange for branches containing 'ISSUE-<some-number>'
841
842
```
842
843
844
+
Note that the regular expressions are not implicitly anchored to the beginning/end of the branch name. If you want to do that, add leading `^` and/or trailing `$` as needed.
Copy file name to clipboardExpand all lines: pkg/i18n/english.go
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2006,6 +2006,8 @@ keybinding:
2006
2006
gui:
2007
2007
filterMode: 'fuzzy'
2008
2008
`,
2009
+
"0.44.0": `- The gui.branchColors config option is deprecated; it will be removed in a future version. Please use gui.branchColorPatterns instead.
2010
+
- The automatic coloring of branches starting with "feature/", "bugfix/", or "hotfix/" has been removed; if you want this, it's easy to set up using the new gui.branchColorPatterns option.`,
Copy file name to clipboardExpand all lines: schema/config.json
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,13 @@
12
12
"description": "See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-author-color"
13
13
},
14
14
"branchColors": {
15
+
"additionalProperties": {
16
+
"type": "string"
17
+
},
18
+
"type": "object",
19
+
"description": "See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color\nDeprecated: use branchColorPatterns instead"
0 commit comments