Merge branch 'mg/diff-uiconfig-doc'
authorJunio C Hamano <gitster@pobox.com>
Fri, 6 May 2011 17:49:53 +0000 (10:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 May 2011 17:49:53 +0000 (10:49 -0700)
* mg/diff-uiconfig-doc:
config.txt,diff-options.txt: porcelain vs. plumbing for color.diff

1  2 
Documentation/config.txt
Documentation/diff-options.txt
diff --combined Documentation/config.txt
index 480dd0a8617ced1f7bf24cda0bf23b7fc2c6c4f3,3967b1a4735158980cb4aa875bfa3fcddc142cf5..0c0f54c30e4db1db326aa468bbef90a379f478ad
@@@ -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
@@@ -641,7 -643,7 +641,7 @@@ branch.<name>.remote:
  
  branch.<name>.merge::
        Defines, together with branch.<name>.remote, the upstream branch
 -      for the given branch. It tells 'git fetch'/'git pull' which
 +      for the given branch. It tells 'git fetch'/'git pull'/'git rebase' which
        branch to merge and can also affect 'git push' (see push.default).
        When in branch <name>, it tells 'git fetch' the default
        refspec to be marked for merging in FETCH_HEAD. The value is
@@@ -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[=<when>]` option.
  
  color.diff.<slot>::
        Use customized color for diff colorization.  `<slot>` specifies
@@@ -794,11 -803,15 +801,15 @@@ color.status.<slot>:
        color.branch.<slot>.
  
  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
@@@ -810,7 -823,68 +821,7 @@@ commit.template:
        "{tilde}/" is expanded to the value of `$HOME` and "{tilde}user/" to the
        specified user's home directory.
  
 -diff.autorefreshindex::
 -      When using 'git diff' to compare with work tree
 -      files, do not consider stat-only change as changed.
 -      Instead, silently run `git update-index --refresh` to
 -      update the cached stat information for paths whose
 -      contents in the work tree match the contents in the
 -      index.  This option defaults to true.  Note that this
 -      affects only 'git diff' Porcelain, and not lower level
 -      'diff' commands such as 'git diff-files'.
 -
 -diff.external::
 -      If this config variable is set, diff generation is not
 -      performed using the internal diff machinery, but using the
 -      given command.  Can be overridden with the `GIT_EXTERNAL_DIFF'
 -      environment variable.  The command is called with parameters
 -      as described under "git Diffs" in linkgit:git[1].  Note: if
 -      you want to use an external diff program only on a subset of
 -      your files, you might want to use linkgit:gitattributes[5] instead.
 -
 -diff.mnemonicprefix::
 -      If set, 'git diff' uses a prefix pair that is different from the
 -      standard "a/" and "b/" depending on what is being compared.  When
 -      this configuration is in effect, reverse diff output also swaps
 -      the order of the prefixes:
 -`git diff`;;
 -      compares the (i)ndex and the (w)ork tree;
 -`git diff HEAD`;;
 -       compares a (c)ommit and the (w)ork tree;
 -`git diff --cached`;;
 -      compares a (c)ommit and the (i)ndex;
 -`git diff HEAD:file1 file2`;;
 -      compares an (o)bject and a (w)ork tree entity;
 -`git diff --no-index a b`;;
 -      compares two non-git things (1) and (2).
 -
 -diff.noprefix::
 -      If set, 'git diff' does not show any source or destination prefix.
 -
 -diff.renameLimit::
 -      The number of files to consider when performing the copy/rename
 -      detection; equivalent to the 'git diff' option '-l'.
 -
 -diff.renames::
 -      Tells git to detect renames.  If set to any boolean value, it
 -      will enable basic rename detection.  If set to "copies" or
 -      "copy", it will detect copies, as well.
 -
 -diff.ignoreSubmodules::
 -      Sets the default value of --ignore-submodules. Note that this
 -      affects only 'git diff' Porcelain, and not lower level 'diff'
 -      commands such as 'git diff-files'. 'git checkout' also honors
 -      this setting when reporting uncommitted changes.
 -
 -diff.suppressBlankEmpty::
 -      A boolean to inhibit the standard behavior of printing a space
 -      before each empty output line. Defaults to false.
 -
 -diff.tool::
 -      Controls which diff tool is used.  `diff.tool` overrides
 -      `merge.tool` when used by linkgit:git-difftool[1] and has
 -      the same valid values as `merge.tool` minus "tortoisemerge"
 -      and plus "kompare".
 +include::diff-config.txt[]
  
  difftool.<tool>.path::
        Override the path for the given tool.  This is useful in case
@@@ -914,16 -988,6 +925,16 @@@ format.signoff:
      the rights to submit this work under the same open source license.
      Please see the 'SubmittingPatches' document for further discussion.
  
 +filter.<driver>.clean::
 +      The command which is used to convert the content of a worktree
 +      file to a blob upon checkin.  See linkgit:gitattributes[5] for
 +      details.
 +
 +filter.<driver>.smudge::
 +      The command which is used to convert the content of a blob
 +      object to a worktree file upon checkout.  See
 +      linkgit:gitattributes[5] for details.
 +
  gc.aggressiveWindow::
        The window size parameter used in the delta compression
        algorithm used by 'git gc --aggressive'.  This defaults
index 23b605f9dba22c8c05f8b70abf952e981b57cd58,c26e494d07bdee78c4017c122e651b7c6bfc39bc..9ca565d7087109e1bba4c93b30d831f0b0883f22
@@@ -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=<limit>`. 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[=<limit>]::
        Same as `--dirstat`, but counts changed files instead of lines.
@@@ -124,12 -120,19 +124,19 @@@ any of those replacements occurred
  
  --color[=<when>]::
        Show colored diff.
-       The value must be always (the default), never, or auto.
+       The value must be `always` (the default for `<when>`), `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[=<mode>]::
        Show a word diff, using the <mode> 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
        projects, so use it with caution.  Giving more than one
        `-C` option has the same effect.
  
 +-D::
 +--irreversible-delete::
 +      Omit the preimage for deletes, i.e. print only the header but not
 +      the diff between the preimage and `/dev/null`. The resulting patch
 +      is not meant to be applied with `patch` nor `git apply`; this is
 +      solely for people who want to just concentrate on reviewing the
 +      text after the change. In addition, the output obviously lack
 +      enough information to apply such a patch in reverse, even manually,
 +      hence the name of the option.
 ++
 +When used together with `-B`, omit also the preimage in the deletion part
 +of a delete/create pair.
 +
  -l<num>::
        The `-M` and `-C` options require O(n^2) processing time where n
        is the number of potential rename/copy targets.  This