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.