git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] i18n.txt: camel case and monospace "i18n.commitEncoding"

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2021, 19:15 UTC
Message-ID
<xmqq7dmy389l.fsf@gitster.g>
In-Reply-To
<cc48b125166a241ef5f24138fd161223ab35e361.1614062288.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 11 quoted lines
> In 95791be750 (doc: camelCase the i18n config variables to improve
> readability, 2017-07-17), the other i18n config variables were
> camel cased. However, this one instance was missed.
>
> Camel case and monospace "i18n.commitEncoding" so that it matches the
> surrounding text.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  Documentation/i18n.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
Looking good.
Show 13 quoted lines
> diff --git a/Documentation/i18n.txt b/Documentation/i18n.txt
> index 7e36e5b55b..6c6baeeeb7 100644
> --- a/Documentation/i18n.txt
> +++ b/Documentation/i18n.txt
> @@ -38,7 +38,7 @@ mind.
>    a warning if the commit log message given to it does not look
>    like a valid UTF-8 string, unless you explicitly say your
>    project uses a legacy encoding.  The way to say this is to
> -  have i18n.commitencoding in `.git/config` file, like this:
> +  have `i18n.commitEncoding` in `.git/config` file, like this:
>  +
>  ------------
>  [i18n]

Thanks, but whenever you noticed an issue like "Ah, here we used an incorrect spelling i18n.commitencoding", please make it a habit to see if we did exactly the same mistake elsewhere (you have been working with Git long enough to know how cheap such a check is):

    $ git grep -F -e i18n.commitencoding -- \
         Documentation/ ':!Documentation/RelNotes/'
and you would have found three other instances.

This obviously does not have to be part of this miniseries, but I wonder if we should have a list of all the configuration variables in one place that we can use to record the canonical spelling of these variables. As

$ git grep -h -E -i \
	-e '^[a-z][-a-z0-9]*\.[a-z][-a-z0-9]*::' \
	-e '^[a-z][-a-z0-9]*\.(\*|<?[a-z][-a-z0-9]*>?)\.(\*|<?[a-z][-a-z0-9]*>?)::' \
	Documentation/config

gives many hits with camelCased names, it might be a good place to start.

Pretending that the above gives a good "canonical list" (it does not yet, if you look at the hits), I got curious how far we can go.

Massaging the output from the above into config-variables.lst
$ ... above command ... |
  sed -e 's/::$//' |
  sort -u >config-variables.lst

and then to extract use of these tokens in the main part of the documentation like this:

$ git grep -h -o -i -F -f config-variables.lst -- \
  Documentation/ ':!Documentation/RelNotes/' |
  sort -u >config-usage.lst
gives us something we can compare with the "canonical" usage list.

$ comm -3 config-usage.lst config-variables.lst blame.blankboundary core.excludesfile core.filemode core.gitproxy core.ignorestat core.logallrefupdates core.repositoryformatversion core.trustCtime http.sslverify http.sslversion i18n.commitencoding push.pushoption remote.<name>.partialCloneFilter remote.pushdefault repack.UseDeltaBaseOffset sendemail.aliasesfile showbranch.default transfer.hiderefs uploadArchive.allowUnreachable

Some of them may be false hits, some may be showing that the copy in Documentation/config/ are spelled in all lowercase, but the majority of the hits above seem to be genuine errors similar to what you fixed in your patch.

Thanks.
Previous: Denton LiuNext: Junio C Hamano
Message 3 of 21 in “docs: misc cleanup”
  1. 0/3 docs: misc cleanupDenton Liu, Feb 23, 2021
  2. 1/3 i18n.txt: camel case and monospace "i18n.commitEncoding"Denton Liu, Feb 23, 2021
  3. Junio C HamanoFeb 23, 2021
  4. i18n.txt: camel case and monospace "i18n.commitEncoding"Junio C Hamano, Feb 23, 2021
  5. Eric SunshineFeb 23, 2021
  6. Junio C HamanoFeb 23, 2021
  7. 0/3 doc: spell configuration variable names in camelCaseJunio C Hamano, Feb 24, 2021
  8. 1/3 i18n.txt: camel case and monospace "i18n.commitEncoding"Junio C Hamano, Feb 24, 2021
  9. 2/3 blame-options.txt: camelcase blame.blankBoundaryJunio C Hamano, Feb 24, 2021
  10. 3/3 index-format doc: camelCase core.excludesFileJunio C Hamano, Feb 24, 2021
  11. 2/3 git-cat-file.txt: monospace args and placeholdersDenton Liu, Feb 23, 2021
  12. Eric SunshineFeb 23, 2021
  13. 2/3 git-cat-file.txt: monospace args, placeholders and filenamesDenton Liu, Feb 23, 2021
  14. 3/3 git-cat-file.txt: remove references to "sha1"Denton Liu, Feb 23, 2021
  15. Eric SunshineFeb 23, 2021
  16. git-cat-file.txt: remove references to "sha1"Denton Liu, Feb 23, 2021
  17. Junio C HamanoFeb 23, 2021
  18. 0/2 git-cat-file.txt: doc cleanupDenton Liu, Mar 3, 2021
  19. 2/2 git-cat-file.txt: remove references to "sha1"Denton Liu, Mar 3, 2021
  20. 1/2 git-cat-file.txt: monospace args, placeholders and filenamesDenton Liu, Mar 3, 2021
  21. Junio C HamanoMar 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.