Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH 3/3] commit: give a hint when a commit message has been abandoned

From: Jeff King <hidden>
Date: 2016-06-15 22:54:19

Possibly related (same subject, not in this thread)

On Mon, Jul 23, 2012 at 02:35:01PM -0700, Junio C Hamano wrote:
quoted
+FILES
+-----
+
+`$GIT_DIR/COMMIT_EDITMSG`::
+	This file contains the commit message of a commit in progress.
+	If `git-commit` exits due to an error before creating a commit,
+	any commit message that has been provided by the user (e.g., in
+	an editor session) will be available in this file, but will be
+	overwritten by the next invocation of `git-commit`.
 
 SEE ALSO
 --------
Very sensible, modulo s/git-commit/git commit/ and lack of S-o-b.
Yeah, I'm used to using the dashed form in documentation, but it's
probably reasonable to use the normal spaced form here. I assume you can
forge my S-o-b?
quoted hunk ↗ jump to hunk
I also wondered if something like the following might be useful, but
it probably falls into the "water under the bridge" category.

 builtin/commit.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/builtin/commit.c b/builtin/commit.c
index 149e07d..83bcee4 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -768,6 +768,11 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 				"with '#' will be kept; you may remove them"
 				" yourself if you want to.\n"
 				"An empty message aborts the commit.\n"));
+		status_printf(s, GIT_COLOR_NORMAL,
+			      _("The file '%s' keeps a copy of the log message\n"
+				"you edited, if you wish to inspect it later.\n"
+				"It will be wiped by the next invocation of 'git commit'.\n"),
+			      git_path("COMMIT_EDITMSG"));
That seems excessive, as it is inside the file itself. Unless your
editor is terrible, it already shows you that information.

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