fix and maint: match most git supported color settings #453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A patch series to incrementally expand support for git supported color settings.
maint: set ansi colors in common routine
Setting foreground and background colors is now using the same code.
fix: ignore negative color attributes with tests
The colors in the git config may have attributes and negative versions of them (no/no- prefix). The negative versions will no longer cause a false positive checking for the attribute. While not immediately obvious, upcoming support for
default(ul) is also affected.A new test file is specifically for testing the settings of the ansi codes and the possible settings in the git config.
fix: support git config colors normal and default
Normal is a placeholder and will be ignored. Default will generate ansi codes for the default foreground or background color.
Git validates the config so a bright prefix on these values would not be allowed. They are added to the hash to keep the code simple.
fix: support #rgb colors in git config
Git supports diff colors in #rrggbb notation. diff-so-fancy now supports them as well.
Some of the functions and constants in the head of test file
git-config.batscan be moved toutil.bashif that is preferred. They are not specific to that file. They are helpers to allow a more generic specification of the ansi escape codes without actually having to know the specific values.