login
Header Space

 
 

[PATCH] wt-status: show author info if status.showauthor is set

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Michael S. Tsirkin <mst@...>
Cc: Junio C Hamano <junkio@...>, Git Mailing List <git@...>
Date: Wednesday, April 4, 2007 - 2:24 am

Signed-off-by: Jeff King <peff@peff.net>
---
On Wed, Apr 04, 2007 at 09:02:13AM +0300, Michael S. Tsirkin wrote:


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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Junio C Hamano, (Wed Mar 21, 11:37 am)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Thu Mar 22, 1:02 am)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Thu Mar 22, 2:28 am)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Thu Mar 22, 3:41 am)
[PATCH] Put FETCH_HEAD data in merge commit message, Michael S. Tsirkin, (Thu Mar 22, 5:07 am)
Re: [PATCH] Put FETCH_HEAD data in merge commit message, Junio C Hamano, (Thu Mar 22, 6:01 am)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Thu Mar 22, 4:37 am)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Thu Mar 22, 6:40 am)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Wed Apr 4, 2:02 am)
[PATCH] wt-status: show author info if status.showauthor is ..., Jeff King, (Wed Apr 4, 2:24 am)
Re: [PATCH] wt-status: show author info if status.showauthor..., Michael S. Tsirkin, (Wed Apr 4, 2:49 am)
[PATCH] display shortlog after git-commit, Michael S. Tsirkin, (Wed Apr 4, 3:01 am)
Re: [PATCH] display shortlog after git-commit, Junio C Hamano, (Wed Apr 4, 4:15 am)
Re: [PATCH] display shortlog after git-commit, Michael S. Tsirkin, (Sun Apr 15, 6:33 am)
Re: [PATCH] display shortlog after git-commit, Junio C Hamano, (Wed Apr 4, 3:22 am)
[PATCH] display shortlog after git-commit, Michael S. Tsirkin, (Sun Apr 15, 6:39 pm)
Re: [PATCH] display shortlog after git-commit, Junio C Hamano, (Sun Apr 15, 7:08 pm)
Re: [PATCH] display shortlog after git-commit, Michael S. Tsirkin, (Mon Apr 16, 1:34 am)
Re: [PATCH] display shortlog after git-commit, Junio C Hamano, (Mon Apr 16, 2:04 am)
[PATCH] remove shortlog from git-commit output, Michael S. Tsirkin, (Mon Apr 16, 10:40 am)
Re: [PATCH] remove shortlog from git-commit output, Julian Phillips, (Mon Apr 16, 11:02 am)
Re: [PATCH] remove shortlog from git-commit output, Michael S. Tsirkin, (Mon Apr 16, 2:23 pm)
Re: [PATCH] remove shortlog from git-commit output, Julian Phillips, (Mon Apr 16, 4:21 pm)
Re: [PATCH] remove shortlog from git-commit output, Michael S. Tsirkin, (Tue Apr 17, 2:02 am)
Re: [PATCH] remove shortlog from git-commit output, Julian Phillips, (Tue Apr 17, 3:27 am)
Re: [PATCH] display shortlog after git-commit, Michael S. Tsirkin, (Mon Apr 16, 2:26 am)
[PATCH] display the subject of the commit just made, Michael S. Tsirkin, (Sun Apr 15, 11:53 pm)
Re: [PATCH] have merge put FETCH_HEAD data in commit message, Michael S. Tsirkin, (Wed Apr 4, 2:18 am)
speck-geostationary