From: Junio C Hamano Date: Thu, 26 May 2011 16:41:11 +0000 (-0700) Subject: Merge branch 'mg/diff-uiconfig-doc' into maint X-Git-Tag: v1.7.5.3~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5f8937db39c4eb495a48931172348200a91821a3?ds=inline;hp=-c Merge branch 'mg/diff-uiconfig-doc' into maint * mg/diff-uiconfig-doc: config.txt,diff-options.txt: porcelain vs. plumbing for color.diff --- 5f8937db39c4eb495a48931172348200a91821a3 diff --combined Documentation/config.txt index 0906499e7d,3967b1a473..a9adfa0a70 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -442,6 -442,8 +442,6 @@@ for most projects as source code and ot be delta compressed, but larger binary media files won't be. + Common unit suffixes of 'k', 'm', or 'g' are supported. -+ -Currently only linkgit:git-fast-import[1] honors this setting. core.excludesfile:: In addition to '.gitignore' (per-directory) and @@@ -706,9 -708,16 +706,16 @@@ second is the background. The positio doesn't matter. color.diff:: - When set to `always`, always use colors in patch. - When false (or `never`), never. When set to `true` or `auto`, use - colors only when the output is to the terminal. Defaults to false. + Whether to use ANSI escape sequences to add color to patches. + If this is set to `always`, linkgit:git-diff[1], + linkgit:git-log[1], and linkgit:git-show[1] will use color + for all patches. If it is set to `true` or `auto`, those + commands will only use color when output is to the terminal. + Defaults to false. + + + This does not affect linkgit:git-format-patch[1] nor the + 'git-diff-{asterisk}' plumbing commands. Can be overridden on the + command line with the `--color[=]` option. color.diff.:: Use customized color for diff colorization. `` specifies @@@ -794,11 -803,15 +801,15 @@@ color.status.: color.branch.. color.ui:: - When set to `always`, always use colors in all git commands which - are capable of colored output. When false (or `never`), never. When - set to `true` or `auto`, use colors only when the output is to the - terminal. When more specific variables of color.* are set, they always - take precedence over this setting. Defaults to false. + This variable determines the default value for variables such + as `color.diff` and `color.grep` that control the use of color + per command family. Its scope will expand as more commands learn + configuration to set a default for the `--color` option. Set it + to `always` if you want all output not intended for machine + consumption to use color, to `true` or `auto` if you want such + output to use color when written to the terminal, or to `false` or + `never` if you prefer git commands not to use color unless enabled + explicitly with some other configuration or the `--color` option. commit.status:: A boolean to enable/disable inclusion of status information in the diff --combined Documentation/diff-options.txt index c32105f1ed,c26e494d07..80fd817c28 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@@ -72,10 -72,6 +72,10 @@@ endif::git-format-patch[ a cut-off percent (3% by default) are not shown. The cut-off percent can be set with `--dirstat=`. Changes in a child directory are not counted for the parent directory, unless `--cumulative` is used. ++ +Note that the `--dirstat` option computes the changes while ignoring +the amount of pure code movements within a file. In other words, +rearranging lines in a file is not counted as much as other changes. --dirstat-by-file[=]:: Same as `--dirstat`, but counts changed files instead of lines. @@@ -124,12 -120,19 +124,19 @@@ any of those replacements occurred --color[=]:: Show colored diff. - The value must be always (the default), never, or auto. + The value must be `always` (the default for ``), `never`, or `auto`. + The default value is `never`. + ifdef::git-diff[] + It can be changed by the `color.ui` and `color.diff` + configuration settings. + endif::git-diff[] --no-color:: - Turn off colored diff, even when the configuration file - gives the default to color output. - Same as `--color=never`. + Turn off colored diff. + ifdef::git-diff[] + This can be used to override configuration settings. + endif::git-diff[] + It is the same as `--color=never`. --word-diff[=]:: Show a word diff, using the to delimit changed words. @@@ -243,7 -246,7 +250,7 @@@ ifdef::git-log[ For following files across renames while traversing history, see `--follow`. endif::git-log[] - If `n` is specified, it is a is a threshold on the similarity + If `n` is specified, it is a threshold on the similarity index (i.e. amount of addition/deletions compared to the file's size). For example, `-M90%` means git should consider a delete/add pair to be a rename if more than 90% of the file