-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch names get mangled by color escapes #415
Comments
rivy
added a commit
to rivy/vscode-gitlens
that referenced
this issue
Jun 14, 2018
rivy
added a commit
to rivy/vscode-gitlens
that referenced
this issue
Jun 14, 2018
- 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
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: