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

Re: [PATCH v1 2/2] convert: add alias support for 'working-tree-encoding' attributes

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2018, 16:31 UTC
Message-ID
<xmqq601n9hn1.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180708183036.29459-3-larsxschneider@gmail.com>
larsxschneider@gmail.com writes:
Show 24 quoted lines
> From: Lars Schneider <larsxschneider@gmail.com>
>
> In 107642fe26 ("convert: add 'working-tree-encoding' attribute",
> 2018-04-15) we added an attribute which defines the working tree
> encoding of a file.
>
> Some platforms might spell the name of a certain encoding differently or
> some users might want to use different encodings on different platforms.
> Add the Git config "encoding.<iconv-name>.insteadOf = <alias-name>" to
> support these use-cases with a user specific mapping. If the alias
> matches an existing encoding name, then the alias will take precedence.
> The alias is case insensitive.
>
> Example:
>
> 	(in .gitattributes)
> 	*.c	working-tree-encoding=foo
>
> 	(in config)
> 	[encoding "UTF-16"]
> 		insteadOf = foo
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---

Hmph, when I was reading the discussion between you and Peff, I didn't expect it end up with a change too specific to this single attribute. I was instead imagining that a change would come closer to where we call iconv (perhaps we muck with in/out_encoding parameters to iconv_open()), so that places other than the working-tree-encoding (e.g. commit log message encoding) would start honoring the same configuration variable in a consistent way.

Previous: Lars Schneider
Message 8 of 8 in “convert: add alias support for 'working-tree-encoding' attributes”
  1. 0/2 convert: add alias support for 'working-tree-encoding' attributeslarsxschneider@gmail.com, Jul 8, 2018
  2. 1/2 convert: refactor conversion driver config parsinglarsxschneider@gmail.com, Jul 8, 2018
  3. Lars SchneiderJul 8, 2018
  4. Junio C HamanoJul 9, 2018
  5. Junio C HamanoJul 10, 2018
  6. 2/2 convert: add alias support for 'working-tree-encoding' attributeslarsxschneider@gmail.com, Jul 8, 2018
  7. Lars SchneiderJul 8, 2018
  8. Junio C HamanoJul 10, 2018

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.