From: Junio C Hamano Date: Sun, 23 Jun 2013 21:51:58 +0000 (-0700) Subject: Merge branch 'jg/status-config' X-Git-Tag: v1.8.4-rc0~151 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1a22bd31f0a5130ce6c934951a5526ceb774c2be?ds=inline;hp=-c Merge branch 'jg/status-config' "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 --- 1a22bd31f0a5130ce6c934951a5526ceb774c2be diff --combined Documentation/config.txt index 311fcebaf5,ecdcd6dd99..8a975a6390 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -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 1621dfcd40,d6c8e204ee..b589ce02ff --- a/builtin/commit.c +++ b/builtin/commit.c @@@ -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;