-
Notifications
You must be signed in to change notification settings - Fork 335
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
Remove dependence on git config --get-color
(implement Git coloring internally)
#278
Comments
@peff could you provide a starting point on the Git side about where this information is stored? Or a list of what strings Git accepts? |
The interesting entry point is https://github.com/gitster/git/blob/4a4ac8367882698ac607169f65964c344f74d14c/color.c#L202, which in turn relies on I do still think you'd be better served by a |
Can you elaborate on |
I mean that ideally you could do something like:
and get output something like:
all with a single invocation of |
At startup diff-so-fancy shells out to I ran d-s-f five times with the parsing code in place and got an average of 81 ms to show a simple diff. Then I hardcoded All tests were run with a simple:
|
@peff did |
@scottchiefbaker Sorry, no, nobody ever implemented it (I still think it's a good idea). One hack somebody proposed recently upstream (for |
This was addressed in the v1.4.1 release. |
Right now d-s-f shells out to Git 5+ times to get color configuration information. This is needed to translate Git color strings into ANSI escape sequence. This process slows down startup time.
Ideally we can read the entire Git config once with
git config --list
and process the entries one by one. We'll need a list of the Git supported strings and what ANSI codes they should map too.Example strings: "red bold", "green bold 22", "red reverse", "yellow"
The text was updated successfully, but these errors were encountered: