Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-svn: allow both diff.color and color.diff
author
Junio C Hamano
<junkio@cox.net>
Wed, 13 Dec 2006 23:58:41 +0000
(15:58 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Wed, 13 Dec 2006 23:58:41 +0000
(15:58 -0800)
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. With fixes from Eric Wong.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-svn.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
ad2c82c
)
diff --git
a/git-svn.perl
b/git-svn.perl
index ec92b440b9b3041811b20adc40b843b1ed759e2a..73ab8d873fb33f4447c78b5eab4781e245697c10 100755
(executable)
--- a/
git-svn.perl
+++ b/
git-svn.perl
@@
-925,19
+925,38
@@
sub cmt_showable {
sub log_use_color {
return 1 if $_color;
sub log_use_color {
return 1 if $_color;
- my $dc;
- chomp($dc = `git-repo-config --get diff.color`);
+ my ($dc, $dcvar);
+ $dcvar = 'color.diff';
+ $dc = `git-repo-config --get $dcvar`;
+ if ($dc eq '') {
+ # nothing at all; fallback to "diff.color"
+ $dcvar = 'diff.color';
+ $dc = `git-repo-config --get $dcvar`;
+ }
+ chomp($dc);
if ($dc eq 'auto') {
if ($dc eq 'auto') {
- if (-t *STDOUT || (defined $_pager &&
- `git-repo-config --bool --get pager.color` !~ /^false/)) {
+ my $pc;
+ $pc = `git-repo-config --get color.pager`;
+ if ($pc eq '') {
+ # does not have it -- fallback to pager.color
+ $pc = `git-repo-config --bool --get pager.color`;
+ }
+ else {
+ $pc = `git-repo-config --bool --get color.pager`;
+ if ($?) {
+ $pc = 'false';
+ }
+ }
+ chomp($pc);
+ if (-t *STDOUT || (defined $_pager && $pc eq 'true')) {
return ($ENV{TERM} && $ENV{TERM} ne 'dumb');
}
return 0;
}
return 0 if $dc eq 'never';
return 1 if $dc eq 'always';
return ($ENV{TERM} && $ENV{TERM} ne 'dumb');
}
return 0;
}
return 0 if $dc eq 'never';
return 1 if $dc eq 'always';
- chomp($dc = `git-repo-config --bool --get
diff.colo
r`);
-
$dc eq 'true'
;
+ chomp($dc = `git-repo-config --bool --get
$dcva
r`);
+
return ($dc eq 'true')
;
}
sub git_svn_log_cmd {
}
sub git_svn_log_cmd {