{"thread":{"id":"49329","subject":"[RFC PATCH 0/1] builtin/remote: quote remote name on error to display empty name","startedAt":"2018-09-12T14:45:52Z","lastAt":"2018-09-12T21:28:20Z","messageCount":4,"participants":["Shulhan","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"357970","messageId":"20180912144504.7498-1-m.shulhan@gmail.com","threadId":"49329","inReplyTo":null,"subject":"[RFC PATCH 0/1] builtin/remote: quote remote name on error to display empty name","fromName":"Shulhan","fromEmail":"m.shulhan@gmail.com","sentAt":"2018-09-12T14:45:03Z","receivedAt":"2018-09-12T14:45:52Z","isPatch":true,"sender":{"key":"m.shulhan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43306?v=4"},"body":"Rationale: consistent error format\n\nWhen adding new remote name with empty string, git will print the\nfollowing error message,\n\n  fatal: '' is not a valid remote name\\n\n\nBut when removing remote name with empty string as input, git did not\nprint the empty string with quote,\n\n  fatal: No such remote: \\n\n\nFollow up question: If this is ok, should the po files also updated?\n\nThis is my first patch, sorry if I did some mistakes.\n\nShulhan (1):\n  builtin/remote: quote remote name on error to display empty name\n\n builtin/remote.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n-- \n2.19.0.398.gef7f67bed\n\n"},{"id":"357971","messageId":"20180912144504.7498-2-m.shulhan@gmail.com","threadId":"49329","inReplyTo":"20180912144504.7498-1-m.shulhan@gmail.com","subject":"[RFC PATCH 1/1] builtin/remote: quote remote name on error to display empty name","fromName":"Shulhan","fromEmail":"m.shulhan@gmail.com","sentAt":"2018-09-12T14:45:04Z","receivedAt":"2018-09-12T14:46:19Z","isPatch":true,"sender":{"key":"m.shulhan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43306?v=4"},"body":"Rationale: consistent error format\n\nWhen adding new remote name with empty string, git will print the\nfollowing error message,\n\n  fatal: '' is not a valid remote name\\n\n\nBut when removing remote name with empty string as input, git did not\nprint the empty string with quote,\n\n  fatal: No such remote: \\n\n---\n builtin/remote.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 40c6f8a1b..f7edf7f2c 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -626,7 +626,7 @@ static int mv(int argc, const char **argv)\n \n \toldremote = remote_get(rename.old_name);\n \tif (!remote_is_configured(oldremote, 1))\n-\t\tdie(_(\"No such remote: %s\"), rename.old_name);\n+\t\tdie(_(\"No such remote: '%s'\"), rename.old_name);\n \n \tif (!strcmp(rename.old_name, rename.new_name) && oldremote->origin != REMOTE_CONFIG)\n \t\treturn migrate_file(oldremote);\n@@ -762,7 +762,7 @@ static int rm(int argc, const char **argv)\n \n \tremote = remote_get(argv[1]);\n \tif (!remote_is_configured(remote, 1))\n-\t\tdie(_(\"No such remote: %s\"), argv[1]);\n+\t\tdie(_(\"No such remote: '%s'\"), argv[1]);\n \n \tknown_remotes.to_delete = remote;\n \tfor_each_remote(add_known_remote, &known_remotes);\n@@ -861,7 +861,7 @@ static int get_remote_ref_states(const char *name,\n \n \tstates->remote = remote_get(name);\n \tif (!states->remote)\n-\t\treturn error(_(\"No such remote: %s\"), name);\n+\t\treturn error(_(\"No such remote: '%s'\"), name);\n \n \tread_branches();\n \n-- \n2.19.0.398.gef7f67bed\n\n"},{"id":"357981","messageId":"xmqqftyen0w8.fsf@gitster-ct.c.googlers.com","threadId":"49329","inReplyTo":"20180912144504.7498-1-m.shulhan@gmail.com","subject":"Re: [RFC PATCH 0/1] builtin/remote: quote remote name on error to display empty name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-12T16:20:07Z","receivedAt":"2018-09-12T16:20:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shulhan <m.shulhan@gmail.com> writes:\n\n> Rationale: consistent error format\n>\n> When adding new remote name with empty string, git will print the\n> following error message,\n>\n>   fatal: '' is not a valid remote name\\n\n>\n> But when removing remote name with empty string as input, git did not\n> print the empty string with quote,\n>\n>   fatal: No such remote: \\n\n\nThanks for noticing.  I think the consistency given by the patch 1/1\nis good.\n\n> Follow up question: If this is ok, should the po files also updated?\n\nThey should be updated, but not by you and not as part of this\nchange.  The po files will be updated by our l10n coordinator,\ntypically when it gets close to the release time, for all the\nmessage changes done during the release cycle.\n\nThanks.\n\n"},{"id":"358011","messageId":"xmqqlg86jths.fsf@gitster-ct.c.googlers.com","threadId":"49329","inReplyTo":"20180912144504.7498-2-m.shulhan@gmail.com","subject":"Re: [RFC PATCH 1/1] builtin/remote: quote remote name on error to display empty name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-12T21:28:15Z","receivedAt":"2018-09-12T21:28:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shulhan <m.shulhan@gmail.com> writes:\n\n> Rationale: consistent error format\n\nYou can and should drop this line.\n\n> When adding new remote name with empty string, git will print the\n> following error message,\n>\n>   fatal: '' is not a valid remote name\\n\n>\n> But when removing remote name with empty string as input, git did not\n> print the empty string with quote,\n\n\"git shows the empty string without quote\" would be easier to\nunderstand which part of the behaviour you are disturbed by.\n\n>   fatal: No such remote: \\n\n\nAfter stating the above observation, you can say something like\n\n\tTo make these error messages consistent, quote the name of\n\tthe remote that we tried and failed to find.\n\nat the end.\n\n> ---\n\nNeeds sign-off.  See Documentation/SubmittingPatches.\n\n>  builtin/remote.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/builtin/remote.c b/builtin/remote.c\n> index 40c6f8a1b..f7edf7f2c 100644\n> --- a/builtin/remote.c\n> +++ b/builtin/remote.c\n> @@ -626,7 +626,7 @@ static int mv(int argc, const char **argv)\n>  \n>  \toldremote = remote_get(rename.old_name);\n>  \tif (!remote_is_configured(oldremote, 1))\n> -\t\tdie(_(\"No such remote: %s\"), rename.old_name);\n> +\t\tdie(_(\"No such remote: '%s'\"), rename.old_name);\n>  \n>  \tif (!strcmp(rename.old_name, rename.new_name) && oldremote->origin != REMOTE_CONFIG)\n>  \t\treturn migrate_file(oldremote);\n> @@ -762,7 +762,7 @@ static int rm(int argc, const char **argv)\n>  \n>  \tremote = remote_get(argv[1]);\n>  \tif (!remote_is_configured(remote, 1))\n> -\t\tdie(_(\"No such remote: %s\"), argv[1]);\n> +\t\tdie(_(\"No such remote: '%s'\"), argv[1]);\n>  \n>  \tknown_remotes.to_delete = remote;\n>  \tfor_each_remote(add_known_remote, &known_remotes);\n> @@ -861,7 +861,7 @@ static int get_remote_ref_states(const char *name,\n>  \n>  \tstates->remote = remote_get(name);\n>  \tif (!states->remote)\n> -\t\treturn error(_(\"No such remote: %s\"), name);\n> +\t\treturn error(_(\"No such remote: '%s'\"), name);\n>  \n>  \tread_branches();\n"}]}