Merge branch 'mm/color-auto-default'
authorJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2013 23:02:33 +0000 (16:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2013 23:02:33 +0000 (16:02 -0700)
Flip the default for color.ui to 'auto', which is what many
tutorials recommend new users to do.

* mm/color-auto-default:
make color.ui default to 'auto'
config: refactor management of color.ui's default value

1  2 
Documentation/config.txt
builtin/config.c
diff --combined Documentation/config.txt
index 7fd4035cb52dfb746fad496fd27347f538c31006,6570aeea2a060d3fe344113f22f7cc7fb496d3be..311fcebaf51034a0788df971749fe80dbc3c8782
@@@ -727,22 -727,9 +727,22 @@@ branch.autosetuprebase:
        This option defaults to never.
  
  branch.<name>.remote::
 -      When in branch <name>, it tells 'git fetch' and 'git push' which
 -      remote to fetch from/push to.  It defaults to `origin` if no remote is
 -      configured. `origin` is also used if you are not on any branch.
 +      When on branch <name>, it tells 'git fetch' and 'git push'
 +      which remote to fetch from/push to.  The remote to push to
 +      may be overridden with `remote.pushdefault` (for all branches).
 +      The remote to push to, for the current branch, may be further
 +      overridden by `branch.<name>.pushremote`.  If no remote is
 +      configured, or if you are not on any branch, it defaults to
 +      `origin` for fetching and `remote.pushdefault` for pushing.
 +
 +branch.<name>.pushremote::
 +      When on branch <name>, it overrides `branch.<name>.remote` for
 +      pushing.  It also overrides `remote.pushdefault` for pushing
 +      from branch <name>.  When you pull from one place (e.g. your
 +      upstream) and push to another place (e.g. your own publishing
 +      repository), you would want to set `remote.pushdefault` to
 +      specify the remote to push to for all branches, and use this
 +      option to override it for a specific branch.
  
  branch.<name>.merge::
        Defines, together with branch.<name>.remote, the upstream branch
@@@ -807,8 -794,7 +807,8 @@@ color.branch:
  color.branch.<slot>::
        Use customized color for branch coloration. `<slot>` is one of
        `current` (the current branch), `local` (a local branch),
 -      `remote` (a remote-tracking branch in refs/remotes/), `plain` (other
 +      `remote` (a remote-tracking branch in refs/remotes/),
 +      `upstream` (upstream tracking branch), `plain` (other
        refs).
  +
  The value for these configuration variables is a list of colors (at most
@@@ -919,11 -905,12 +919,12 @@@ color.ui:
        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.
+       to `false` or `never` if you prefer Git commands not to use
+       color unless enabled explicitly with some other configuration
+       or the `--color` option. Set it to `always` if you want all
+       output not intended for machine consumption to use color, to
+       `true` or `auto` (this is the default since Git 1.8.4) if you
+       want such output to use color when written to the terminal.
  
  column.ui::
        Specify whether supported commands should output in columns.
@@@ -1110,11 -1097,6 +1111,11 @@@ format.signoff:
        the rights to submit this work under the same open source license.
        Please see the 'SubmittingPatches' document for further discussion.
  
 +format.coverLetter::
 +      A boolean that controls whether to generate a cover-letter when
 +      format-patch is invoked, but in addition can be set to "auto", to
 +      generate a cover-letter only when there's more than one patch.
 +
  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
@@@ -1466,14 -1448,6 +1467,14 @@@ http.sslCAPath:
        with when fetching or pushing over HTTPS. Can be overridden
        by the 'GIT_SSL_CAPATH' environment variable.
  
 +http.sslTry::
 +      Attempt to use AUTH SSL/TLS and encrypted data transfers
 +      when connecting via regular FTP protocol. This might be needed
 +      if the FTP server requires it for security reasons or you wish
 +      to connect securely whenever remote FTP server supports it.
 +      Default is false since it might trigger certificate verification
 +      errors on misconfigured servers.
 +
  http.maxRequests::
        How many HTTP requests to launch in parallel. Can be overridden
        by the 'GIT_HTTP_MAX_REQUESTS' environment variable. Default is 5.
@@@ -1867,14 -1841,6 +1868,14 @@@ rebase.stat:
  rebase.autosquash::
        If set to true enable '--autosquash' option by default.
  
 +rebase.autostash::
 +      When set to true, automatically create a temporary stash
 +      before the operation begins, and apply it after the operation
 +      ends.  This means that you can run rebase on a dirty worktree.
 +      However, use with care: the final stash application after a
 +      successful rebase might result in non-trivial conflicts.
 +      Defaults to false.
 +
  receive.autogc::
        By default, git-receive-pack will run "git-gc --auto" after
        receiving data from git-push and updating refs.  You can stop
@@@ -1933,11 -1899,6 +1934,11 @@@ receive.updateserverinfo:
        If set to true, git-receive-pack will run git-update-server-info
        after receiving data from git-push and updating refs.
  
 +remote.pushdefault::
 +      The remote to push to by default.  Overrides
 +      `branch.<name>.remote` for all branches, and is overridden by
 +      `branch.<name>.pushremote` for specific branches.
 +
  remote.<name>.url::
        The URL of a remote repository.  See linkgit:git-fetch[1] or
        linkgit:git-push[1].
@@@ -2038,7 -1999,6 +2039,7 @@@ sendemail.<identity>.*:
  
  sendemail.aliasesfile::
  sendemail.aliasfiletype::
 +sendemail.annotate::
  sendemail.bcc::
  sendemail.cc::
  sendemail.cccmd::
@@@ -2164,13 -2124,7 +2165,13 @@@ uploadpack.hiderefs:
        are under the hierarchies listed on the value of this
        variable is excluded, and is hidden from `git ls-remote`,
        `git fetch`, etc.  An attempt to fetch a hidden ref by `git
 -      fetch` will fail.
 +      fetch` will fail.  See also `uploadpack.allowtipsha1inwant`.
 +
 +uploadpack.allowtipsha1inwant::
 +      When `uploadpack.hiderefs` is in effect, allow `upload-pack`
 +      to accept a fetch request that asks for an object at the tip
 +      of a hidden ref (by default, such a request is rejected).
 +      see also `uploadpack.hiderefs`.
  
  url.<base>.insteadOf::
        Any URL that starts with this value will be rewritten to
diff --combined builtin/config.c
index 19ffcaf18776e8b100ee3f57c7ca7447436c5476,753449fe5c0382d07dc7b80603dcfd235c34982a..7759671eb8d44ad341831eeffc96c4469d0652e8
@@@ -329,6 -329,7 +329,7 @@@ static int get_colorbool(int print
  {
        get_colorbool_found = -1;
        get_diff_color_found = -1;
+       get_color_ui_found = -1;
        git_config_with_options(git_get_colorbool_config, NULL,
                                given_config_file, respect_includes);
  
                        get_colorbool_found = get_color_ui_found;
        }
  
+       if (get_colorbool_found < 0)
+               /* default value if none found in config */
+               get_colorbool_found = GIT_COLOR_AUTO;
        get_colorbool_found = want_color(get_colorbool_found);
  
        if (print) {
@@@ -379,8 -384,8 +384,8 @@@ int cmd_config(int argc, const char **a
                         */
                        die("$HOME not set");
  
 -              if (access_or_warn(user_config, R_OK) &&
 -                  xdg_config && !access_or_warn(xdg_config, R_OK))
 +              if (access_or_warn(user_config, R_OK, 0) &&
 +                  xdg_config && !access_or_warn(xdg_config, R_OK, 0))
                        given_config_file = xdg_config;
                else
                        given_config_file = user_config;