{"thread":{"id":"54085","subject":"--author arg on commit only works if there is an email configured already","startedAt":"2020-08-21T17:20:36Z","lastAt":"2020-08-21T22:35:13Z","messageCount":10,"participants":["Alvaro Aleman","Andreas Schwab","Junio C Hamano","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"404166","messageId":"CAOW=8D2J3t3cE32q2xNqSOPTa6gxR5gSuJUCCj5MSj58ccc3Cg@mail.gmail.com","threadId":"54085","inReplyTo":null,"subject":"--author arg on commit only works if there is an email configured already","fromName":"Alvaro Aleman","fromEmail":"aaleman@redhat.com","sentAt":"2020-08-21T16:15:49Z","receivedAt":"2020-08-21T17:20:36Z","isPatch":false,"sender":{"key":"aaleman@redhat.com","avatar":null},"body":"Hello everyone,\n\nIt seems the `--author` arg on the `git commit` command only works if\nan author email is configured already somewhere:\n\nSample that I would expect to work and that does not work:\n\n```\n$ docker run --rm -it golang /bin/bash -c 'cd $(mktemp -d); git init;\ntouch test; git add test; git commit -m message --author \"A U Thor\n<author@example.com>\"'\nInitialized empty Git repository in /tmp/tmp.TiNqOZsw9C/.git/\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: unable to auto-detect email address (got 'root@aedfbe0df193.(none)')\n```\n\nWhen configuring any mail first, this works and uses the mail\nspecified in the `--author` arg:\n\n```\n$ docker run --rm -it golang /bin/bash -c 'cd $(mktemp -d); git init;\ntouch test; git add test; git config --local user.email\n\"mail@domain.com\"; git commit -m message --author \"A U Thor\n<author@example.com>\"'\nInitialized empty Git repository in /tmp/tmp.1drhE2Rgmh/.git/\n[master (root-commit) b3dad37] message\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 0 deletions(-)\n create mode 100644 test\n```\n\nThe git version:\n$ docker run --rm -it golang  git --version\ngit version 2.20\n\n"},{"id":"404177","messageId":"87ft8fvoow.fsf@igel.home","threadId":"54085","inReplyTo":"CAOW=8D2J3t3cE32q2xNqSOPTa6gxR5gSuJUCCj5MSj58ccc3Cg@mail.gmail.com","subject":"Re: --author arg on commit only works if there is an email configured already","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2020-08-21T18:28:15Z","receivedAt":"2020-08-21T18:29:24Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Aug 21 2020, Alvaro Aleman wrote:\n\n> It seems the `--author` arg on the `git commit` command only works if\n> an author email is configured already somewhere:\n\nThe `--author' argument only sets the author, but git still need to fill\nin the committer.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"404182","messageId":"xmqqr1rz96ry.fsf@gitster.c.googlers.com","threadId":"54085","inReplyTo":"87ft8fvoow.fsf@igel.home","subject":"Re: --author arg on commit only works if there is an email configured already","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-21T18:46:09Z","receivedAt":"2020-08-21T18:46:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> On Aug 21 2020, Alvaro Aleman wrote:\n>\n>> It seems the `--author` arg on the `git commit` command only works if\n>> an author email is configured already somewhere:\n>\n> The `--author' argument only sets the author, but git still need to fill\n> in the committer.\n\nIn other words, the --author option works just fine.  You still need\nto tell Git what committer identity you want to use, and the easiest\nway to do so is with user.{name,email} configuration variables.\n\nI wonder if it helps to give an extra line of message like the\nattached (untested) patch, though.\n\n ident.c | 51 ++++++++++++++++++++++++++++++++++-----------------\n 1 file changed, 34 insertions(+), 17 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex e666ee4e59..177ac00261 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -345,18 +345,35 @@ int split_ident_line(struct ident_split *split, const char *line, int len)\n \treturn 0;\n }\n \n-static const char *env_hint =\n-N_(\"\\n\"\n-   \"*** Please tell me who you are.\\n\"\n-   \"\\n\"\n-   \"Run\\n\"\n-   \"\\n\"\n-   \"  git config --global user.email \\\"you@example.com\\\"\\n\"\n-   \"  git config --global user.name \\\"Your Name\\\"\\n\"\n-   \"\\n\"\n-   \"to set your account\\'s default identity.\\n\"\n-   \"Omit --global to set the identity only in this repository.\\n\"\n-   \"\\n\");\n+\n+static void ident_env_hint(enum want_ident whose_ident)\n+{\n+\tstatic const char *env_hint =\n+\t\tN_(\"\\n\"\n+\t\t   \"*** Please tell me who you are.\\n\"\n+\t\t   \"\\n\"\n+\t\t   \"Run\\n\"\n+\t\t   \"\\n\"\n+\t\t   \"  git config --global user.email \\\"you@example.com\\\"\\n\"\n+\t\t   \"  git config --global user.name \\\"Your Name\\\"\\n\"\n+\t\t   \"\\n\"\n+\t\t   \"to set your account\\'s default identity.\\n\"\n+\t\t   \"Omit --global to set the identity only in this repository.\\n\"\n+\t\t   \"\\n\");\n+\n+\tswitch (whose_ident) {\n+\tcase WANT_AUTHOR_IDENT:\n+\t\tfputs(_(\"Author identity unknown\\n\"), stderr);\n+\t\tbreak;\n+\tcase WANT_COMMITTER_IDENT:\n+\t\tfputs(_(\"Committer identity unknown\\n\"), stderr);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n+\tfputs(_(env_hint), stderr);\n+}\n \n const char *fmt_ident(const char *name, const char *email,\n \t\t      enum want_ident whose_ident, const char *date_str, int flag)\n@@ -375,12 +392,12 @@ const char *fmt_ident(const char *name, const char *email,\n \tif (!email) {\n \t\tif (strict && ident_use_config_only\n \t\t    && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n-\t\t\tfputs(_(env_hint), stderr);\n+\t\t\tident_env_hint(whose_ident);\n \t\t\tdie(_(\"no email was given and auto-detection is disabled\"));\n \t\t}\n \t\temail = ident_default_email();\n \t\tif (strict && default_email_is_bogus) {\n-\t\t\tfputs(_(env_hint), stderr);\n+\t\t\tident_env_hint(whose_ident);\n \t\t\tdie(_(\"unable to auto-detect email address (got '%s')\"), email);\n \t\t}\n \t}\n@@ -397,13 +414,13 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tif (!name) {\n \t\t\tif (strict && ident_use_config_only\n \t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n-\t\t\t\tfputs(_(env_hint), stderr);\n+\t\t\t\tident_env_hint(whose_ident);\n \t\t\t\tdie(_(\"no name was given and auto-detection is disabled\"));\n \t\t\t}\n \t\t\tname = ident_default_name();\n \t\t\tusing_default = 1;\n \t\t\tif (strict && default_name_is_bogus) {\n-\t\t\t\tfputs(_(env_hint), stderr);\n+\t\t\t\tident_env_hint(whose_ident);\n \t\t\t\tdie(_(\"unable to auto-detect name (got '%s')\"), name);\n \t\t\t}\n \t\t}\n@@ -411,7 +428,7 @@ const char *fmt_ident(const char *name, const char *email,\n \t\t\tstruct passwd *pw;\n \t\t\tif (strict) {\n \t\t\t\tif (using_default)\n-\t\t\t\t\tfputs(_(env_hint), stderr);\n+\t\t\t\t\tident_env_hint(whose_ident);\n \t\t\t\tdie(_(\"empty ident name (for <%s>) not allowed\"), email);\n \t\t\t}\n \t\t\tpw = xgetpwuid_self(NULL);\n"},{"id":"404198","messageId":"CAOW=8D3WZyoc=PpyzmPRYM2MT_=F4tnuTxJ0Z+_dHMb4Xk8imQ@mail.gmail.com","threadId":"54085","inReplyTo":"xmqqr1rz96ry.fsf@gitster.c.googlers.com","subject":"Re: --author arg on commit only works if there is an email configured already","fromName":"Alvaro Aleman","fromEmail":"aaleman@redhat.com","sentAt":"2020-08-21T19:55:51Z","receivedAt":"2020-08-21T19:56:13Z","isPatch":false,"sender":{"key":"aaleman@redhat.com","avatar":null},"body":"Thank you for the explanation. Yes, having the error explicitly\nmention t about which of author/committer this is would be helpful.\n\nOn Fri, Aug 21, 2020 at 2:47 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Andreas Schwab <schwab@linux-m68k.org> writes:\n>\n> > On Aug 21 2020, Alvaro Aleman wrote:\n> >\n> >> It seems the `--author` arg on the `git commit` command only works if\n> >> an author email is configured already somewhere:\n> >\n> > The `--author' argument only sets the author, but git still need to fill\n> > in the committer.\n>\n> In other words, the --author option works just fine.  You still need\n> to tell Git what committer identity you want to use, and the easiest\n> way to do so is with user.{name,email} configuration variables.\n>\n> I wonder if it helps to give an extra line of message like the\n> attached (untested) patch, though.\n>\n>  ident.c | 51 ++++++++++++++++++++++++++++++++++-----------------\n>  1 file changed, 34 insertions(+), 17 deletions(-)\n>\n> diff --git a/ident.c b/ident.c\n> index e666ee4e59..177ac00261 100644\n> --- a/ident.c\n> +++ b/ident.c\n> @@ -345,18 +345,35 @@ int split_ident_line(struct ident_split *split, const char *line, int len)\n>         return 0;\n>  }\n>\n> -static const char *env_hint =\n> -N_(\"\\n\"\n> -   \"*** Please tell me who you are.\\n\"\n> -   \"\\n\"\n> -   \"Run\\n\"\n> -   \"\\n\"\n> -   \"  git config --global user.email \\\"you@example.com\\\"\\n\"\n> -   \"  git config --global user.name \\\"Your Name\\\"\\n\"\n> -   \"\\n\"\n> -   \"to set your account\\'s default identity.\\n\"\n> -   \"Omit --global to set the identity only in this repository.\\n\"\n> -   \"\\n\");\n> +\n> +static void ident_env_hint(enum want_ident whose_ident)\n> +{\n> +       static const char *env_hint =\n> +               N_(\"\\n\"\n> +                  \"*** Please tell me who you are.\\n\"\n> +                  \"\\n\"\n> +                  \"Run\\n\"\n> +                  \"\\n\"\n> +                  \"  git config --global user.email \\\"you@example.com\\\"\\n\"\n> +                  \"  git config --global user.name \\\"Your Name\\\"\\n\"\n> +                  \"\\n\"\n> +                  \"to set your account\\'s default identity.\\n\"\n> +                  \"Omit --global to set the identity only in this repository.\\n\"\n> +                  \"\\n\");\n> +\n> +       switch (whose_ident) {\n> +       case WANT_AUTHOR_IDENT:\n> +               fputs(_(\"Author identity unknown\\n\"), stderr);\n> +               break;\n> +       case WANT_COMMITTER_IDENT:\n> +               fputs(_(\"Committer identity unknown\\n\"), stderr);\n> +               break;\n> +       default:\n> +               break;\n> +       }\n> +\n> +       fputs(_(env_hint), stderr);\n> +}\n>\n>  const char *fmt_ident(const char *name, const char *email,\n>                       enum want_ident whose_ident, const char *date_str, int flag)\n> @@ -375,12 +392,12 @@ const char *fmt_ident(const char *name, const char *email,\n>         if (!email) {\n>                 if (strict && ident_use_config_only\n>                     && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n> -                       fputs(_(env_hint), stderr);\n> +                       ident_env_hint(whose_ident);\n>                         die(_(\"no email was given and auto-detection is disabled\"));\n>                 }\n>                 email = ident_default_email();\n>                 if (strict && default_email_is_bogus) {\n> -                       fputs(_(env_hint), stderr);\n> +                       ident_env_hint(whose_ident);\n>                         die(_(\"unable to auto-detect email address (got '%s')\"), email);\n>                 }\n>         }\n> @@ -397,13 +414,13 @@ const char *fmt_ident(const char *name, const char *email,\n>                 if (!name) {\n>                         if (strict && ident_use_config_only\n>                             && !(ident_config_given & IDENT_NAME_GIVEN)) {\n> -                               fputs(_(env_hint), stderr);\n> +                               ident_env_hint(whose_ident);\n>                                 die(_(\"no name was given and auto-detection is disabled\"));\n>                         }\n>                         name = ident_default_name();\n>                         using_default = 1;\n>                         if (strict && default_name_is_bogus) {\n> -                               fputs(_(env_hint), stderr);\n> +                               ident_env_hint(whose_ident);\n>                                 die(_(\"unable to auto-detect name (got '%s')\"), name);\n>                         }\n>                 }\n> @@ -411,7 +428,7 @@ const char *fmt_ident(const char *name, const char *email,\n>                         struct passwd *pw;\n>                         if (strict) {\n>                                 if (using_default)\n> -                                       fputs(_(env_hint), stderr);\n> +                                       ident_env_hint(whose_ident);\n>                                 die(_(\"empty ident name (for <%s>) not allowed\"), email);\n>                         }\n>                         pw = xgetpwuid_self(NULL);\n>\n\n"},{"id":"404203","messageId":"xmqq5z9b91o3.fsf_-_@gitster.c.googlers.com","threadId":"54085","inReplyTo":"CAOW=8D3WZyoc=PpyzmPRYM2MT_=F4tnuTxJ0Z+_dHMb4Xk8imQ@mail.gmail.com","subject":"[PATCH] ident: say whose identity is missing when giving user.name hint","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-21T20:36:28Z","receivedAt":"2020-08-21T20:36:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"OK, so here is essentially the same patch but with a bit of cleaning\nup, with a test update and a proposed log message.\n\n-- >8 --\nWhen the author or the committer identity is missing when required,\n\"git\" errors out with a message that suggests to set these\nconfiguration variables at the per-user level as the easiest way\nforward.  This message is given to a brand-new user, whose\n~/.gitconfig hasn't been configured for user.name and user.email,\nwho runs \"git commit --author=...\", too, but such a user may find it\nconfusing (\"why?  I just gave you a name and e-mail\").\n\nState whose identity is missing as the reason why we are erroring\nout, when we give the hint, to help reduce the confusion.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n ident.c                       | 48 ++++++++++++++++++++++-------------\n t/t7518-ident-corner-cases.sh | 13 +++++++++-\n 2 files changed, 43 insertions(+), 18 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex e666ee4e59..813741c06c 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -345,18 +345,32 @@ int split_ident_line(struct ident_split *split, const char *line, int len)\n \treturn 0;\n }\n \n-static const char *env_hint =\n-N_(\"\\n\"\n-   \"*** Please tell me who you are.\\n\"\n-   \"\\n\"\n-   \"Run\\n\"\n-   \"\\n\"\n-   \"  git config --global user.email \\\"you@example.com\\\"\\n\"\n-   \"  git config --global user.name \\\"Your Name\\\"\\n\"\n-   \"\\n\"\n-   \"to set your account\\'s default identity.\\n\"\n-   \"Omit --global to set the identity only in this repository.\\n\"\n-   \"\\n\");\n+\n+static void ident_env_hint(enum want_ident whose_ident)\n+{\n+\tswitch (whose_ident) {\n+\tcase WANT_AUTHOR_IDENT:\n+\t\tfputs(_(\"Author identity unknown\\n\"), stderr);\n+\t\tbreak;\n+\tcase WANT_COMMITTER_IDENT:\n+\t\tfputs(_(\"Committer identity unknown\\n\"), stderr);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n+\tfputs(_(\"\\n\"\n+\t\t\"*** Please tell me who you are.\\n\"\n+\t\t\"\\n\"\n+\t\t\"Run\\n\"\n+\t\t\"\\n\"\n+\t\t\"  git config --global user.email \\\"you@example.com\\\"\\n\"\n+\t\t\"  git config --global user.name \\\"Your Name\\\"\\n\"\n+\t\t\"\\n\"\n+\t\t\"to set your account\\'s default identity.\\n\"\n+\t\t\"Omit --global to set the identity only in this repository.\\n\"\n+\t\t\"\\n\"), stderr);\n+}\n \n const char *fmt_ident(const char *name, const char *email,\n \t\t      enum want_ident whose_ident, const char *date_str, int flag)\n@@ -375,12 +389,12 @@ const char *fmt_ident(const char *name, const char *email,\n \tif (!email) {\n \t\tif (strict && ident_use_config_only\n \t\t    && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n-\t\t\tfputs(_(env_hint), stderr);\n+\t\t\tident_env_hint(whose_ident);\n \t\t\tdie(_(\"no email was given and auto-detection is disabled\"));\n \t\t}\n \t\temail = ident_default_email();\n \t\tif (strict && default_email_is_bogus) {\n-\t\t\tfputs(_(env_hint), stderr);\n+\t\t\tident_env_hint(whose_ident);\n \t\t\tdie(_(\"unable to auto-detect email address (got '%s')\"), email);\n \t\t}\n \t}\n@@ -397,13 +411,13 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tif (!name) {\n \t\t\tif (strict && ident_use_config_only\n \t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n-\t\t\t\tfputs(_(env_hint), stderr);\n+\t\t\t\tident_env_hint(whose_ident);\n \t\t\t\tdie(_(\"no name was given and auto-detection is disabled\"));\n \t\t\t}\n \t\t\tname = ident_default_name();\n \t\t\tusing_default = 1;\n \t\t\tif (strict && default_name_is_bogus) {\n-\t\t\t\tfputs(_(env_hint), stderr);\n+\t\t\t\tident_env_hint(whose_ident);\n \t\t\t\tdie(_(\"unable to auto-detect name (got '%s')\"), name);\n \t\t\t}\n \t\t}\n@@ -411,7 +425,7 @@ const char *fmt_ident(const char *name, const char *email,\n \t\t\tstruct passwd *pw;\n \t\t\tif (strict) {\n \t\t\t\tif (using_default)\n-\t\t\t\t\tfputs(_(env_hint), stderr);\n+\t\t\t\t\tident_env_hint(whose_ident);\n \t\t\t\tdie(_(\"empty ident name (for <%s>) not allowed\"), email);\n \t\t\t}\n \t\t\tpw = xgetpwuid_self(NULL);\ndiff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh\nindex b22f631261..dc3e9c8c88 100755\n--- a/t/t7518-ident-corner-cases.sh\n+++ b/t/t7518-ident-corner-cases.sh\n@@ -29,7 +29,18 @@ test_expect_success 'empty configured name does not auto-detect' '\n \t\tsane_unset GIT_AUTHOR_NAME &&\n \t\ttest_must_fail \\\n \t\t\tgit -c user.name= commit --allow-empty -m foo 2>err &&\n-\t\ttest_i18ngrep \"empty ident name\" err\n+\t\ttest_i18ngrep \"empty ident name\" err &&\n+\t\ttest_i18ngrep \"Author identity unknown\" err\n+\t)\n+'\n+\n+test_expect_success 'empty configured name does not auto-detect for committer' '\n+\t(\n+\t\tsane_unset GIT_COMMITTER_NAME &&\n+\t\ttest_must_fail \\\n+\t\t\tgit -c user.name= commit --allow-empty -m foo 2>err &&\n+\t\ttest_i18ngrep \"empty ident name\" err &&\n+\t\ttest_i18ngrep \"Committer identity unknown\" err\n \t)\n '\n \n-- \n2.28.0-416-g2947c83ecf\n\n"},{"id":"404206","messageId":"CAPig+cR12i8KQjiWYm8DGuAc9BfJqanmNBZcZfwHGsrt2hW3Dw@mail.gmail.com","threadId":"54085","inReplyTo":"xmqq5z9b91o3.fsf_-_@gitster.c.googlers.com","subject":"Re: [PATCH] ident: say whose identity is missing when giving user.name hint","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-08-21T20:52:33Z","receivedAt":"2020-08-21T20:52:48Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Aug 21, 2020 at 4:36 PM Junio C Hamano <gitster@pobox.com> wrote:\n> When the author or the committer identity is missing when required,\n> \"git\" errors out with a message that suggests to set these\n> configuration variables at the per-user level as the easiest way\n> forward.  This message is given to a brand-new user, whose\n> ~/.gitconfig hasn't been configured for user.name and user.email,\n> who runs \"git commit --author=...\", too, but such a user may find it\n> confusing (\"why?  I just gave you a name and e-mail\").\n>\n> State whose identity is missing as the reason why we are erroring\n> out, when we give the hint, to help reduce the confusion.\n\nI had trouble following the first paragraph due to the run-on nature\nof the second sentence. Perhaps the entire message could be rewritten\nsomething like this:\n\n    If `user.name` and `user.email` have not been configured and the\n    user invokes:\n\n        git commit --author=...\n\n    without without specifying `--committer=`, then Git errors out\n    with a message asking the user to configure `user.name` and\n    `user.email` but doesn't tell the user which attribution was\n    missing. This can be confusing for a user new to Git who isn't\n    aware of the distinction between user, author, and committer.\n    Give such users a bit more help by extending the error message to\n    also say which attribution is expected.\n"},{"id":"404216","messageId":"xmqq1rjz8zy7.fsf@gitster.c.googlers.com","threadId":"54085","inReplyTo":"CAPig+cR12i8KQjiWYm8DGuAc9BfJqanmNBZcZfwHGsrt2hW3Dw@mail.gmail.com","subject":"Re: [PATCH] ident: say whose identity is missing when giving user.name hint","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-21T21:13:36Z","receivedAt":"2020-08-21T21:13:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n>     If `user.name` and `user.email` have not been configured and the\n>     user invokes:\n>\n>         git commit --author=...\n>\n>     without without specifying `--committer=`, then Git errors out\n>     with a message asking the user to configure `user.name` and\n>     `user.email` but doesn't tell the user which attribution was\n>     missing. This can be confusing for a user new to Git who isn't\n>     aware of the distinction between user, author, and committer.\n>     Give such users a bit more help by extending the error message to\n>     also say which attribution is expected.\n\nMuch easier to read.  Will steal.\n"},{"id":"404218","messageId":"CAOW=8D1nFgRRPyD7yxW2X7ZcAA3yaMzWJy7B3ykuPBJk3t8X5Q@mail.gmail.com","threadId":"54085","inReplyTo":"xmqq1rjz8zy7.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] ident: say whose identity is missing when giving user.name hint","fromName":"Alvaro Aleman","fromEmail":"aaleman@redhat.com","sentAt":"2020-08-21T21:31:33Z","receivedAt":"2020-08-21T21:31:52Z","isPatch":true,"sender":{"key":"aaleman@redhat.com","avatar":null},"body":"One nit though: There is no `--committer` flag for `git commit`,\nunless this has changed after the v2.28.0 release:\n\n```\n$ g commit -m message --committer someone@somemail.com\nerror: unknown option `committer'\n$ git --version\ngit version 2.28.0\n```\n\nOn Fri, Aug 21, 2020 at 5:13 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n>\n> >     If `user.name` and `user.email` have not been configured and the\n> >     user invokes:\n> >\n> >         git commit --author=...\n> >\n> >     without without specifying `--committer=`, then Git errors out\n> >     with a message asking the user to configure `user.name` and\n> >     `user.email` but doesn't tell the user which attribution was\n> >     missing. This can be confusing for a user new to Git who isn't\n> >     aware of the distinction between user, author, and committer.\n> >     Give such users a bit more help by extending the error message to\n> >     also say which attribution is expected.\n>\n> Much easier to read.  Will steal.\n>\n\n"},{"id":"404220","messageId":"CAPig+cSLxRVufZcnXa6JAbP-SYX486OebDS5hYjEhH7jaNgM5Q@mail.gmail.com","threadId":"54085","inReplyTo":"CAOW=8D1nFgRRPyD7yxW2X7ZcAA3yaMzWJy7B3ykuPBJk3t8X5Q@mail.gmail.com","subject":"Re: [PATCH] ident: say whose identity is missing when giving user.name hint","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-08-21T21:37:58Z","receivedAt":"2020-08-21T21:38:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Aug 21, 2020 at 5:31 PM Alvaro Aleman <aaleman@redhat.com> wrote:\n> One nit though: There is no `--committer` flag for `git commit`,\n\nIndeed, that `--committer=` was a last-second edit (without checking\ndocs). How about this?\n\n    If `user.name` and `user.email` have not been configured and the\n    user invokes:\n\n        git commit --author=...\n\n    without specifying the committer, then Git errors out with a\n    message asking the user to configure `user.name` and `user.email`\n    but doesn't tell the user which attribution was missing. This can\n    be confusing for a user new to Git who isn't aware of the\n    distinction between user, author, and committer.  Give such users\n    a bit more help by extending the error message to also say which\n    attribution is expected.\n"},{"id":"404243","messageId":"xmqqblj37hlv.fsf@gitster.c.googlers.com","threadId":"54085","inReplyTo":"CAPig+cSLxRVufZcnXa6JAbP-SYX486OebDS5hYjEhH7jaNgM5Q@mail.gmail.com","subject":"Re: [PATCH] ident: say whose identity is missing when giving user.name hint","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-21T22:35:08Z","receivedAt":"2020-08-21T22:35:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Fri, Aug 21, 2020 at 5:31 PM Alvaro Aleman <aaleman@redhat.com> wrote:\n>> One nit though: There is no `--committer` flag for `git commit`,\n>\n> Indeed, that `--committer=` was a last-second edit (without checking\n> docs).\n\nYeah, I forgot that we deliberately omit the command line option for\nthe committer info.\n\n> How about this?\n>\n>     If `user.name` and `user.email` have not been configured and the\n>     user invokes:\n>\n>         git commit --author=...\n>\n>     without specifying the committer, then Git errors out with a\n>     message asking the user to configure `user.name` and `user.email`\n>     but doesn't tell the user which attribution was missing. This can\n>     be confusing for a user new to Git who isn't aware of the\n>     distinction between user, author, and committer.  Give such users\n>     a bit more help by extending the error message to also say which\n>     attribution is expected.\n\nOK.\n"}]}