]> git.ipfire.org Git - thirdparty/git.git/commitdiff
i18n: fix mismatched camelCase config variables
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Fri, 17 Jun 2022 10:03:09 +0000 (18:03 +0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jun 2022 17:38:26 +0000 (10:38 -0700)
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>
Documentation/config/http.txt
builtin/fast-import.c
builtin/gc.c
builtin/index-pack.c
builtin/pack-objects.c
builtin/repack.c
commit.c
gpg-interface.c
http.c
remote.c
submodule-config.c

index 179d03e57b3e0234d437242c3aa25c413b2d173c..afeeccfbfa7a7073a19088a625b03fe2abee5801 100644 (file)
@@ -203,7 +203,7 @@ http.schannelUseSSLCAInfo::
        when the `schannel` backend was configured via `http.sslBackend`,
        unless `http.schannelUseSSLCAInfo` overrides this behavior.
 
-http.pinnedpubkey::
+http.pinnedPubkey::
        Public key of the https service. It may either be the filename of
        a PEM or DER encoded public key file or a string starting with
        'sha256//' followed by the base64 encoded sha256 hash of the
index 28d3193c380326e890463c759e3de06cb2073037..14113cfd82b78034cb7bbb4d0ff843f20d5ae498 100644 (file)
@@ -3465,7 +3465,7 @@ static void git_pack_config(void)
                pack_idx_opts.version = indexversion_value;
                if (pack_idx_opts.version > 2)
                        git_die_config("pack.indexversion",
-                                       "bad pack.indexversion=%"PRIu32, pack_idx_opts.version);
+                                       "bad pack.indexVersion=%"PRIu32, pack_idx_opts.version);
        }
        if (!git_config_get_ulong("pack.packsizelimit", &packsizelimit_value))
                max_packsize = packsizelimit_value;
index 4ea70089c914df2041eed10d2cd71fdfd0f8276f..021e9256ae23561007b1178b3de99341f6c72357 100644 (file)
@@ -581,7 +581,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        /* default expiry time, overwritten in gc_config */
        gc_config();
        if (parse_expiry_date(gc_log_expire, &gc_log_expire_time))
-               die(_("failed to parse gc.logexpiry value %s"), gc_log_expire);
+               die(_("failed to parse gc.logExpiry value %s"), gc_log_expire);
 
        if (pack_refs < 0)
                pack_refs = !is_bare_repository();
index 3e385b4800258d5c2e0d964d34b4238980f8b06c..6648f2daef5cef38fd59dfba47c048ce72bb4c36 100644 (file)
@@ -1575,7 +1575,7 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)
        if (!strcmp(k, "pack.indexversion")) {
                opts->version = git_config_int(k, v);
                if (opts->version > 2)
-                       die(_("bad pack.indexversion=%"PRIu32), opts->version);
+                       die(_("bad pack.indexVersion=%"PRIu32), opts->version);
                return 0;
        }
        if (!strcmp(k, "pack.threads")) {
index cc5f41086daea19dc0600a8a4f450c844f293166..39e28cfcafc3d361dbea42d4c4f7f4c1ca09728b 100644 (file)
@@ -3170,7 +3170,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
        if (!strcmp(k, "pack.indexversion")) {
                pack_idx_opts.version = git_config_int(k, v);
                if (pack_idx_opts.version > 2)
-                       die(_("bad pack.indexversion=%"PRIu32),
+                       die(_("bad pack.indexVersion=%"PRIu32),
                            pack_idx_opts.version);
                return 0;
        }
index c957b2959f7865ce58eea0737f3b8d20c340bcec..4a7ae4cf489a4c34aaabeca064535f07c2df55f7 100644 (file)
@@ -41,7 +41,7 @@ static const char *const git_repack_usage[] = {
 
 static const char incremental_bitmap_conflict_error[] = N_(
 "Incremental repacks are incompatible with bitmap indexes.  Use\n"
-"--no-write-bitmap-index or disable the pack.writebitmaps configuration."
+"--no-write-bitmap-index or disable the pack.writeBitmaps configuration."
 );
 
 struct pack_objects_args {
index 73865fee15b754bf2da4fc5ad4ec1e34231f1771..1fb1b2ea90c5953eb465d3b108c01f23fb442a32 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1526,7 +1526,7 @@ static int verify_utf8(struct strbuf *buf)
 static const char commit_utf8_warn[] =
 N_("Warning: commit message did not conform to UTF-8.\n"
    "You may want to amend it after fixing the message, or set the config\n"
-   "variable i18n.commitencoding to the encoding your project uses.\n");
+   "variable i18n.commitEncoding to the encoding your project uses.\n");
 
 int commit_tree_extended(const char *msg, size_t msg_len,
                         const struct object_id *tree,
index 280f1fa1a58233f032cce7f2fe8bf4317f1e0ab8..947b58ad4da364bc7890a6ca30d065ee56d9fc8d 100644 (file)
@@ -985,7 +985,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
 
        if (!signing_key || signing_key[0] == '\0')
                return error(
-                       _("user.signingkey needs to be set for ssh signing"));
+                       _("user.signingKey needs to be set for ssh signing"));
 
        if (is_literal_ssh_key(signing_key, &literal_key)) {
                /* A literal ssh key */
diff --git a/http.c b/http.c
index 11c6f69facd8ec165ea50ae1dee8f7a33c7c129d..168ca30c5588444ba01c8da16e3e17e7c8b5bf44 100644 (file)
--- a/http.c
+++ b/http.c
@@ -349,7 +349,7 @@ static int http_options(const char *var, const char *value, void *cb)
        if (!strcmp("http.postbuffer", var)) {
                http_post_buffer = git_config_ssize_t(var, value);
                if (http_post_buffer < 0)
-                       warning(_("negative value for http.postbuffer; defaulting to %d"), LARGE_PACKET_MAX);
+                       warning(_("negative value for http.postBuffer; defaulting to %d"), LARGE_PACKET_MAX);
                if (http_post_buffer < LARGE_PACKET_MAX)
                        http_post_buffer = LARGE_PACKET_MAX;
                return 0;
index 549ba5862a88eb9f994fcac45ce151d7daf1137c..b19e3a2f015a7215df4227ae85368e11d8b1e962 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -633,7 +633,7 @@ static void validate_remote_url(struct remote *remote)
        else if (!strcmp("allow", value))
                return;
        else
-               die(_("unrecognized value transfer.credentialsInURL: '%s'"), value);
+               die(_("unrecognized value transfer.credentialsInUrl: '%s'"), value);
 
        for (i = 0; i < remote->url_nr; i++) {
                struct url_info url_info = { 0 };
index 51ecbe901ec42980b0a81685ec1529bd20cc205b..c2ac7e7bf39b2eb9c273a11fb457b0dbc7369aa6 100644 (file)
@@ -302,7 +302,7 @@ int parse_submodule_fetchjobs(const char *var, const char *value)
 {
        int fetchjobs = git_config_int(var, value);
        if (fetchjobs < 0)
-               die(_("negative values not allowed for submodule.fetchjobs"));
+               die(_("negative values not allowed for submodule.fetchJobs"));
        return fetchjobs;
 }