From: Jeff King <peff@peff.net>
To: "Michael S. Tsirkin" <mst@dev.mellanox.co.il>
Cc: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] wt-status: show author info if status.showauthor is set
Date: Wed, 4 Apr 2007 02:24:48 -0400 [thread overview]
Message-ID: <20070404062447.GA4136@coredump.intra.peff.net> (raw)
In-Reply-To: <20070404060213.GB31984@mellanox.co.il>
Signed-off-by: Jeff King <peff@peff.net>
---
On Wed, Apr 04, 2007 at 09:02:13AM +0300, Michael S. Tsirkin wrote:
> - Maybe put Author: (or From:? and maybe Subject:?) line in the pre-formatted
> commit message, and let the user edit them?
Personally I think it's just clutter, but hey, it's off by default. Of
course what is the chance that you've turned on status.showauthor in
your ~/.gitconfig, but you don't have your identity set up properly? :)
Junio, this is somewhat tongue in cheek, but if people like it, please
take it.
Documentation/config.txt | 5 +++++
wt-status.c | 10 ++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index cf1e040..189e703 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -537,6 +537,11 @@ showbranch.default::
The default set of branches for gitlink:git-show-branch[1].
See gitlink:git-show-branch[1].
+status.showauthor::
+ If set to true, the output of git-status and the template used
+ for git-commit will show the author's name and email address.
+ Defaults to false.
+
tar.umask::
By default, gitlink:git-tar-tree[1] sets file and directories modes
to 0666 or 0777. While this is both useful and acceptable for projects
diff --git a/wt-status.c b/wt-status.c
index a055990..3c3510c 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -8,6 +8,7 @@
#include "revision.h"
#include "diffcore.h"
+int wt_status_show_author = 0;
int wt_status_use_color = 0;
static char wt_status_colors[][COLOR_MAXLEN] = {
"", /* WT_STATUS_HEADER: normal */
@@ -317,6 +318,11 @@ void wt_status_print(struct wt_status *s)
"# %s%s", on_what, branch_name);
}
+ if (wt_status_show_author)
+ color_printf_ln(color(WT_STATUS_HEADER),
+ "# author: %s",
+ git_author_info(0));
+
if (s->is_initial) {
color_printf_ln(color(WT_STATUS_HEADER), "#");
color_printf_ln(color(WT_STATUS_HEADER), "# Initial commit");
@@ -356,5 +362,9 @@ int git_status_config(const char *k, const char *v)
int slot = parse_status_slot(k, 13);
color_parse(v, k, wt_status_colors[slot]);
}
+ if (!strcmp(k, "status.showauthor")) {
+ wt_status_show_author = 1;
+ return 0;
+ }
return git_default_config(k, v);
}
--
1.5.1.rc3.671.gd125-dirty
next prev parent reply other threads:[~2007-04-04 6:24 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 12:06 [PATCH] have merge put FETCH_HEAD data in commit message Michael S. Tsirkin
2007-03-21 15:37 ` Junio C Hamano
2007-03-22 5:02 ` Michael S. Tsirkin
2007-03-22 5:09 ` Junio C Hamano
2007-03-22 6:28 ` Michael S. Tsirkin
2007-03-22 7:15 ` Junio C Hamano
2007-03-22 7:41 ` Michael S. Tsirkin
2007-03-22 8:21 ` Junio C Hamano
2007-03-22 8:37 ` Michael S. Tsirkin
2007-03-22 10:31 ` Junio C Hamano
2007-03-22 10:40 ` Michael S. Tsirkin
2007-03-24 10:21 ` Junio C Hamano
2007-04-04 6:02 ` Michael S. Tsirkin
2007-04-04 6:09 ` Junio C Hamano
2007-04-04 6:18 ` Michael S. Tsirkin
2007-04-04 6:19 ` Shawn O. Pearce
2007-04-04 6:25 ` Junio C Hamano
2007-04-04 6:35 ` Shawn O. Pearce
2007-04-04 6:24 ` Junio C Hamano
2007-04-04 7:01 ` [PATCH] display shortlog after git-commit Michael S. Tsirkin
2007-04-04 7:22 ` Junio C Hamano
2007-04-15 22:39 ` Michael S. Tsirkin
2007-04-15 23:08 ` Junio C Hamano
2007-04-16 3:53 ` [PATCH] display the subject of the commit just made Michael S. Tsirkin
2007-04-16 5:16 ` Junio C Hamano
2007-04-16 5:40 ` Michael S. Tsirkin
2007-04-16 6:17 ` Junio C Hamano
2007-04-16 5:51 ` Michael S. Tsirkin
2007-04-16 6:01 ` Junio C Hamano
2007-04-16 6:18 ` Michael S. Tsirkin
2007-04-16 6:51 ` Michael S. Tsirkin
2007-04-16 7:00 ` Junio C Hamano
2007-04-16 7:11 ` Shawn O. Pearce
2007-04-16 7:59 ` Michael S. Tsirkin
2007-04-16 12:56 ` Alex Riesen
2007-04-16 17:46 ` Junio C Hamano
2007-04-16 5:34 ` [PATCH] display shortlog after git-commit Michael S. Tsirkin
2007-04-16 6:04 ` Junio C Hamano
2007-04-16 6:26 ` Michael S. Tsirkin
2007-04-16 14:40 ` [PATCH] remove shortlog from git-commit output Michael S. Tsirkin
2007-04-16 15:02 ` Julian Phillips
2007-04-16 18:23 ` Michael S. Tsirkin
2007-04-16 20:21 ` Julian Phillips
2007-04-17 6:02 ` Michael S. Tsirkin
2007-04-17 7:27 ` Julian Phillips
2007-04-04 8:15 ` [PATCH] display shortlog after git-commit Junio C Hamano
2007-04-15 10:33 ` Michael S. Tsirkin
2007-04-15 19:57 ` Junio C Hamano
2007-04-15 20:09 ` Michael S. Tsirkin
2007-04-15 20:26 ` Andy Parkins
2007-04-15 20:34 ` Michael S. Tsirkin
2007-04-04 6:24 ` Jeff King [this message]
2007-04-04 6:32 ` [PATCH] wt-status: show author info if status.showauthor is set Junio C Hamano
2007-04-04 6:49 ` Michael S. Tsirkin
2007-04-04 6:52 ` Junio C Hamano
2007-04-04 6:55 ` Shawn O. Pearce
2007-04-04 13:28 ` Jakub Narebski
2007-03-23 13:57 ` [PATCH] have merge put FETCH_HEAD data in commit message Jakub Narebski
2007-03-23 13:59 ` J. Bruce Fields
2007-03-23 14:23 ` Jakub Narebski
2007-03-23 15:33 ` J. Bruce Fields
2007-03-24 0:03 ` Jakub Narebski
2007-03-22 9:07 ` [PATCH] Put FETCH_HEAD data in merge " Michael S. Tsirkin
2007-03-22 10:01 ` Junio C Hamano
2007-03-22 8:33 ` [PATCH] have merge put FETCH_HEAD data in " Jeff King
2007-03-22 8:51 ` Junio C Hamano
2007-03-22 9:09 ` Jeff King
2007-03-22 9:10 ` Andy Parkins
2007-03-21 17:29 ` [PATCHv2] put FETCH_HEAD data in merge " Michael S. Tsirkin
2007-03-21 18:09 ` Junio C Hamano
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=20070404062447.GA4136@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=mst@dev.mellanox.co.il \
/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).