Re: [PATCH] Allow subcommand.color and color.subcommand color configuration
Junio C Hamano <junkio@cox.net> wrote:
Show 12 quoted lines
> Andy Parkins <andyparkins@gmail.com> writes:
>
> > 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.
> > ...
> > Unfortunately git-svn reads "diff.color" and "pager.color"; which I
> > don't like to change unilaterally.
>
> I think doing the same makes sense. Something like this?
It works great for me after I fixed some syntax errors (patch below).
Show 10 quoted lines
> -- >8 --
> git-svn: allow both diff.color and color.diff
>
> The list concensus is to group color related configuration under
> "color.*" so let's be consistent.
>
> Inspired by Andy Parkins's patch to do the same for diff/log
> family.
>
> Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net> (with the following
fixes of course :)
diff --git a/git-svn.perl b/git-svn.perl
index 2893e3b..73ab8d8 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -926,7 +926,7 @@ sub cmt_showable {
sub log_use_color {
return 1 if $_color;
my ($dc, $dcvar);
- $dcvar = 'color.diff'
+ $dcvar = 'color.diff';
$dc = `git-repo-config --get $dcvar`;
if ($dc eq '') {
# nothing at all; fallback to "diff.color"
@@ -948,7 +948,7 @@ sub log_use_color {
}
}
chomp($pc);
- if (-t *STDOUT || (defined $_pager && $pc eq 'true') {
+ if (-t *STDOUT || (defined $_pager && $pc eq 'true')) {
return ($ENV{TERM} && $ENV{TERM} ne 'dumb');
}
return 0;