* [PATCH] commit: suggest --amend --reset-author to fix commiter identity
@ 2011-01-07 14:14 Matthieu Moy
2011-01-07 17:13 ` Jonathan Nieder
2011-01-07 19:51 ` Junio C Hamano
0 siblings, 2 replies; 10+ messages in thread
From: Matthieu Moy @ 2011-01-07 14:14 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy
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 <Matthieu.Moy@imag.fr>
---
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-07 14:14 [PATCH] commit: suggest --amend --reset-author to fix commiter identity Matthieu Moy
@ 2011-01-07 17:13 ` Jonathan Nieder
2011-01-07 17:16 ` Matthieu Moy
2011-01-07 19:51 ` Junio C Hamano
1 sibling, 1 reply; 10+ messages in thread
From: Jonathan Nieder @ 2011-01-07 17:13 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git, gitster
Matthieu Moy wrote:
> --- 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 <you@example.com>'
git commit --amend --author='Your Name <you@example.com>'
or
cat <<EOF >>~/.gitconfig
[user]
name = Your Name
email = you@example.com
EOF
git commit --amend --reset-author
?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-07 17:13 ` Jonathan Nieder
@ 2011-01-07 17:16 ` Matthieu Moy
2011-01-07 17:34 ` Jonathan Nieder
0 siblings, 1 reply; 10+ messages in thread
From: Matthieu Moy @ 2011-01-07 17:16 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, gitster
Jonathan Nieder <jrnieder@gmail.com> writes:
> This message gets used when the author was set from gecos because
> not available in the configuration.
The complete message says:
"Your name and email address were configured automatically based\n"
"on your username and hostname. Please check that they are accurate.\n"
"You can suppress this message by setting them explicitly:\n"
"\n"
" git config --global user.name \"Your Name\"\n"
" git config --global user.email you@example.com\n"
"\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"
"\n"
"or\n"
"\n"
" git commit --amend --reset-author\n";
So, the natural thing to do is
git config --global user.name "me"
git config --global user.email "my.email@bla.com"
git commit --amend --reset-author
and it's not necessary to use the longer
git config --global user.name "me"
git config --global user.email "my.email@bla.com"
git commit --amend --author='me <my.email@bla.com>'
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-07 17:16 ` Matthieu Moy
@ 2011-01-07 17:34 ` Jonathan Nieder
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Nieder @ 2011-01-07 17:34 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git, gitster
Matthieu Moy wrote:
> The complete message says:
>
> "Your name and email address were configured automatically based\n"
> "on your username and hostname. Please check that they are accurate.\n"
> "You can suppress this message by setting them explicitly:\n"
> "\n"
> " git config --global user.name \"Your Name\"\n"
> " git config --global user.email you@example.com\n"
> "\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"
Sloppy reading on my part. So the original text explains:
how to configure your identity globally
how to change the identity for a single commit
> "\n"
> "or\n"
> "\n"
> " git commit --amend --reset-author\n";
Maybe:
If the identity used for this commit is wrong, you can fix it:
git commit --amend --author='Patch Submitter <author@example.com>'
To just use your newly configured identity:
git commit --amend --reset-author
(modulo wording). The idea being to make it clear to the user why we
are telling two ways to do the same thing.
Sorry for the nonsense.
Jonathan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-07 14:14 [PATCH] commit: suggest --amend --reset-author to fix commiter identity Matthieu Moy
2011-01-07 17:13 ` Jonathan Nieder
@ 2011-01-07 19:51 ` Junio C Hamano
2011-01-08 10:56 ` Matthieu Moy
1 sibling, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2011-01-07 19:51 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> 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 <Matthieu.Moy@imag.fr>
> ---
> 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";
I don't think making the "cheat-sheet" insn longer by offering more
choices is a good idea. These are messages for lazy and busy people.
Wouldn't it work better to just get rid of the longer form and say
something like:
... here is how to tell your name to git (existing message) ...
After doing the above, run
git commit --amend --reset-author
to fix the identity used for this commit.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-07 19:51 ` Junio C Hamano
@ 2011-01-08 10:56 ` Matthieu Moy
2011-01-11 5:34 ` Jeff King
2011-01-11 14:07 ` Matthieu Moy
0 siblings, 2 replies; 10+ messages in thread
From: Matthieu Moy @ 2011-01-08 10:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano <gitster@pobox.com> writes:
> I don't think making the "cheat-sheet" insn longer by offering more
> choices is a good idea. These are messages for lazy and busy
> people.
The reason I kept both forms was that the message is designed to be
seen once (or once for each new machine one works on), and the most
scary it is, the most efficient ;-).
> Wouldn't it work better to just get rid of the longer form and say
> something like:
>
> ... here is how to tell your name to git (existing message) ...
>
> After doing the above, run
>
> git commit --amend --reset-author
>
> to fix the identity used for this commit.
I'm fine with that proposal too. I'll resend with that if no one
objects. Probalby rewording it to
After doing this, you can fix the identity used for this commit with:
git commit --amend --reset-author
would make it even concisier (no break of the sentence with a
command).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-08 10:56 ` Matthieu Moy
@ 2011-01-11 5:34 ` Jeff King
2011-01-11 14:07 ` Matthieu Moy
1 sibling, 0 replies; 10+ messages in thread
From: Jeff King @ 2011-01-11 5:34 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Junio C Hamano, git
On Sat, Jan 08, 2011 at 11:56:00AM +0100, Matthieu Moy wrote:
> > Wouldn't it work better to just get rid of the longer form and say
> > something like:
> >
> > ... here is how to tell your name to git (existing message) ...
> >
> > After doing the above, run
> >
> > git commit --amend --reset-author
> >
> > to fix the identity used for this commit.
>
> I'm fine with that proposal too. I'll resend with that if no one
> objects. Probalby rewording it to
Hmm. When I originally wrote that message, I specifically avoided using
--reset-author because I figured people would want to most immediately
fix the broken commit, and then maybe would not be too lazy to fix
things for the future. But that was just a hunch, and I don't feel
strongly about it.
I was also afraid of people blindly running the fixup command without
doing the configuration specified in the commands above. However, I
think as long as the text makes it clear that one depends on the other,
it should be OK. So something like:
> After doing this, you can fix the identity used for this commit with:
>
> git commit --amend --reset-author
looks fine to me.
-Peff
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] commit: suggest --amend --reset-author to fix commiter identity
2011-01-08 10:56 ` Matthieu Moy
2011-01-11 5:34 ` Jeff King
@ 2011-01-11 14:07 ` Matthieu Moy
2011-01-12 18:29 ` [PATCH v2] " Matthieu Moy
1 sibling, 1 reply; 10+ messages in thread
From: Matthieu Moy @ 2011-01-11 14:07 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy
Since the message advise to fix the configuration first, 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 <Matthieu.Moy@imag.fr>
---
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.2.g3e22c.dirty
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2] commit: suggest --amend --reset-author to fix commiter identity
2011-01-11 14:07 ` Matthieu Moy
@ 2011-01-12 18:29 ` Matthieu Moy
2011-01-12 18:39 ` Jeff King
0 siblings, 1 reply; 10+ messages in thread
From: Matthieu Moy @ 2011-01-12 18:29 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy
Since the message advise to fix the configuration first, 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 <Matthieu.Moy@imag.fr>
---
Sorry, I did a resend the other day, which was plain wrong (I had the
changes in my tree, but sent before commit--amend-ing).
This one should be OK.
builtin/commit.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 22ba54f..03cff5a 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -45,9 +45,9 @@ static const char implicit_ident_advice[] =
" git config --global user.name \"Your Name\"\n"
" git config --global user.email you@example.com\n"
"\n"
-"If the identity used for this commit is wrong, you can fix it with:\n"
+"After doing this, you may fix the identity used for this commit with:\n"
"\n"
-" git commit --amend --author='Your Name <you@example.com>'\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.2.g3e22c.dirty
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2] commit: suggest --amend --reset-author to fix commiter identity
2011-01-12 18:29 ` [PATCH v2] " Matthieu Moy
@ 2011-01-12 18:39 ` Jeff King
0 siblings, 0 replies; 10+ messages in thread
From: Jeff King @ 2011-01-12 18:39 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git, gitster
On Wed, Jan 12, 2011 at 07:29:14PM +0100, Matthieu Moy wrote:
> Since the message advise to fix the configuration first, 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 <Matthieu.Moy@imag.fr>
> ---
> Sorry, I did a resend the other day, which was plain wrong (I had the
> changes in my tree, but sent before commit--amend-ing).
>
> This one should be OK.
Yeah, this one looks good.
Acked-by: Jeff King <peff@peff.net>
-Peff
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-01-12 18:39 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07 14:14 [PATCH] commit: suggest --amend --reset-author to fix commiter identity Matthieu Moy
2011-01-07 17:13 ` Jonathan Nieder
2011-01-07 17:16 ` Matthieu Moy
2011-01-07 17:34 ` Jonathan Nieder
2011-01-07 19:51 ` Junio C Hamano
2011-01-08 10:56 ` Matthieu Moy
2011-01-11 5:34 ` Jeff King
2011-01-11 14:07 ` Matthieu Moy
2011-01-12 18:29 ` [PATCH v2] " Matthieu Moy
2011-01-12 18:39 ` Jeff King
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).