Re: [PATCH v1 2/2] convert: add alias support for 'working-tree-encoding' attributes
From: Junio C Hamano <hidden>
Date: 2018-07-10 16:31:52
larsxschneider@gmail.com writes:
From: Lars Schneider <redacted>
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 <redacted>
---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.