{"thread":{"id":"26230","subject":"[PATCH] commit: suggest --amend --reset-author to fix commiter identity","startedAt":"2011-01-07T14:14:31Z","lastAt":"2011-01-12T18:39:04Z","messageCount":10,"participants":["Matthieu Moy","Jonathan Nieder","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"159109","messageId":"1294409671-5479-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"26230","inReplyTo":null,"subject":"[PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2011-01-07T14:14:31Z","receivedAt":"2011-01-07T14:14:31Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The advantage of this command is that it is cut-and-paste ready, while\nusing --author='...' requires the user to type his name and email a\nsecond time.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin/commit.c |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 22ba54f..440223c 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -47,7 +47,11 @@ static const char implicit_ident_advice[] =\n \"\\n\"\n \"If the identity used for this commit is wrong, you can fix it with:\\n\"\n \"\\n\"\n-\"    git commit --amend --author='Your Name <you@example.com>'\\n\";\n+\"    git commit --amend --author='Your Name <you@example.com>'\\n\"\n+\"\\n\"\n+\"or\\n\"\n+\"\\n\"\n+\"    git commit --amend --reset-author\\n\";\n \n static const char empty_amend_advice[] =\n \"You asked to amend the most recent commit, but doing so would make\\n\"\n-- \n1.7.4.rc0.1.g6944b.dirty\n"},{"id":"159116","messageId":"20110107171329.GA16571@burratino","threadId":"26230","inReplyTo":"1294409671-5479-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-01-07T17:13:29Z","receivedAt":"2011-01-07T17:13:29Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Matthieu Moy wrote:\n\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -47,7 +47,11 @@ static const char implicit_ident_advice[] =\n>  \"\\n\"\n>  \"If the identity used for this commit is wrong, you can fix it with:\\n\"\n>  \"\\n\"\n> -\"    git commit --amend --author='Your Name <you@example.com>'\\n\";\n> +\"    git commit --amend --author='Your Name <you@example.com>'\\n\"\n> +\"\\n\"\n> +\"or\\n\"\n> +\"\\n\"\n> +\"    git commit --amend --reset-author\\n\";\n>\n\nThis message gets used when the author was set from gecos because\nnot available in the configuration.  Do you perhaps mean:\n\n\tIf the identity used for this commit is wrong, you can fix it with:\n\n\t    git commit --amend --author='Your Name <you@example.com>'\n\t    git commit --amend --author='Your Name <you@example.com>'\n\n\tor\n\n\t    cat <<EOF >>~/.gitconfig\n\t    [user]\n\t      name = Your Name\n\t      email = you@example.com\n\t    EOF\n\t    git commit --amend --reset-author\n\n?\n"},{"id":"159117","messageId":"vpq7hegmy66.fsf@bauges.imag.fr","threadId":"26230","inReplyTo":"20110107171329.GA16571@burratino","subject":"Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-01-07T17:16:49Z","receivedAt":"2011-01-07T17:16:49Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> This message gets used when the author was set from gecos because\n> not available in the configuration.\n\nThe complete message says:\n\n\"Your name and email address were configured automatically based\\n\"\n\"on your username and hostname. Please check that they are accurate.\\n\"\n\"You can suppress this message by setting them explicitly:\\n\"\n\"\\n\"\n\"    git config --global user.name \\\"Your Name\\\"\\n\"\n\"    git config --global user.email you@example.com\\n\"\n\"\\n\"\n\"If the identity used for this commit is wrong, you can fix it with:\\n\"\n\"\\n\"\n\"    git commit --amend --author='Your Name <you@example.com>'\\n\"\n\"\\n\"\n\"or\\n\"\n\"\\n\"\n\"    git commit --amend --reset-author\\n\";\n\nSo, the natural thing to do is\n\ngit config --global user.name \"me\"\ngit config --global user.email \"my.email@bla.com\"\ngit commit --amend --reset-author\n\nand it's not necessary to use the longer\n\ngit config --global user.name \"me\"\ngit config --global user.email \"my.email@bla.com\"\ngit commit --amend --author='me <my.email@bla.com>'\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"159120","messageId":"20110107173428.GC16571@burratino","threadId":"26230","inReplyTo":"vpq7hegmy66.fsf@bauges.imag.fr","subject":"Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-01-07T17:34:28Z","receivedAt":"2011-01-07T17:34:28Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Matthieu Moy wrote:\n\n> The complete message says:\n> \n> \"Your name and email address were configured automatically based\\n\"\n> \"on your username and hostname. Please check that they are accurate.\\n\"\n> \"You can suppress this message by setting them explicitly:\\n\"\n> \"\\n\"\n> \"    git config --global user.name \\\"Your Name\\\"\\n\"\n> \"    git config --global user.email you@example.com\\n\"\n> \"\\n\"\n> \"If the identity used for this commit is wrong, you can fix it with:\\n\"\n> \"\\n\"\n> \"    git commit --amend --author='Your Name <you@example.com>'\\n\"\n\nSloppy reading on my part.  So the original text explains:\n\n\thow to configure your identity globally\n\thow to change the identity for a single commit\n\n> \"\\n\"\n> \"or\\n\"\n> \"\\n\"\n> \"    git commit --amend --reset-author\\n\";\n\nMaybe:\n\n\tIf the identity used for this commit is wrong, you can fix it:\n\n\t    git commit --amend --author='Patch Submitter <author@example.com>'\n\n\tTo just use your newly configured identity:\n\n\t    git commit --amend --reset-author\n\n(modulo wording).  The idea being to make it clear to the user why we\nare telling two ways to do the same thing.\n\nSorry for the nonsense.\nJonathan\n"},{"id":"159145","messageId":"7vsjx45w7g.fsf@alter.siamese.dyndns.org","threadId":"26230","inReplyTo":"1294409671-5479-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-07T19:51:15Z","receivedAt":"2011-01-07T19:51:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The advantage of this command is that it is cut-and-paste ready, while\n> using --author='...' requires the user to type his name and email a\n> second time.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  builtin/commit.c |    6 +++++-\n>  1 files changed, 5 insertions(+), 1 deletions(-)\n>\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 22ba54f..440223c 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -47,7 +47,11 @@ static const char implicit_ident_advice[] =\n>  \"\\n\"\n>  \"If the identity used for this commit is wrong, you can fix it with:\\n\"\n>  \"\\n\"\n> -\"    git commit --amend --author='Your Name <you@example.com>'\\n\";\n> +\"    git commit --amend --author='Your Name <you@example.com>'\\n\"\n> +\"\\n\"\n> +\"or\\n\"\n> +\"\\n\"\n> +\"    git commit --amend --reset-author\\n\";\n\nI don't think making the \"cheat-sheet\" insn longer by offering more\nchoices is a good idea.  These are messages for lazy and busy people.\n\nWouldn't it work better to just get rid of the longer form and say\nsomething like:\n\n    ... here is how to tell your name to git (existing message) ...\n\n    After doing the above, run\n\n    \tgit commit --amend --reset-author\n\n    to fix the identity used for this commit.\n"},{"id":"159208","messageId":"vpq1v4nirzz.fsf@bauges.imag.fr","threadId":"26230","inReplyTo":"7vsjx45w7g.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-01-08T10:56:00Z","receivedAt":"2011-01-08T10:56:00Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I don't think making the \"cheat-sheet\" insn longer by offering more\n> choices is a good idea.  These are messages for lazy and busy\n> people.\n\nThe reason I kept both forms was that the message is designed to be\nseen once (or once for each new machine one works on), and the most\nscary it is, the most efficient ;-). \n\n> Wouldn't it work better to just get rid of the longer form and say\n> something like:\n>\n>     ... here is how to tell your name to git (existing message) ...\n>\n>     After doing the above, run\n>\n>     \tgit commit --amend --reset-author\n>\n>     to fix the identity used for this commit.\n\nI'm fine with that proposal too. I'll resend with that if no one\nobjects. Probalby rewording it to\n\nAfter doing this, you can fix the identity used for this commit with:\n\n  git commit --amend --reset-author\n\n\nwould make it even concisier (no break of the sentence with a\ncommand).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"159299","messageId":"20110111053451.GA10094@sigill.intra.peff.net","threadId":"26230","inReplyTo":"vpq1v4nirzz.fsf@bauges.imag.fr","subject":"Re: [PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-01-11T05:34:51Z","receivedAt":"2011-01-11T05:34:51Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jan 08, 2011 at 11:56:00AM +0100, Matthieu Moy wrote:\n\n> > Wouldn't it work better to just get rid of the longer form and say\n> > something like:\n> >\n> >     ... here is how to tell your name to git (existing message) ...\n> >\n> >     After doing the above, run\n> >\n> >     \tgit commit --amend --reset-author\n> >\n> >     to fix the identity used for this commit.\n> \n> I'm fine with that proposal too. I'll resend with that if no one\n> objects. Probalby rewording it to\n\nHmm.  When I originally wrote that message, I specifically avoided using\n--reset-author because I figured people would want to most immediately\nfix the broken commit, and then maybe would not be too lazy to fix\nthings for the future. But that was just a hunch, and I don't feel\nstrongly about it.\n\nI was also afraid of people blindly running the fixup command without\ndoing the configuration specified in the commands above. However, I\nthink as long as the text makes it clear that one depends on the other,\nit should be OK. So something like:\n\n> After doing this, you can fix the identity used for this commit with:\n> \n>   git commit --amend --reset-author\n\nlooks fine to me.\n\n-Peff\n"},{"id":"159338","messageId":"1294754860-17701-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"26230","inReplyTo":"vpq1v4nirzz.fsf@bauges.imag.fr","subject":"[PATCH] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2011-01-11T14:07:40Z","receivedAt":"2011-01-11T14:07:40Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Since the message advise to fix the configuration first, the advantage\nof this command is that it is cut-and-paste ready, while using\n--author='...' requires the user to type his name and email a second\ntime.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin/commit.c |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 22ba54f..440223c 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -47,7 +47,11 @@ static const char implicit_ident_advice[] =\n \"\\n\"\n \"If the identity used for this commit is wrong, you can fix it with:\\n\"\n \"\\n\"\n-\"    git commit --amend --author='Your Name <you@example.com>'\\n\";\n+\"    git commit --amend --author='Your Name <you@example.com>'\\n\"\n+\"\\n\"\n+\"or\\n\"\n+\"\\n\"\n+\"    git commit --amend --reset-author\\n\";\n \n static const char empty_amend_advice[] =\n \"You asked to amend the most recent commit, but doing so would make\\n\"\n-- \n1.7.4.rc0.2.g3e22c.dirty\n"},{"id":"159412","messageId":"1294856954-26841-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"26230","inReplyTo":"1294754860-17701-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2011-01-12T18:29:14Z","receivedAt":"2011-01-12T18:29:14Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Since the message advise to fix the configuration first, the advantage\nof this command is that it is cut-and-paste ready, while using\n--author='...' requires the user to type his name and email a second\ntime.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nSorry, I did a resend the other day, which was plain wrong (I had the\nchanges in my tree, but sent before commit--amend-ing).\n\nThis one should be OK.\n\n builtin/commit.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 22ba54f..03cff5a 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -45,9 +45,9 @@ static const char implicit_ident_advice[] =\n \"    git config --global user.name \\\"Your Name\\\"\\n\"\n \"    git config --global user.email you@example.com\\n\"\n \"\\n\"\n-\"If the identity used for this commit is wrong, you can fix it with:\\n\"\n+\"After doing this, you may fix the identity used for this commit with:\\n\"\n \"\\n\"\n-\"    git commit --amend --author='Your Name <you@example.com>'\\n\";\n+\"    git commit --amend --reset-author\\n\";\n \n static const char empty_amend_advice[] =\n \"You asked to amend the most recent commit, but doing so would make\\n\"\n-- \n1.7.4.rc0.2.g3e22c.dirty\n"},{"id":"159414","messageId":"20110112183904.GE31747@sigill.intra.peff.net","threadId":"26230","inReplyTo":"1294856954-26841-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2] commit: suggest --amend --reset-author to fix commiter identity","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-01-12T18:39:04Z","receivedAt":"2011-01-12T18:39:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jan 12, 2011 at 07:29:14PM +0100, Matthieu Moy wrote:\n\n> Since the message advise to fix the configuration first, the advantage\n> of this command is that it is cut-and-paste ready, while using\n> --author='...' requires the user to type his name and email a second\n> time.\n> \n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n> Sorry, I did a resend the other day, which was plain wrong (I had the\n> changes in my tree, but sent before commit--amend-ing).\n> \n> This one should be OK.\n\nYeah, this one looks good.\n\nAcked-by: Jeff King <peff@peff.net>\n\n-Peff\n"}]}