i18n: fix mismatched camelCase config variables

Some config variables are combinations of multiple words, and we typically write them in camelCase forms in manpage and translatable strings. It's not easy to find mismatches for these camelCase config variables during code reviews, but occasionally they are identified during localization translations. To check for mismatched config variables, I introduced a new feature in the helper program for localization[^1]. The following mismatched config variables have been identified by running the helper program, such as "git-po-helper check-pot". Lowercase in manpage should use camelCase: * Documentation/config/http.txt: http.pinnedpubkey Lowercase in translable strings should use camelCase: * builtin/fast-import.c: pack.indexversion * builtin/gc.c: gc.logexpiry * builtin/index-pack.c: pack.indexversion * builtin/pack-objects.c: pack.indexversion * builtin/repack.c: pack.writebitmaps * commit.c: i18n.commitencoding * gpg-interface.c: user.signingkey * http.c: http.postbuffer * submodule-config.c: submodule.fetchjobs Mismatched camelCases, choose the former: * Documentation/config/transfer.txt: transfer.credentialsInUrl remote.c: transfer.credentialsInURL [^1]: https://github.com/git-l10n/git-po-helper Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jiang Xin committed Jun 17, 2022 at 18:03 UTC b4eda05d58ca3e4808d3d86ab5826c77995a06f7
11 files changed +11 -11
Documentation/config/http.txt
+1 -1
@@ -203,7 +203,7 @@ http.schannelUseSSLCAInfo::
203 when the `schannel` backend was configured via `http.sslBackend`,
204 unless `http.schannelUseSSLCAInfo` overrides this behavior.
205
206 -http.pinnedpubkey::
206 +http.pinnedPubkey::
207 Public key of the https service. It may either be the filename of
208 a PEM or DER encoded public key file or a string starting with
209 'sha256//' followed by the base64 encoded sha256 hash of the
builtin/fast-import.c
+1 -1
@@ -3465,7 +3465,7 @@ static void git_pack_config(void)
3465 pack_idx_opts.version = indexversion_value;
3466 if (pack_idx_opts.version > 2)
3467 git_die_config("pack.indexversion",
3468 - "bad pack.indexversion=%"PRIu32, pack_idx_opts.version);
3468 + "bad pack.indexVersion=%"PRIu32, pack_idx_opts.version);
3469 }
3470 if (!git_config_get_ulong("pack.packsizelimit", &packsizelimit_value))
3471 max_packsize = packsizelimit_value;
builtin/gc.c
+1 -1
@@ -581,7 +581,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
581 /* default expiry time, overwritten in gc_config */
582 gc_config();
583 if (parse_expiry_date(gc_log_expire, &gc_log_expire_time))
584 - die(_("failed to parse gc.logexpiry value %s"), gc_log_expire);
584 + die(_("failed to parse gc.logExpiry value %s"), gc_log_expire);
585
586 if (pack_refs < 0)
587 pack_refs = !is_bare_repository();
builtin/index-pack.c
+1 -1
@@ -1575,7 +1575,7 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)
1575 if (!strcmp(k, "pack.indexversion")) {
1576 opts->version = git_config_int(k, v);
1577 if (opts->version > 2)
1578 - die(_("bad pack.indexversion=%"PRIu32), opts->version);
1578 + die(_("bad pack.indexVersion=%"PRIu32), opts->version);
1579 return 0;
1580 }
1581 if (!strcmp(k, "pack.threads")) {
builtin/pack-objects.c
+1 -1
@@ -3170,7 +3170,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
3170 if (!strcmp(k, "pack.indexversion")) {
3171 pack_idx_opts.version = git_config_int(k, v);
3172 if (pack_idx_opts.version > 2)
3173 - die(_("bad pack.indexversion=%"PRIu32),
3173 + die(_("bad pack.indexVersion=%"PRIu32),
3174 pack_idx_opts.version);
3175 return 0;
3176 }
builtin/repack.c
+1 -1
@@ -41,7 +41,7 @@ static const char *const git_repack_usage[] = {
41
42 static const char incremental_bitmap_conflict_error[] = N_(
43 "Incremental repacks are incompatible with bitmap indexes. Use\n"
44 -"--no-write-bitmap-index or disable the pack.writebitmaps configuration."
44 +"--no-write-bitmap-index or disable the pack.writeBitmaps configuration."
45 );
46
47 struct pack_objects_args {
commit.c
+1 -1
@@ -1526,7 +1526,7 @@ static int verify_utf8(struct strbuf *buf)
1526 static const char commit_utf8_warn[] =
1527 N_("Warning: commit message did not conform to UTF-8.\n"
1528 "You may want to amend it after fixing the message, or set the config\n"
1529 - "variable i18n.commitencoding to the encoding your project uses.\n");
1529 + "variable i18n.commitEncoding to the encoding your project uses.\n");
1530
1531 int commit_tree_extended(const char *msg, size_t msg_len,
1532 const struct object_id *tree,
gpg-interface.c
+1 -1
@@ -985,7 +985,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
985
986 if (!signing_key || signing_key[0] == '\0')
987 return error(
988 - _("user.signingkey needs to be set for ssh signing"));
988 + _("user.signingKey needs to be set for ssh signing"));
989
990 if (is_literal_ssh_key(signing_key, &literal_key)) {
991 /* A literal ssh key */
http.c
+1 -1
@@ -349,7 +349,7 @@ static int http_options(const char *var, const char *value, void *cb)
349 if (!strcmp("http.postbuffer", var)) {
350 http_post_buffer = git_config_ssize_t(var, value);
351 if (http_post_buffer < 0)
352 - warning(_("negative value for http.postbuffer; defaulting to %d"), LARGE_PACKET_MAX);
352 + warning(_("negative value for http.postBuffer; defaulting to %d"), LARGE_PACKET_MAX);
353 if (http_post_buffer < LARGE_PACKET_MAX)
354 http_post_buffer = LARGE_PACKET_MAX;
355 return 0;
remote.c
+1 -1
@@ -633,7 +633,7 @@ static void validate_remote_url(struct remote *remote)
633 else if (!strcmp("allow", value))
634 return;
635 else
636 - die(_("unrecognized value transfer.credentialsInURL: '%s'"), value);
636 + die(_("unrecognized value transfer.credentialsInUrl: '%s'"), value);
637
638 for (i = 0; i < remote->url_nr; i++) {
639 struct url_info url_info = { 0 };
submodule-config.c
+1 -1
@@ -302,7 +302,7 @@ int parse_submodule_fetchjobs(const char *var, const char *value)
302 {
303 int fetchjobs = git_config_int(var, value);
304 if (fetchjobs < 0)
305 - die(_("negative values not allowed for submodule.fetchjobs"));
305 + die(_("negative values not allowed for submodule.fetchJobs"));
306 return fetchjobs;
307 }
308