summaryrefslogtreecommitdiff
path: root/Documentation/diff-options.txt
diff options
context:
space:
mode:
authorMark Lodato <lodatom@gmail.com>2010-02-17 04:55:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-19 01:21:40 (GMT)
commit73e9da019655261e456ed862340880de365111f0 (patch)
tree3668881735169164f975f4db0983241cf3d631ba /Documentation/diff-options.txt
parente923eaeb901ff056421b9007adcbbce271caa7b6 (diff)
downloadgit-73e9da019655261e456ed862340880de365111f0.zip
git-73e9da019655261e456ed862340880de365111f0.tar.gz
git-73e9da019655261e456ed862340880de365111f0.tar.bz2
Add an optional argument for --color options
Make git-branch, git-show-branch, git-grep, and all the diff-based programs accept an optional argument <when> for --color. The argument is a colorbool: "always", "never", or "auto". If no argument is given, "always" is used; --no-color is an alias for --color=never. This makes the command-line interface consistent with other GNU tools, such as `ls' and `grep', and with the git-config color options. Note that, without an argument, --color and --no-color work exactly as before. To implement this, two internal changes were made: 1. Allow the first argument of git_config_colorbool() to be NULL, in which case it returns -1 if the argument isn't "always", "never", or "auto". 2. Add OPT_COLOR_FLAG(), OPT__COLOR(), and parse_opt_color_flag_cb() to the option parsing library. The callback uses git_config_colorbool(), so color.h is now a dependency of parse-options.c. Signed-off-by: Mark Lodato <lodatom@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/diff-options.txt')
-rw-r--r--Documentation/diff-options.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 8707d0e..60e922e 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -117,12 +117,14 @@ any of those replacements occurred.
option and lists the commits in that commit range like the 'summary'
option of linkgit:git-submodule[1] does.
---color::
+--color[=<when>]::
Show colored diff.
+ The value must be always (the default), never, or auto.
--no-color::
Turn off colored diff, even when the configuration file
gives the default to color output.
+ Same as `--color=never`.
--color-words[=<regex>]::
Show colored word diff, i.e., color words which have changed.