summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-28 15:36:35 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-28 15:36:35 -0400
commit833346392762615aa3ce44ea23f83edc4347f144 (patch)
tree888dd550947525eaf48ea986c2c0968a84cbfde0
parentd98c65a91c9ee651ae87f715f8e610472326bedf (diff)
Make --raw use default git colors for hunk lines
-rw-r--r--src/cli.rs6
-rw-r--r--src/features/diff_highlight.rs6
-rw-r--r--src/features/raw.rs30
3 files changed, 33 insertions, 9 deletions
diff --git a/src/cli.rs b/src/cli.rs
index f513c985..0f482c3e 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -350,9 +350,9 @@ pub struct Opt {
pub line_numbers_right_style: String,
#[structopt(long = "raw")]
- /// Do not alter the input in any way other than applying colors. Equivalent to
- /// `--keep-plus-minus-markers --width variable --tabs 0 --commit-decoration ''
- /// --file-decoration '' --hunk-decoration ''`.
+ /// Do not alter the input in any way. The only exceptions are the coloring of hunk lines:
+ /// minus lines use color.diff.old (with fallback to "red") and plus lines use color.diff.new
+ /// (with fallback to "green").
pub raw: bool,
#[structopt(long = "no-gitconfig")]
diff --git a/src/features/diff_highlight.rs b/src/features/diff_highlight.rs
index 1fba29a1..03e9792f 100644
--- a/src/features/diff_highlight.rs
+++ b/src/features/diff_highlight.rs
@@ -33,12 +33,6 @@ pub fn _make_feature(bold: bool) -> Vec<(String, OptionValueFunction)> {
opt => format!("{} reverse", opt.minus_style)
),
(
- "zero-style",
- String,
- None,
- _opt => "normal"
- ),
- (
"plus-style",
String,
Some("color.diff.new"),
diff --git a/src/features/raw.rs b/src/features/raw.rs
index 424bf23a..7add6b34 100644
--- a/src/features/raw.rs
+++ b/src/features/raw.rs
@@ -39,6 +39,36 @@ pub fn make_feature() -> Vec<(String, OptionValueFunction)> {
_opt => "raw"
),
(
+ "minus-style",
+ String,
+ Some("color.diff.old"),
+ _opt => "red"
+ ),
+ (
+ "minus-emph-style",
+ String,
+ Some("color.diff.old"),
+ _opt => "red"
+ ),
+ (
+ "zero-style",
+ String,
+ None,
+ _opt => "normal"
+ ),
+ (
+ "plus-style",
+ String,
+ Some("color.diff.new"),
+ _opt => "green"
+ ),
+ (
+ "plus-emph-style",
+ String,
+ Some("color.diff.new"),
+ _opt => "green"
+ ),
+ (
"keep-plus-minus-markers",
bool,
None,