From: Thomas Adam <thomas@xteddy.org>
To: git@vger.kernel.org
Cc: Thomas Adam <thomas@xteddy.org>
Subject: [RFC PATCH 1/1] status: Allow for short-form via config option
Date: Sun, 11 Nov 2012 22:53:03 +0000 [thread overview]
Message-ID: <1352674383-23654-2-git-send-email-thomas@xteddy.org> (raw)
In-Reply-To: <1352674383-23654-1-git-send-email-thomas@xteddy.org>
It is currently not possible to use the short-form output of git status
without declaring an alias to do so.
This isn't always desirable therfore, define a git config option which can
be set to display the short-form: status.shortwithbranch
Signed-off-by: Thomas Adam <thomas@xteddy.org>
---
builtin/commit.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/builtin/commit.c b/builtin/commit.c
index a17a5df..552a9f1 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1142,6 +1142,18 @@ static int git_status_config(const char *k, const char *v, void *cb)
return error(_("Invalid untracked files mode '%s'"), v);
return 0;
}
+
+ if (!strcmp(k, "status.shortwithbranch")) {
+ if (git_config_bool(k, v)) {
+ if (!v)
+ return config_error_nonbool(k);
+ else if(!strcmp(v, "true")) {
+ status_format = STATUS_FORMAT_SHORT;
+ s->show_branch = 1;
+ }
+ return 0;
+ }
+ }
return git_diff_ui_config(k, v, NULL);
}
--
1.7.11.4
next prev parent reply other threads:[~2012-11-11 22:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 22:53 [RFC PATCH 0/1] status: Allow for short-form output by default Thomas Adam
2012-11-11 22:53 ` Thomas Adam [this message]
2012-11-12 21:17 ` [RFC PATCH 1/1] status: Allow for short-form via config option Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352674383-23654-2-git-send-email-thomas@xteddy.org \
--to=thomas@xteddy.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).