{"thread":{"id":"58027","subject":"[PATCH] i18n: fix mismatched camelCase config variables","startedAt":"2022-06-17T10:03:34Z","lastAt":"2022-06-17T17:42:27Z","messageCount":3,"participants":["Jiang Xin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"457449","messageId":"20220617100309.3224-1-worldhello.net@gmail.com","threadId":"58027","inReplyTo":null,"subject":"[PATCH] i18n: fix mismatched camelCase config variables","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-06-17T10:03:09Z","receivedAt":"2022-06-17T10:03:34Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\n\nSome config variables are combinations of multiple words, and we\ntypically write them in camelCase forms in manpage and translatable\nstrings. It's not easy to find mismatches for these camelCase config\nvariables during code reviews, but occasionally they are identified\nduring localization translations.\n\nTo check for mismatched config variables, I introduced a new feature\nin the helper program for localization[^1]. The following mismatched\nconfig variables have been identified by running the helper program,\nsuch as \"git-po-helper check-pot\".\n\nLowercase in manpage should use camelCase:\n\n * Documentation/config/http.txt: http.pinnedpubkey\n\nLowercase in translable strings should use camelCase:\n\n * builtin/fast-import.c:  pack.indexversion\n * builtin/gc.c:           gc.logexpiry\n * builtin/index-pack.c:   pack.indexversion\n * builtin/pack-objects.c: pack.indexversion\n * builtin/repack.c:       pack.writebitmaps\n * commit.c:               i18n.commitencoding\n * gpg-interface.c:        user.signingkey\n * http.c:                 http.postbuffer\n * submodule-config.c:     submodule.fetchjobs\n\nMismatched camelCases, choose the former:\n\n * Documentation/config/fetch.txt: fetch.credentialsInUrl\n   remote.c:                       fetch.credentialsInURL\n\n[^1]: https://github.com/git-l10n/git-po-helper\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n Documentation/config/http.txt | 2 +-\n builtin/fast-import.c         | 2 +-\n builtin/gc.c                  | 2 +-\n builtin/index-pack.c          | 2 +-\n builtin/pack-objects.c        | 2 +-\n builtin/repack.c              | 2 +-\n commit.c                      | 2 +-\n gpg-interface.c               | 2 +-\n http.c                        | 2 +-\n remote.c                      | 2 +-\n submodule-config.c            | 2 +-\n 11 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/config/http.txt b/Documentation/config/http.txt\nindex 179d03e57b..afeeccfbfa 100644\n--- a/Documentation/config/http.txt\n+++ b/Documentation/config/http.txt\n@@ -203,7 +203,7 @@ http.schannelUseSSLCAInfo::\n \twhen the `schannel` backend was configured via `http.sslBackend`,\n \tunless `http.schannelUseSSLCAInfo` overrides this behavior.\n \n-http.pinnedpubkey::\n+http.pinnedPubkey::\n \tPublic key of the https service. It may either be the filename of\n \ta PEM or DER encoded public key file or a string starting with\n \t'sha256//' followed by the base64 encoded sha256 hash of the\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 28d3193c38..14113cfd82 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -3465,7 +3465,7 @@ static void git_pack_config(void)\n \t\tpack_idx_opts.version = indexversion_value;\n \t\tif (pack_idx_opts.version > 2)\n \t\t\tgit_die_config(\"pack.indexversion\",\n-\t\t\t\t\t\"bad pack.indexversion=%\"PRIu32, pack_idx_opts.version);\n+\t\t\t\t\t\"bad pack.indexVersion=%\"PRIu32, pack_idx_opts.version);\n \t}\n \tif (!git_config_get_ulong(\"pack.packsizelimit\", &packsizelimit_value))\n \t\tmax_packsize = packsizelimit_value;\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 4ea70089c9..021e9256ae 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -581,7 +581,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t/* default expiry time, overwritten in gc_config */\n \tgc_config();\n \tif (parse_expiry_date(gc_log_expire, &gc_log_expire_time))\n-\t\tdie(_(\"failed to parse gc.logexpiry value %s\"), gc_log_expire);\n+\t\tdie(_(\"failed to parse gc.logExpiry value %s\"), gc_log_expire);\n \n \tif (pack_refs < 0)\n \t\tpack_refs = !is_bare_repository();\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 3e385b4800..6648f2daef 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -1575,7 +1575,7 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)\n \tif (!strcmp(k, \"pack.indexversion\")) {\n \t\topts->version = git_config_int(k, v);\n \t\tif (opts->version > 2)\n-\t\t\tdie(_(\"bad pack.indexversion=%\"PRIu32), opts->version);\n+\t\t\tdie(_(\"bad pack.indexVersion=%\"PRIu32), opts->version);\n \t\treturn 0;\n \t}\n \tif (!strcmp(k, \"pack.threads\")) {\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex cc5f41086d..39e28cfcaf 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3170,7 +3170,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)\n \tif (!strcmp(k, \"pack.indexversion\")) {\n \t\tpack_idx_opts.version = git_config_int(k, v);\n \t\tif (pack_idx_opts.version > 2)\n-\t\t\tdie(_(\"bad pack.indexversion=%\"PRIu32),\n+\t\t\tdie(_(\"bad pack.indexVersion=%\"PRIu32),\n \t\t\t    pack_idx_opts.version);\n \t\treturn 0;\n \t}\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex c957b2959f..4a7ae4cf48 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -41,7 +41,7 @@ static const char *const git_repack_usage[] = {\n \n static const char incremental_bitmap_conflict_error[] = N_(\n \"Incremental repacks are incompatible with bitmap indexes.  Use\\n\"\n-\"--no-write-bitmap-index or disable the pack.writebitmaps configuration.\"\n+\"--no-write-bitmap-index or disable the pack.writeBitmaps configuration.\"\n );\n \n struct pack_objects_args {\ndiff --git a/commit.c b/commit.c\nindex 73865fee15..1fb1b2ea90 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1526,7 +1526,7 @@ static int verify_utf8(struct strbuf *buf)\n static const char commit_utf8_warn[] =\n N_(\"Warning: commit message did not conform to UTF-8.\\n\"\n    \"You may want to amend it after fixing the message, or set the config\\n\"\n-   \"variable i18n.commitencoding to the encoding your project uses.\\n\");\n+   \"variable i18n.commitEncoding to the encoding your project uses.\\n\");\n \n int commit_tree_extended(const char *msg, size_t msg_len,\n \t\t\t const struct object_id *tree,\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 280f1fa1a5..947b58ad4d 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -985,7 +985,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,\n \n \tif (!signing_key || signing_key[0] == '\\0')\n \t\treturn error(\n-\t\t\t_(\"user.signingkey needs to be set for ssh signing\"));\n+\t\t\t_(\"user.signingKey needs to be set for ssh signing\"));\n \n \tif (is_literal_ssh_key(signing_key, &literal_key)) {\n \t\t/* A literal ssh key */\ndiff --git a/http.c b/http.c\nindex 11c6f69fac..168ca30c55 100644\n--- a/http.c\n+++ b/http.c\n@@ -349,7 +349,7 @@ static int http_options(const char *var, const char *value, void *cb)\n \tif (!strcmp(\"http.postbuffer\", var)) {\n \t\thttp_post_buffer = git_config_ssize_t(var, value);\n \t\tif (http_post_buffer < 0)\n-\t\t\twarning(_(\"negative value for http.postbuffer; defaulting to %d\"), LARGE_PACKET_MAX);\n+\t\t\twarning(_(\"negative value for http.postBuffer; defaulting to %d\"), LARGE_PACKET_MAX);\n \t\tif (http_post_buffer < LARGE_PACKET_MAX)\n \t\t\thttp_post_buffer = LARGE_PACKET_MAX;\n \t\treturn 0;\ndiff --git a/remote.c b/remote.c\nindex 9b9bbfe80e..d50b83e7eb 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -633,7 +633,7 @@ static void validate_remote_url(struct remote *remote)\n \telse if (!strcmp(\"allow\", value))\n \t\treturn;\n \telse\n-\t\tdie(_(\"unrecognized value fetch.credentialsInURL: '%s'\"), value);\n+\t\tdie(_(\"unrecognized value fetch.credentialsInUrl: '%s'\"), value);\n \n \tfor (i = 0; i < remote->url_nr; i++) {\n \t\tstruct url_info url_info = { 0 };\ndiff --git a/submodule-config.c b/submodule-config.c\nindex ce3beaf5d4..4a9780856c 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -302,7 +302,7 @@ int parse_submodule_fetchjobs(const char *var, const char *value)\n {\n \tint fetchjobs = git_config_int(var, value);\n \tif (fetchjobs < 0)\n-\t\tdie(_(\"negative values not allowed for submodule.fetchjobs\"));\n+\t\tdie(_(\"negative values not allowed for submodule.fetchJobs\"));\n \treturn fetchjobs;\n }\n \n-- \n2.36.GIT\n\n"},{"id":"457454","messageId":"xmqqtu8jpa7p.fsf@gitster.g","threadId":"58027","inReplyTo":"20220617100309.3224-1-worldhello.net@gmail.com","subject":"Re: [PATCH] i18n: fix mismatched camelCase config variables","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-17T15:43:06Z","receivedAt":"2022-06-17T15:43:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Mismatched camelCases, choose the former:\n>\n>  * Documentation/config/fetch.txt: fetch.credentialsInUrl\n>    remote.c:                       fetch.credentialsInURL\n\nWe renamed this with \"fetch\" -> \"transfer\", didn't we?\n\nEverything else looks good, though.\n\nThanks.\n"},{"id":"457457","messageId":"xmqqpmj7nq55.fsf@gitster.g","threadId":"58027","inReplyTo":"xmqqtu8jpa7p.fsf@gitster.g","subject":"Re: [PATCH] i18n: fix mismatched camelCase config variables","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-17T17:41:58Z","receivedAt":"2022-06-17T17:42:27Z","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> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n>> Mismatched camelCases, choose the former:\n>>\n>>  * Documentation/config/fetch.txt: fetch.credentialsInUrl\n>>    remote.c:                       fetch.credentialsInURL\n>\n> We renamed this with \"fetch\" -> \"transfer\", didn't we?\n>\n> Everything else looks good, though.\n\nI've applied after tweaking it a bit.\n\nWill be pushing the result out shortly.\n"}]}