{"thread":{"id":"41878","subject":"[PATCH 2/2] ident: make the useConfigOnly error messages more informative","startedAt":"2016-03-30T19:29:42Z","lastAt":"2016-04-12T23:19:30Z","messageCount":10,"participants":["Marios Titas","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"282263","messageId":"1459366183-15451-1-git-send-email-redneb@gmx.com","threadId":"41878","inReplyTo":null,"subject":"[PATCH 1/2] ident: check for useConfigOnly before auto-detection of name/email","fromName":"Marios Titas","fromEmail":"redneb@gmx.com","sentAt":"2016-03-30T19:29:42Z","receivedAt":"2016-03-30T19:29:42Z","isPatch":true,"sender":{"key":"redneb@gmx.com","avatar":"https://avatars.githubusercontent.com/u/382627?v=4"},"body":"If user.useConfigOnly is set, it does not make sense to try to\nauto-detect the name and/or the email. So it's better to do the\nuseConfigOnly checks first.\n\nSigned-off-by: Marios Titas <redneb@gmx.com>\n---\n ident.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 6e12582..74b2663 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -351,15 +351,15 @@ const char *fmt_ident(const char *name, const char *email,\n \tif (want_name) {\n \t\tint using_default = 0;\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\tdie(\"user.useConfigOnly set but no name given\");\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\tdie(\"unable to auto-detect name (got '%s')\", name);\n \t\t\t}\n-\t\t\tif (strict && ident_use_config_only\n-\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN))\n-\t\t\t\tdie(\"user.useConfigOnly set but no name given\");\n \t\t}\n \t\tif (!*name) {\n \t\t\tstruct passwd *pw;\n@@ -374,14 +374,14 @@ const char *fmt_ident(const char *name, const char *email,\n \t}\n \n \tif (!email) {\n+\t\tif (strict && ident_use_config_only\n+\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n+\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n \t\temail = ident_default_email();\n \t\tif (strict && default_email_is_bogus) {\n \t\t\tfputs(env_hint, stderr);\n \t\t\tdie(\"unable to auto-detect email address (got '%s')\", email);\n \t\t}\n-\t\tif (strict && ident_use_config_only\n-\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n-\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n \t}\n \n \tstrbuf_reset(&ident);\n-- \n2.8.0\n"},{"id":"282262","messageId":"1459366183-15451-2-git-send-email-redneb@gmx.com","threadId":"41878","inReplyTo":"1459366183-15451-1-git-send-email-redneb@gmx.com","subject":"[PATCH 2/2] ident: make the useConfigOnly error messages more informative","fromName":"Marios Titas","fromEmail":"redneb@gmx.com","sentAt":"2016-03-30T19:29:43Z","receivedAt":"2016-03-30T19:29:43Z","isPatch":true,"sender":{"key":"redneb@gmx.com","avatar":"https://avatars.githubusercontent.com/u/382627?v=4"},"body":"The env_hint message applies perfectly to the case when\nuser.useConfigOnly is set and at least one of the user.name and the\nuser.email are not provided. Additionally, use a more descriptive error\nmessage when that happens.\n\nSigned-off-by: Marios Titas <redneb@gmx.com>\n---\n ident.c | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 74b2663..4fd82d1 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -352,8 +352,10 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tint using_default = 0;\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\tdie(\"user.useConfigOnly set but no name given\");\n+\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n+\t\t\t\tfputs(env_hint, stderr);\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@@ -375,8 +377,10 @@ const char *fmt_ident(const char *name, const char *email,\n \n \tif (!email) {\n \t\tif (strict && ident_use_config_only\n-\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n-\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n+\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n+\t\t\tfputs(env_hint, stderr);\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-- \n2.8.0\n"},{"id":"282278","messageId":"xmqqlh4zr492.fsf@gitster.mtv.corp.google.com","threadId":"41878","inReplyTo":"1459366183-15451-2-git-send-email-redneb@gmx.com","subject":"Re: [PATCH 2/2] ident: make the useConfigOnly error messages more informative","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-30T22:27:05Z","receivedAt":"2016-03-30T22:27:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marios Titas <redneb@gmx.com> writes:\n\n> -\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN))\n> -\t\t\t\tdie(\"user.useConfigOnly set but no name given\");\n> +\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n> +\t\t\t\tfputs(env_hint, stderr);\n> +\t\t\t\tdie(\"no name was given and auto-detection is disabled\n\nHmph.  I do not think that this is making the message \"more\ninformative\".\n\nWhen a user hits this error, the old message allowed the user to\neasily see how to toggle the \"disable auto-detection\" bit off to let\nthe code continue by telling the name of the configuration, but the\nupdated message hides that name, making it harder for the user to\ndisable the disabling of auto-detection.\n\nI can buy the argument that this change helps the user by making the\nmessage \"less\" informative, though.  By discouraging the users from\ntoggling the user.useConfigOnly bit off, it indirectly makes the\nother option to work around this error condition, i.e. giving a name\nmore explicitly, more appetizing.\n"},{"id":"282279","messageId":"20160330232552.GA31861@zeno","threadId":"41878","inReplyTo":"xmqqlh4zr492.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/2] ident: make the useConfigOnly error messages more informative","fromName":"Marios Titas","fromEmail":"redneb@gmx.com","sentAt":"2016-03-30T23:25:52Z","receivedAt":"2016-03-30T23:25:52Z","isPatch":true,"sender":{"key":"redneb@gmx.com","avatar":"https://avatars.githubusercontent.com/u/382627?v=4"},"body":"On Wed, Mar 30, 2016 at 03:27:05PM -0700, Junio C Hamano wrote:\n>Marios Titas <redneb@gmx.com> writes:\n>\n>> -\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN))\n>> -\t\t\t\tdie(\"user.useConfigOnly set but no name given\");\n>> +\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n>> +\t\t\t\tfputs(env_hint, stderr);\n>> +\t\t\t\tdie(\"no name was given and auto-detection is disabled\n>\n>Hmph.  I do not think that this is making the message \"more\n>informative\".\n>\n>When a user hits this error, the old message allowed the user to\n>easily see how to toggle the \"disable auto-detection\" bit off to let\n>the code continue by telling the name of the configuration, but the\n>updated message hides that name, making it harder for the user to\n>disable the disabling of auto-detection.\n>\n>I can buy the argument that this change helps the user by making the\n>message \"less\" informative, though.  By discouraging the users from\n>toggling the user.useConfigOnly bit off, it indirectly makes the\n>other option to work around this error condition, i.e. giving a name\n>more explicitly, more appetizing.\n\nYeah, maybe informative is not the right word. What I meant is that it \ndirects the user to do the \"git config user.name\" thing, which is likely \nthe most appropriate course of action in this situation. In any event, I \nthink printing the env_hint message would be really helpful in this \ncase.\n"},{"id":"282315","messageId":"20160331144003.GE31116@sigill.intra.peff.net","threadId":"41878","inReplyTo":"1459366183-15451-1-git-send-email-redneb@gmx.com","subject":"Re: [PATCH 1/2] ident: check for useConfigOnly before auto-detection of name/email","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-31T14:40:03Z","receivedAt":"2016-03-31T14:40:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Mar 30, 2016 at 10:29:42PM +0300, Marios Titas wrote:\n\n> If user.useConfigOnly is set, it does not make sense to try to\n> auto-detect the name and/or the email. So it's better to do the\n> useConfigOnly checks first.\n\nIt might be nice to explain how it is better here. I'd guess it is\nbecause we may fail during xgetpwuid(), giving a message that is much\nless informative?\n\n> @@ -374,14 +374,14 @@ const char *fmt_ident(const char *name, const char *email,\n>  \t}\n>  \n>  \tif (!email) {\n> +\t\tif (strict && ident_use_config_only\n> +\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n> +\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n>  \t\temail = ident_default_email();\n>  \t\tif (strict && default_email_is_bogus) {\n>  \t\t\tfputs(env_hint, stderr);\n>  \t\t\tdie(\"unable to auto-detect email address (got '%s')\", email);\n>  \t\t}\n> -\t\tif (strict && ident_use_config_only\n> -\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n> -\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n>  \t}\n\nI wondered on this hunk whether ident_default_email() could ever set the\nIDENT_MAIL_GIVEN flag. It _does_ set it, but only for\n\"explicitly_given\", not for \"config_given\", which makes sense.\n\nSo I think this is doing the right thing.\n\n-Peff\n"},{"id":"282320","messageId":"20160331150109.GA7235@zeno","threadId":"41878","inReplyTo":"20160331144003.GE31116@sigill.intra.peff.net","subject":"Re: [PATCH 1/2] ident: check for useConfigOnly before auto-detection of name/email","fromName":"Marios Titas","fromEmail":"redneb@gmx.com","sentAt":"2016-03-31T15:01:09Z","receivedAt":"2016-03-31T15:01:09Z","isPatch":true,"sender":{"key":"redneb@gmx.com","avatar":"https://avatars.githubusercontent.com/u/382627?v=4"},"body":"On Thu, Mar 31, 2016 at 10:40:03AM -0400, Jeff King wrote:\n>On Wed, Mar 30, 2016 at 10:29:42PM +0300, Marios Titas wrote:\n>\n>> If user.useConfigOnly is set, it does not make sense to try to\n>> auto-detect the name and/or the email. So it's better to do the\n>> useConfigOnly checks first.\n>\n>It might be nice to explain how it is better here. I'd guess it is\n>because we may fail during xgetpwuid(), giving a message that is much\n>less informative?\n\nOops sorry, my bad, I should have included an example in the commit \nmessage. So with git 2.8.0, if you provide a name and set useConfigOnly \nto true in your ~/.gitconfig file, then if try to commit something in a \nnew git repo, it will fail with the following message:\n\n    *** Please tell me who you are.\n    \n    Run\n    \n      git config --global user.email \"you@example.com\"\n      git config --global user.name \"Your Name\"\n    \n    to set your account's default identity.\n    Omit --global to set the identity only in this repository.\n    \n    fatal: unable to auto-detect email address (got 'XXX@YYY.(none)')\n\n(provided of course that auto-detection of email fails). This wrong, \nbecause auto-detection is disabled anyway.\n"},{"id":"282335","messageId":"20160331163156.GA1189@sigill.intra.peff.net","threadId":"41878","inReplyTo":"20160331150109.GA7235@zeno","subject":"Re: [PATCH 1/2] ident: check for useConfigOnly before auto-detection of name/email","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-31T16:31:56Z","receivedAt":"2016-03-31T16:31:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 31, 2016 at 06:01:09PM +0300, Marios Titas wrote:\n\n> On Thu, Mar 31, 2016 at 10:40:03AM -0400, Jeff King wrote:\n> >On Wed, Mar 30, 2016 at 10:29:42PM +0300, Marios Titas wrote:\n> >\n> >>If user.useConfigOnly is set, it does not make sense to try to\n> >>auto-detect the name and/or the email. So it's better to do the\n> >>useConfigOnly checks first.\n> >\n> >It might be nice to explain how it is better here. I'd guess it is\n> >because we may fail during xgetpwuid(), giving a message that is much\n> >less informative?\n> \n> Oops sorry, my bad, I should have included an example in the commit message.\n> So with git 2.8.0, if you provide a name and set useConfigOnly to true in\n> your ~/.gitconfig file, then if try to commit something in a new git repo,\n> it will fail with the following message:\n> \n>    *** Please tell me who you are.\n>    Run\n>      git config --global user.email \"you@example.com\"\n>      git config --global user.name \"Your Name\"\n>    to set your account's default identity.\n>    Omit --global to set the identity only in this repository.\n>    fatal: unable to auto-detect email address (got 'XXX@YYY.(none)')\n> \n> (provided of course that auto-detection of email fails). This wrong, because\n> auto-detection is disabled anyway.\n\nAh, right. We used to die in xgetpwuid, but now we just set\ndefault_name_is_bogus. So I think bumping the use_config_only check\nabove the name_is_bogus check would be sufficient. Where you put it\n(above ident_default_name) is fine, though it would be a problem if we\nlater lazily loaded the config in that function (I don't have any\nparticular plans to do so, though).\n\n-Peff\n"},{"id":"282505","messageId":"xmqqr3epgfar.fsf@gitster.mtv.corp.google.com","threadId":"41878","inReplyTo":"20160331150109.GA7235@zeno","subject":"Re: [PATCH 1/2] ident: check for useConfigOnly before auto-detection of name/email","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-01T22:00:44Z","receivedAt":"2016-04-01T22:00:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marios Titas <redneb@gmx.com> writes:\n\n> On Thu, Mar 31, 2016 at 10:40:03AM -0400, Jeff King wrote:\n>>On Wed, Mar 30, 2016 at 10:29:42PM +0300, Marios Titas wrote:\n>>\n>>> If user.useConfigOnly is set, it does not make sense to try to\n>>> auto-detect the name and/or the email. So it's better to do the\n>>> useConfigOnly checks first.\n>>\n>>It might be nice to explain how it is better here. I'd guess it is\n>>because we may fail during xgetpwuid(), giving a message that is much\n>>less informative?\n>\n> Oops sorry, my bad, I should have included an example in the commit\n> message. So with git 2.8.0, if you provide a name and set\n> useConfigOnly to true in your ~/.gitconfig file, then if try to commit\n> something in a new git repo, it will fail with the following message:\n>\n>    *** Please tell me who you are.\n>     Run\n>       git config --global user.email \"you@example.com\"\n>      git config --global user.name \"Your Name\"\n>     to set your account's default identity.\n>    Omit --global to set the identity only in this repository.\n>     fatal: unable to auto-detect email address (got 'XXX@YYY.(none)')\n>\n> (provided of course that auto-detection of email fails). This wrong,\n> because auto-detection is disabled anyway.\n\nOK, let's do this, then.\n\n-- >8 --\nFrom: Marios Titas <redneb@gmx.com>\nDate: Wed, 30 Mar 2016 22:29:42 +0300\nSubject: [PATCH] ident: check for useConfigOnly before auto-detection of\n name/email\n\nIf user.useConfigOnly is set, it does not make sense to try to\nauto-detect the name and/or the email.  The auto-detection may\neven result in a bogus name and trigger an error message.\n\nCheck if the use-config-only is set and die if no explicit name was\ngiven, before attempting to auto-detect, to correct this.\n\nSigned-off-by: Marios Titas <redneb@gmx.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n ident.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 4bd8084..b2521ff 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -351,15 +351,15 @@ const char *fmt_ident(const char *name, const char *email,\n \tif (want_name) {\n \t\tint using_default = 0;\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\tdie(\"user.useConfigOnly set but no name given\");\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\tdie(\"unable to auto-detect name (got '%s')\", name);\n \t\t\t}\n-\t\t\tif (strict && ident_use_config_only\n-\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN))\n-\t\t\t\tdie(\"user.useConfigOnly set but no name given\");\n \t\t}\n \t\tif (!*name) {\n \t\t\tstruct passwd *pw;\n@@ -374,14 +374,14 @@ const char *fmt_ident(const char *name, const char *email,\n \t}\n \n \tif (!email) {\n+\t\tif (strict && ident_use_config_only\n+\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n+\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n \t\temail = ident_default_email();\n \t\tif (strict && default_email_is_bogus) {\n \t\t\tfputs(env_hint, stderr);\n \t\t\tdie(\"unable to auto-detect email address (got '%s')\", email);\n \t\t}\n-\t\tif (strict && ident_use_config_only\n-\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n-\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n \t}\n \n \tstrbuf_reset(&ident);\n-- \n2.8.0-246-g1783343\n"},{"id":"282506","messageId":"xmqqmvpdgf4n.fsf@gitster.mtv.corp.google.com","threadId":"41878","inReplyTo":"20160330232552.GA31861@zeno","subject":"Re: [PATCH 2/2] ident: make the useConfigOnly error messages more informative","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-01T22:04:24Z","receivedAt":"2016-04-01T22:04:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marios Titas <redneb@gmx.com> writes:\n\n> Yeah, maybe informative is not the right word. What I meant is that it\n> directs the user to do the \"git config user.name\" thing, which is\n> likely the most appropriate course of action in this situation. In any\n> event, I think printing the env_hint message would be really helpful\n> in this case.\n\nOK, let's do this, then.\n\nThanks.\n\n-- >8 --\nFrom: Marios Titas <redneb@gmx.com>\nDate: Wed, 30 Mar 2016 22:29:43 +0300\nSubject: [PATCH] ident: give \"please tell me\" message upon useConfigOnly error\n\nThe env_hint message applies perfectly to the case when\nuser.useConfigOnly is set and at least one of the user.name and the\nuser.email are not provided.\n\nAdditionally, use a less descriptive error message to discourage\nusers from disabling user.useConfigOnly configuration variable to\nwork around this error condition.  We want to encourage them to set\nuser.name or user.email instead.\n\nSigned-off-by: Marios Titas <redneb@gmx.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n ident.c | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex b2521ff..c766127 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -352,8 +352,10 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tint using_default = 0;\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\tdie(\"user.useConfigOnly set but no name given\");\n+\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n+\t\t\t\tfputs(env_hint, stderr);\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@@ -375,8 +377,10 @@ const char *fmt_ident(const char *name, const char *email,\n \n \tif (!email) {\n \t\tif (strict && ident_use_config_only\n-\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n-\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n+\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n+\t\t\tfputs(env_hint, stderr);\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-- \n2.8.0-246-g1783343\n"},{"id":"283245","messageId":"xmqq37qqo1od.fsf@gitster.mtv.corp.google.com","threadId":"41878","inReplyTo":"xmqqmvpdgf4n.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/2] ident: make the useConfigOnly error messages more informative","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-12T23:19:30Z","receivedAt":"2016-04-12T23:19:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Marios Titas <redneb@gmx.com> writes:\n>\n>> Yeah, maybe informative is not the right word. What I meant is that it\n>> directs the user to do the \"git config user.name\" thing, which is\n>> likely the most appropriate course of action in this situation. In any\n>> event, I think printing the env_hint message would be really helpful\n>> in this case.\n>\n> OK, let's do this, then.\n>\n> Thanks.\n\nA friendly ping asking for an Ack.\n\n> -- >8 --\n> From: Marios Titas <redneb@gmx.com>\n> Date: Wed, 30 Mar 2016 22:29:43 +0300\n> Subject: [PATCH] ident: give \"please tell me\" message upon useConfigOnly error\n>\n> The env_hint message applies perfectly to the case when\n> user.useConfigOnly is set and at least one of the user.name and the\n> user.email are not provided.\n>\n> Additionally, use a less descriptive error message to discourage\n> users from disabling user.useConfigOnly configuration variable to\n> work around this error condition.  We want to encourage them to set\n> user.name or user.email instead.\n>\n> Signed-off-by: Marios Titas <redneb@gmx.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  ident.c | 12 ++++++++----\n>  1 file changed, 8 insertions(+), 4 deletions(-)\n>\n> diff --git a/ident.c b/ident.c\n> index b2521ff..c766127 100644\n> --- a/ident.c\n> +++ b/ident.c\n> @@ -352,8 +352,10 @@ const char *fmt_ident(const char *name, const char *email,\n>  \t\tint using_default = 0;\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\tdie(\"user.useConfigOnly set but no name given\");\n> +\t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n> +\t\t\t\tfputs(env_hint, stderr);\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> @@ -375,8 +377,10 @@ const char *fmt_ident(const char *name, const char *email,\n>  \n>  \tif (!email) {\n>  \t\tif (strict && ident_use_config_only\n> -\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN))\n> -\t\t\tdie(\"user.useConfigOnly set but no mail given\");\n> +\t\t    && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n> +\t\t\tfputs(env_hint, stderr);\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"}]}