[PATCH] commit: suggest --amend --reset-author to fix commiter identity

Subsystems: the rest

STALE3732d

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

[PATCH] commit: suggest --amend --reset-author to fix commiter identity

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:50:20

The advantage of this command is that it is cut-and-paste ready, while
using --author='...' requires the user to type his name and email a
second time.

Signed-off-by: Matthieu Moy <redacted>
---
 builtin/commit.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 22ba54f..440223c 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -47,7 +47,11 @@ static const char implicit_ident_advice[] =
 "\n"
 "If the identity used for this commit is wrong, you can fix it with:\n"
 "\n"
-"    git commit --amend --author='Your Name <you@example.com>'\n";
+"    git commit --amend --author='Your Name <you@example.com>'\n"
+"\n"
+"or\n"
+"\n"
+"    git commit --amend --reset-author\n";
 
 static const char empty_amend_advice[] =
 "You asked to amend the most recent commit, but doing so would make\n"
-- 
1.7.4.rc0.1.g6944b.dirty

Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:21

Matthieu Moy wrote:
quoted hunk
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -47,7 +47,11 @@ static const char implicit_ident_advice[] =
 "\n"
 "If the identity used for this commit is wrong, you can fix it with:\n"
 "\n"
-"    git commit --amend --author='Your Name <you@example.com>'\n";
+"    git commit --amend --author='Your Name <you@example.com>'\n"
+"\n"
+"or\n"
+"\n"
+"    git commit --amend --reset-author\n";
This message gets used when the author was set from gecos because
not available in the configuration.  Do you perhaps mean:

	If the identity used for this commit is wrong, you can fix it with:

	    git commit --amend --author='Your Name [off-list ref]'
	    git commit --amend --author='Your Name [off-list ref]'

	or

	    cat <<EOF >>~/.gitconfig
	    [user]
	      name = Your Name
	      email = you@example.com
	    EOF
	    git commit --amend --reset-author

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