Thread (11 messages) 11 messages, 5 authors, 2018-07-02

Re: Use of new .gitattributes working-tree-encoding attribute across different platform types

From: Jeff King <hidden>
Date: 2018-06-28 17:27:13

On Thu, Jun 28, 2018 at 07:21:18PM +0200, Lars Schneider wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help