{"thread":{"id":"59236","subject":"[GSoC][PATCH] builtin/clean.c: fix error message usage typo","startedAt":"2023-02-14T03:25:52Z","lastAt":"2023-02-14T22:13:07Z","messageCount":5,"participants":["Shuqi Liang","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"472042","messageId":"20230214032534.507628-1-cheskaqiqi@gmail.com","threadId":"59236","inReplyTo":null,"subject":"[GSoC][PATCH] builtin/clean.c: fix error message usage typo","fromName":"Shuqi Liang","fromEmail":"cheskaqiqi@gmail.com","sentAt":"2023-02-14T03:25:34Z","receivedAt":"2023-02-14T03:25:52Z","isPatch":true,"sender":{"key":"cheskaqiqi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109261504?v=4"},"body":"As Documentation/CodingGuidelines says, we shouldn't capitalize the first\nword in error message. Change the capital letter to lowercase letter.\n\nSigned-off-by: Shuqi Liang <cheskaqiqi@gmail.com>\n---\n builtin/clean.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex b2701a2815..e6ce776001 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -30,14 +30,14 @@ static const char *const builtin_clean_usage[] = {\n \tNULL\n };\n \n-static const char *msg_remove = N_(\"Removing %s\\n\");\n-static const char *msg_would_remove = N_(\"Would remove %s\\n\");\n-static const char *msg_skip_git_dir = N_(\"Skipping repository %s\\n\");\n-static const char *msg_would_skip_git_dir = N_(\"Would skip repository %s\\n\");\n+static const char *msg_remove = N_(\"removing %s\\n\");\n+static const char *msg_would_remove = N_(\"would remove %s\\n\");\n+static const char *msg_skip_git_dir = N_(\"skipping repository %s\\n\");\n+static const char *msg_would_skip_git_dir = N_(\"would skip repository %s\\n\");\n static const char *msg_warn_remove_failed = N_(\"failed to remove %s\");\n static const char *msg_warn_lstat_failed = N_(\"could not lstat %s\\n\");\n-static const char *msg_skip_cwd = N_(\"Refusing to remove current working directory\\n\");\n-static const char *msg_would_skip_cwd = N_(\"Would refuse to remove current working directory\\n\");\n+static const char *msg_skip_cwd = N_(\"refusing to remove current working directory\\n\");\n+static const char *msg_would_skip_cwd = N_(\"would refuse to remove current working directory\\n\");\n \n enum color_clean {\n \tCLEAN_COLOR_RESET = 0,\n-- \n2.39.0\n\n"},{"id":"472045","messageId":"xmqqbklw95in.fsf@gitster.g","threadId":"59236","inReplyTo":"20230214032534.507628-1-cheskaqiqi@gmail.com","subject":"Re: [GSoC][PATCH] builtin/clean.c: fix error message usage typo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-02-14T05:32:00Z","receivedAt":"2023-02-14T05:32:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shuqi Liang <cheskaqiqi@gmail.com> writes:\n\n> As Documentation/CodingGuidelines says, we shouldn't capitalize the first\n> word in error message. Change the capital letter to lowercase letter.\n\nI think the \"do not caplitalize\" rule is about the sentence after\n\"fatal:\", \"error:\", \"warning:\", and \"info:\" labels.\n\n> -static const char *msg_remove = N_(\"Removing %s\\n\");\n> -static const char *msg_would_remove = N_(\"Would remove %s\\n\");\n> -static const char *msg_skip_git_dir = N_(\"Skipping repository %s\\n\");\n> -static const char *msg_would_skip_git_dir = N_(\"Would skip repository %s\\n\");\n> -static const char *msg_skip_cwd = N_(\"Refusing to remove current working directory\\n\");\n> -static const char *msg_would_skip_cwd = N_(\"Would refuse to remove current working directory\\n\");\n\nDo any of these messages come after any of these labels?  I didn't\nthink so.\n\n>  static const char *msg_warn_remove_failed = N_(\"failed to remove %s\");\n>  static const char *msg_warn_lstat_failed = N_(\"could not lstat %s\\n\");\n\nThese do appear after \"warning:\" and downcasing is very much\nappropriate.\n\nThanks.\n"},{"id":"472084","messageId":"CAMO4yUHWJGB1SiqMK5dwb6q84DuavNWBx1JVjGk2f3_bqYYioA@mail.gmail.com","threadId":"59236","inReplyTo":"xmqqbklw95in.fsf@gitster.g","subject":"Re: [GSoC][PATCH] builtin/clean.c: fix error message usage typo","fromName":"Shuqi Liang","fromEmail":"cheskaqiqi@gmail.com","sentAt":"2023-02-14T21:55:33Z","receivedAt":"2023-02-14T21:55:51Z","isPatch":true,"sender":{"key":"cheskaqiqi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109261504?v=4"},"body":"Hi Junio\n\nOn Tue, Feb 14, 2023 at 12:32 AM Junio C Hamano <gitster@pobox.com> wrote:\n\n\n> I think the \"do not caplitalize\" rule is about the sentence after\n> \"fatal:\", \"error:\", \"warning:\", and \"info:\" labels.\n\nThanks, sorry for misunderstanding the \"error message \". Will go and\nfind another that meets the requirements.\n-------------------\nThanks\n\n\nShuqi\n"},{"id":"472085","messageId":"20230214215403.1450903-1-cheskaqiqi@gmail.com","threadId":"59236","inReplyTo":"20230214032534.507628-1-cheskaqiqi@gmail.com","subject":"[PATCH v2] builtin/*: fix error message usage typo","fromName":"Shuqi Liang","fromEmail":"cheskaqiqi@gmail.com","sentAt":"2023-02-14T21:54:03Z","receivedAt":"2023-02-14T21:56:03Z","isPatch":true,"sender":{"key":"cheskaqiqi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109261504?v=4"},"body":"As Documentation/CodingGuidelines says, we shouldn't capitalize the\nfirst word in error message.\nChange the capital letter to lowercase letter.\n\nSigned-off-by: Shuqi Liang <cheskaqiqi@gmail.com>\n---\n builtin/merge-base.c        |  6 +++---\n builtin/remote-fd.c         | 10 ++++-----\n builtin/submodule--helper.c | 42 ++++++++++++++++++-------------------\n 3 files changed, 29 insertions(+), 29 deletions(-)\n\ndiff --git a/builtin/merge-base.c b/builtin/merge-base.c\nindex 6f3941f2a4..d0fc14786e 100644\n--- a/builtin/merge-base.c\n+++ b/builtin/merge-base.c\n@@ -43,10 +43,10 @@ static struct commit *get_commit_reference(const char *arg)\n \tstruct commit *r;\n \n \tif (get_oid(arg, &revkey))\n-\t\tdie(\"Not a valid object name %s\", arg);\n+\t\tdie(\"not a valid object name %s\", arg);\n \tr = lookup_commit_reference(the_repository, &revkey);\n \tif (!r)\n-\t\tdie(\"Not a valid commit name %s\", arg);\n+\t\tdie(\"not a valid commit name %s\", arg);\n \n \treturn r;\n }\n@@ -119,7 +119,7 @@ static int handle_fork_point(int argc, const char **argv)\n \n \tcommitname = (argc == 2) ? argv[1] : \"HEAD\";\n \tif (get_oid(commitname, &oid))\n-\t\tdie(\"Not a valid object name: '%s'\", commitname);\n+\t\tdie(\"not a valid object name: '%s'\", commitname);\n \n \tderived = lookup_commit_reference(the_repository, &oid);\n \ndiff --git a/builtin/remote-fd.c b/builtin/remote-fd.c\nindex 91dfe07e06..2ac2d23731 100644\n--- a/builtin/remote-fd.c\n+++ b/builtin/remote-fd.c\n@@ -29,7 +29,7 @@ static void command_loop(int input_fd, int output_fd)\n \t\tsize_t i;\n \t\tif (!fgets(buffer, MAXCOMMAND - 1, stdin)) {\n \t\t\tif (ferror(stdin))\n-\t\t\t\tdie(\"Input error\");\n+\t\t\t\tdie(\"input error\");\n \t\t\treturn;\n \t\t}\n \t\t/* Strip end of line characters. */\n@@ -45,10 +45,10 @@ static void command_loop(int input_fd, int output_fd)\n \t\t\tfflush(stdout);\n \t\t\tif (bidirectional_transfer_loop(input_fd,\n \t\t\t\toutput_fd))\n-\t\t\t\tdie(\"Copying data between file descriptors failed\");\n+\t\t\t\tdie(\"copying data between file descriptors failed\");\n \t\t\treturn;\n \t\t} else {\n-\t\t\tdie(\"Bad command: %s\", buffer);\n+\t\t\tdie(\"bad command: %s\", buffer);\n \t\t}\n \t}\n }\n@@ -65,7 +65,7 @@ int cmd_remote_fd(int argc, const char **argv, const char *prefix)\n \tinput_fd = (int)strtoul(argv[2], &end, 10);\n \n \tif ((end == argv[2]) || (*end != ',' && *end != '/' && *end))\n-\t\tdie(\"Bad URL syntax\");\n+\t\tdie(\"bad URL syntax\");\n \n \tif (*end == '/' || !*end) {\n \t\toutput_fd = input_fd;\n@@ -74,7 +74,7 @@ int cmd_remote_fd(int argc, const char **argv, const char *prefix)\n \t\toutput_fd = (int)strtoul(end + 1, &end2, 10);\n \n \t\tif ((end2 == end + 1) || (*end2 != '/' && *end2))\n-\t\t\tdie(\"Bad URL syntax\");\n+\t\t\tdie(\"bad URL syntax\");\n \t}\n \n \tcommand_loop(input_fd, output_fd);\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 05f2c9bc98..4515d5005a 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -40,7 +40,7 @@ static int repo_get_default_remote(struct repository *repo, char **default_remot\n \t\t\t\t\t\t      NULL);\n \n \tif (!refname)\n-\t\treturn die_message(_(\"No such ref: %s\"), \"HEAD\");\n+\t\treturn die_message(_(\"no such ref: %s\"), \"HEAD\");\n \n \t/* detached HEAD */\n \tif (!strcmp(refname, \"HEAD\")) {\n@@ -49,7 +49,7 @@ static int repo_get_default_remote(struct repository *repo, char **default_remot\n \t}\n \n \tif (!skip_prefix(refname, \"refs/heads/\", &refname))\n-\t\treturn die_message(_(\"Expecting a full ref name, got %s\"),\n+\t\treturn die_message(_(\"expecting a full ref name, got %s\"),\n \t\t\t\t   refname);\n \n \tstrbuf_addf(&sb, \"branch.%s.remote\", refname);\n@@ -299,7 +299,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \tsub = submodule_from_path(the_repository, null_oid(), path);\n \n \tif (!sub)\n-\t\tdie(_(\"No url found for submodule path '%s' in .gitmodules\"),\n+\t\tdie(_(\"no url found for submodule path '%s' in .gitmodules\"),\n \t\t\tdisplaypath);\n \n \tif (!is_submodule_populated_gently(path, NULL))\n@@ -452,7 +452,7 @@ static void init_submodule(const char *path, const char *prefix,\n \tsub = submodule_from_path(the_repository, null_oid(), path);\n \n \tif (!sub)\n-\t\tdie(_(\"No url found for submodule path '%s' in .gitmodules\"),\n+\t\tdie(_(\"no url found for submodule path '%s' in .gitmodules\"),\n \t\t\tdisplaypath);\n \n \t/*\n@@ -475,7 +475,7 @@ static void init_submodule(const char *path, const char *prefix,\n \tstrbuf_addf(&sb, \"submodule.%s.url\", sub->name);\n \tif (git_config_get_string(sb.buf, &url)) {\n \t\tif (!sub->url)\n-\t\t\tdie(_(\"No url found for submodule path '%s' in .gitmodules\"),\n+\t\t\tdie(_(\"no url found for submodule path '%s' in .gitmodules\"),\n \t\t\t\tdisplaypath);\n \n \t\turl = xstrdup(sub->url);\n@@ -490,7 +490,7 @@ static void init_submodule(const char *path, const char *prefix,\n \t\t}\n \n \t\tif (git_config_set_gently(sb.buf, url))\n-\t\t\tdie(_(\"Failed to register url for submodule path '%s'\"),\n+\t\t\tdie(_(\"failed to register url for submodule path '%s'\"),\n \t\t\t    displaypath);\n \t\tif (!(flags & OPT_QUIET))\n \t\t\tfprintf(stderr,\n@@ -512,7 +512,7 @@ static void init_submodule(const char *path, const char *prefix,\n \t\t}\n \n \t\tif (git_config_set_gently(sb.buf, upd))\n-\t\t\tdie(_(\"Failed to register update mode for submodule path '%s'\"), displaypath);\n+\t\t\tdie(_(\"failed to register update mode for submodule path '%s'\"), displaypath);\n \t}\n \tstrbuf_release(&sb);\n \tfree(displaypath);\n@@ -1616,14 +1616,14 @@ static void prepare_possible_alternates(const char *sm_name,\n \telse if (!strcmp(error_strategy, \"ignore\"))\n \t\tsas.error_mode = SUBMODULE_ALTERNATE_ERROR_IGNORE;\n \telse\n-\t\tdie(_(\"Value '%s' for submodule.alternateErrorStrategy is not recognized\"), error_strategy);\n+\t\tdie(_(\"value '%s' for submodule.alternateErrorStrategy is not recognized\"), error_strategy);\n \n \tif (!strcmp(sm_alternate, \"superproject\"))\n \t\tforeach_alt_odb(add_possible_reference_from_superproject, &sas);\n \telse if (!strcmp(sm_alternate, \"no\"))\n \t\t; /* do nothing */\n \telse\n-\t\tdie(_(\"Value '%s' for submodule.alternateLocation is not recognized\"), sm_alternate);\n+\t\tdie(_(\"value '%s' for submodule.alternateLocation is not recognized\"), sm_alternate);\n \n \tfree(sm_alternate);\n \tfree(error_strategy);\n@@ -1825,7 +1825,7 @@ static int determine_submodule_update_strategy(struct repository *r,\n \t\tout->type = update;\n \t} else if (!repo_config_get_string_tmp(r, key, &val)) {\n \t\tif (parse_submodule_update_strategy(val, out) < 0) {\n-\t\t\tret = die_message(_(\"Invalid update mode '%s' configured for submodule path '%s'\"),\n+\t\t\tret = die_message(_(\"invalid update mode '%s' configured for submodule path '%s'\"),\n \t\t\t\t\t  val, path);\n \t\t\tgoto cleanup;\n \t\t}\n@@ -2366,7 +2366,7 @@ static int remote_submodule_branch(const char *path, const char **branch)\n \t\tconst char *refname = resolve_ref_unsafe(\"HEAD\", 0, NULL, NULL);\n \n \t\tif (!refname)\n-\t\t\treturn die_message(_(\"No such ref: %s\"), \"HEAD\");\n+\t\t\treturn die_message(_(\"no such ref: %s\"), \"HEAD\");\n \n \t\t/* detached HEAD */\n \t\tif (!strcmp(refname, \"HEAD\"))\n@@ -2501,7 +2501,7 @@ static int update_submodule(struct update_data *update_data)\n \tif (update_data->just_cloned)\n \t\toidcpy(&update_data->suboid, null_oid());\n \telse if (resolve_gitlink_ref(update_data->sm_path, \"HEAD\", &update_data->suboid))\n-\t\treturn die_message(_(\"Unable to find current revision in submodule path '%s'\"),\n+\t\treturn die_message(_(\"unable to find current revision in submodule path '%s'\"),\n \t\t\t\t   update_data->displaypath);\n \n \tif (update_data->remote) {\n@@ -2523,12 +2523,12 @@ static int update_submodule(struct update_data *update_data)\n \t\tif (!update_data->nofetch) {\n \t\t\tif (fetch_in_submodule(update_data->sm_path, update_data->depth,\n \t\t\t\t\t      0, NULL))\n-\t\t\t\treturn die_message(_(\"Unable to fetch in submodule path '%s'\"),\n+\t\t\t\treturn die_message(_(\"unable to fetch in submodule path '%s'\"),\n \t\t\t\t\t\t   update_data->sm_path);\n \t\t}\n \n \t\tif (resolve_gitlink_ref(update_data->sm_path, remote_ref, &update_data->oid))\n-\t\t\treturn die_message(_(\"Unable to find %s revision in submodule path '%s'\"),\n+\t\t\treturn die_message(_(\"unable to find %s revision in submodule path '%s'\"),\n \t\t\t\t\t   remote_ref, update_data->sm_path);\n \n \t\tfree(remote_ref);\n@@ -2555,7 +2555,7 @@ static int update_submodule(struct update_data *update_data)\n \n \t\tret = run_command(&cp);\n \t\tif (ret)\n-\t\t\tdie_message(_(\"Failed to recurse into submodule path '%s'\"),\n+\t\t\tdie_message(_(\"failed to recurse into submodule path '%s'\"),\n \t\t\t\t    update_data->displaypath);\n \t\treturn ret;\n \t}\n@@ -2768,7 +2768,7 @@ static int push_check(int argc, const char **argv, const char *prefix)\n \t/* Get the submodule's head ref and determine if it is detached */\n \thead = resolve_refdup(\"HEAD\", 0, &head_oid, NULL);\n \tif (!head)\n-\t\tdie(_(\"Failed to resolve HEAD as a valid ref.\"));\n+\t\tdie(_(\"failed to resolve HEAD as a valid ref.\"));\n \tif (!strcmp(head, \"HEAD\"))\n \t\tdetached_head = 1;\n \n@@ -3135,16 +3135,16 @@ static void configure_added_submodule(struct add_data *add_data)\n \tstrvec_pushl(&add_submod.args, \"--\", add_data->sm_path, NULL);\n \n \tif (run_command(&add_submod))\n-\t\tdie(_(\"Failed to add submodule '%s'\"), add_data->sm_path);\n+\t\tdie(_(\"failed to add submodule '%s'\"), add_data->sm_path);\n \n \tif (config_submodule_in_gitmodules(add_data->sm_name, \"path\", add_data->sm_path) ||\n \t    config_submodule_in_gitmodules(add_data->sm_name, \"url\", add_data->repo))\n-\t\tdie(_(\"Failed to register submodule '%s'\"), add_data->sm_path);\n+\t\tdie(_(\"failed to register submodule '%s'\"), add_data->sm_path);\n \n \tif (add_data->branch) {\n \t\tif (config_submodule_in_gitmodules(add_data->sm_name,\n \t\t\t\t\t\t   \"branch\", add_data->branch))\n-\t\t\tdie(_(\"Failed to register submodule '%s'\"), add_data->sm_path);\n+\t\t\tdie(_(\"failed to register submodule '%s'\"), add_data->sm_path);\n \t}\n \n \tadd_gitmodules.git_cmd = 1;\n@@ -3152,7 +3152,7 @@ static void configure_added_submodule(struct add_data *add_data)\n \t\t     \"add\", \"--force\", \"--\", \".gitmodules\", NULL);\n \n \tif (run_command(&add_gitmodules))\n-\t\tdie(_(\"Failed to register submodule '%s'\"), add_data->sm_path);\n+\t\tdie(_(\"failed to register submodule '%s'\"), add_data->sm_path);\n \n \t/*\n \t * NEEDSWORK: In a multi-working-tree world this needs to be\n@@ -3289,7 +3289,7 @@ static int module_add(int argc, const char **argv, const char *prefix)\n \tif (starts_with_dot_dot_slash(add_data.repo) ||\n \t    starts_with_dot_slash(add_data.repo)) {\n \t\tif (prefix)\n-\t\t\tdie(_(\"Relative path can only be used from the toplevel \"\n+\t\t\tdie(_(\"relative path can only be used from the toplevel \"\n \t\t\t      \"of the working tree\"));\n \n \t\t/* dereference source url relative to parent's url */\n-- \n2.39.0\n\n"},{"id":"472087","messageId":"xmqqa61f521c.fsf@gitster.g","threadId":"59236","inReplyTo":"20230214215403.1450903-1-cheskaqiqi@gmail.com","subject":"Re: [PATCH v2] builtin/*: fix error message usage typo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-02-14T22:13:03Z","receivedAt":"2023-02-14T22:13:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shuqi Liang <cheskaqiqi@gmail.com> writes:\n\n>  builtin/merge-base.c        |  6 +++---\n>  \tif (get_oid(arg, &revkey))\n> -\t\tdie(\"Not a valid object name %s\", arg);\n> +\t\tdie(\"not a valid object name %s\", arg);\n>  \tr = lookup_commit_reference(the_repository, &revkey);\n>  \tif (!r)\n> -\t\tdie(\"Not a valid commit name %s\", arg);\n> +\t\tdie(\"not a valid commit name %s\", arg);\n\nYou picked a rather unfortunate one.\n\n    $ git grep -E -e 'Not a valid (object|commit) name ' '*.c'\n    bisect.c:\t\tdie(_(\"Not a valid commit name %s\"), oid_to_hex(oid));\n    builtin/cat-file.c:\t\tdie(\"Not a valid object name %s\", obj_name);\n    builtin/cat-file.c:\t\t\tdie(\"Not a valid object name %s\", obj_name);\n    builtin/describe.c:\t\tdie(_(\"Not a valid object name %s\"), arg);\n    builtin/ls-tree.c:\t\tdie(\"Not a valid object name %s\", argv[0]);\n    builtin/merge-base.c:\t\tdie(\"Not a valid object name %s\", arg);\n    builtin/merge-base.c:\t\tdie(\"Not a valid commit name %s\", arg);\n    builtin/read-tree.c:\t\t\tdie(\"Not a valid object name %s\", arg);\n    builtin/unpack-file.c:\t\tdie(\"Not a valid object name %s\", argv[1]);\n\nUpdating only one file would mean you leave two variants each for\nthe same message, making the messages less consistent and adding\nmore strings for translators to translate.  If we were to do this,\nit probably makes sense to fix these (or just \"valid object name\"\nones) as a single group in a patch (with updates to tests that\nexpect the old spelling).\n\n    Subject: [PATCH] errors: downcase \"Not a valid object name\"\n\n    There are many instances of \"Not a valid object name %s\" given\n    to die(), which should start with lowercase \"not a valid ...\".\n    Fix them.\n\nor something, which would touch the grep hits we see above, plus\nsome tests in these files\n\n    $ git grep -l -e 'Not a valid object name ' t/\n    t/t1006-cat-file.sh\n    t/t8007-cat-file-textconv.sh\n\nthat seem to expect \"Not a valid object name\", starting in capital.\n"}]}