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
OS Version: Microsoft Windows [Version 10.0.16299.431]
Description
branch names are displayed in mangled form with missing associated commits when git config contains "color.branch=always".
Steps to Reproduce
enable branch colors on shell command line:
git config --global color.branch always
branch names displayed within the "Branches" section of the Gitlens explorer will contain color escape codes, eg, "[32mmaster[m", and will not show any contained commits.
Fix
Using the git global option "-c color.branch=never" will definitively disable color for the git branch command, fixing both issues.
Addressing possible concerns of generality... by researching the git online documentation and Wikipedia, the "-c ..." option appears to have been introduced somewhere between the 1.7.0 - 1.7.12.4 versions (being released in the Feb-2010 to Oct-2012 time frame).
- add "-c color.branch=never" option to git branch commands, definitively disabling color branch output
.# Discussion
Branch names are mis-parsed if `git branch` output is colored (eg, when git is configured
with "config.branch=always"). Using the base "-c color.branch=never" option overrides any
user configuration, displaying git branch output as uncolored in all cases and fixing the
issue.
Notably, option ordering is important in this instance. The "-c ..." option is a git
base option, not a git branch subcommand option. So, as done here, it must be inserted
before the "branch" subcommand.
ref: Issue gitkraken#415
Description
branch names are displayed in mangled form with missing associated commits when git config contains "color.branch=always".
Steps to Reproduce
enable branch colors on shell command line:
branch names displayed within the "Branches" section of the Gitlens explorer will contain color escape codes, eg, "[32mmaster[m", and will not show any contained commits.
Fix
Using the git global option "-c color.branch=never" will definitively disable color for the
git branch
command, fixing both issues.Addressing possible concerns of generality... by researching the
git
online documentation and Wikipedia, the "-c ..." option appears to have been introduced somewhere between the 1.7.0 - 1.7.12.4 versions (being released in the Feb-2010 to Oct-2012 time frame).ref: https://en.wikipedia.org/wiki/Git#Releases
ref: https://git-scm.com/docs/git/1.7.0
ref: https://git-scm.com/docs/git/1.7.12.4
PR #416 contains a fix.
Note: the fix has only been tested on my machine.
The text was updated successfully, but these errors were encountered: