Re: Use of new .gitattributes working-tree-encoding attribute across different platform types
- From
Jeff King <peff@peff.net>
- Date
- Jun 28, 2018, 17:27 UTC
- Message-ID
- <20180628172707.GA31766@sigill.intra.peff.net>
- In-Reply-To
- <4E8CDDC9-2957-401F-9BBE-93276C026848@gmail.com>
On Thu, Jun 28, 2018 at 07:21:18PM +0200, Lars Schneider wrote:
Show 16 quoted lines
> How about this: > > 1) We allow users to set the encoding "auto". Example: > > *.txt working-tree-encoding=auto > > 2) We define a new variable `core.autoencoding`. By default the value is > UTF-8 (== no re-encoding) but user can set to any value in their Git config. > Example: > > git config --global core.autoencoding UTF-16 > > All files marked with the value "auto" will use the encoding defined in > `core.autoencoding`. > > Would that work?
Yeah, that was along the lines that I was thinking. I wonder if anybody would ever need two such auto-encodings, though. Probably not. But another way to think about it would be to allow something like:
working-tree-encoding=foo
and then in your config "foo" to map to some encoding.
But that may be over-engineering, I dunno. utf8 has always been enough for me. :)
-Peff