[PATCH] Add committer and author names to top of COMMIT_EDITMSG.

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] Add committer and author names to top of COMMIT_EDITMSG.

From: Stephen Sinclair <hidden>
Date: 2016-06-15 22:44:04

Add committer and author names to top of COMMIT_EDITMSG.

Signed-off-by: Stephen Sinclair <redacted>
---
 builtin-commit.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 73f1e35..4fd9367 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -423,8 +423,18 @@ static int prepare_log_message(const char
*index_file, const char *prefix)
 			"#\n",
 			git_path("MERGE_HEAD"));

+    fprintf(fp, "\n");
+
+    fprintf(fp,
+            "# Committer: %s\n"
+            "# Author:    %s\n"
+            "#\n",
+            fmt_name(getenv("GIT_AUTHOR_NAME"),
+                     getenv("GIT_AUTHOR_EMAIL")),
+            fmt_name(getenv("GIT_COMMITTER_NAME"),
+                     getenv("GIT_COMMITTER_EMAIL")));
+
 	fprintf(fp,
-		"\n"
 		"# Please enter the commit message for your changes.\n"
 		"# (Comment lines starting with '#' will ");
 	if (cleanup_mode == CLEANUP_ALL)
-- 
1.5.4.rc2.85.ga7943-dirty

Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:04

Hi,

On Fri, 11 Jan 2008, Stephen Sinclair wrote:
Add committer and author names to top of COMMIT_EDITMSG.
This commit message is severely lacking: it is just a repetition of the 
commit subject, it is too technical (what is COMMIT_EDITMSG for, 
anyway?), and even worse, it does not begin to explain _why_ this is a 
good change.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help