Allow subcommand.color and color.subcommand color configuration
While adding colour to the branch command it was pointed out that a config option like "branch.color" conflicts with the pre-existing "branch.something" namespace used for specifying default merge urls and branches. The suggested solution was to flip the order of the components to "color.branch", which I did for colourising branch. This patch does the same thing for - git-log (color.diff) - git-status (color.status) - git-diff (color.diff) - pager (color.pager) I haven't removed the old config options; but they should probably be deprecated and eventually removed to prevent future namespace collisions. I've done this deprecation by changing the documentation for the config file to match the new names; and adding the "color.XXX" options to contrib/completion/git-completion.bash. Unfortunately git-svn reads "diff.color" and "pager.color"; which I don't like to change unilaterally. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
25fb629058
commit
a159ca0cb7
@ -297,11 +297,11 @@ void wt_status_print(struct wt_status *s)
|
||||
|
||||
int git_status_config(const char *k, const char *v)
|
||||
{
|
||||
if (!strcmp(k, "status.color")) {
|
||||
if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
|
||||
wt_status_use_color = git_config_colorbool(k, v);
|
||||
return 0;
|
||||
}
|
||||
if (!strncmp(k, "status.color.", 13)) {
|
||||
if (!strncmp(k, "status.color.", 13) || !strncmp(k, "color.status", 13)) {
|
||||
int slot = parse_status_slot(k, 13);
|
||||
color_parse(v, k, wt_status_colors[slot]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user