Merge branch 'jg/status-config'
authorJunio C Hamano <gitster@pobox.com>
Sun, 23 Jun 2013 21:51:58 +0000 (14:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 23 Jun 2013 21:51:59 +0000 (14:51 -0700)
"git status" learned status.branch and status.short configuration
variables to use --branch and --short options by default (override
with --no-branch and --no-short options from the command line).

* jg/status-config:
status: introduce status.branch to enable --branch by default
status: introduce status.short to enable --short by default

1  2 
Documentation/config.txt
builtin/commit.c
diff --combined Documentation/config.txt
index 311fcebaf51034a0788df971749fe80dbc3c8782,ecdcd6dd99f8720375240d28b3c7b2a686b9e06d..8a975a63902379d09532df79b463d021120a88e8
@@@ -919,12 -919,11 +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.
@@@ -1868,14 -1867,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
@@@ -2075,6 -2066,14 +2075,14 @@@ status.relativePaths:
        relative to the repository root (this was the default for Git
        prior to v1.5.4).
  
+ status.short::
+       Set to true to enable --short by default in linkgit:git-status[1].
+       The option --no-short takes precedence over this variable.
+ status.branch::
+       Set to true to enable --branch by default in linkgit:git-status[1].
+       The option --no-branch takes precedence over this variable.
  status.showUntrackedFiles::
        By default, linkgit:git-status[1] and linkgit:git-commit[1] show
        files which are not currently tracked by Git. Directories which
diff --combined builtin/commit.c
index 1621dfcd4008fc5853fc078a32bf9eefb6c52023,d6c8e204ee7eb52f56c3d3123af54d24ac397334..b589ce02ff1d22d349799a8296a93d6bd21e003e
@@@ -107,7 -107,7 +107,7 @@@ static const char *cleanup_arg
  
  static enum commit_whence whence;
  static int use_editor = 1, include_status = 1;
 -static int show_ignored_in_status;
 +static int show_ignored_in_status, have_option_m;
  static const char *only_include_assumed;
  static struct strbuf message = STRBUF_INIT;
  
@@@ -121,11 -121,9 +121,11 @@@ static enum 
  static int opt_parse_m(const struct option *opt, const char *arg, int unset)
  {
        struct strbuf *buf = opt->value;
 -      if (unset)
 +      if (unset) {
 +              have_option_m = 0;
                strbuf_setlen(buf, 0);
 -      else {
 +      } else {
 +              have_option_m = 1;
                if (buf->len)
                        strbuf_addch(buf, '\n');
                strbuf_addstr(buf, arg);
@@@ -977,7 -975,7 +977,7 @@@ static int parse_and_validate_options(i
        if (force_author && renew_authorship)
                die(_("Using both --reset-author and --author does not make sense"));
  
 -      if (logfile || message.len || use_message || fixup_message)
 +      if (logfile || have_option_m || use_message || fixup_message)
                use_editor = 0;
        if (0 <= edit_flag)
                use_editor = edit_flag;
@@@ -1112,6 -1110,17 +1112,17 @@@ static int git_status_config(const cha
                        s->submodule_summary = -1;
                return 0;
        }
+       if (!strcmp(k, "status.short")) {
+               if (git_config_bool(k, v))
+                       status_format = STATUS_FORMAT_SHORT;
+               else
+                       status_format = STATUS_FORMAT_NONE;
+               return 0;
+       }
+       if (!strcmp(k, "status.branch")) {
+               s->show_branch = git_config_bool(k, v);
+               return 0;
+       }
        if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
                s->use_color = git_config_colorbool(k, v);
                return 0;