Re: [PATCH v1] convert: add support for 'encoding' attribute

2018-01-03 Thread Lars Schneider
On 03 Jan 2018, at 20:15, Junio C Hamano wrote: > Torsten Bögershausen writes: > >> May be. >> Originally utf8.c was about encoding and all kind of UTF-8 related stuff. >> Especially it didn't know anything about strbuf. >> I don't know why strbuf.h and other

Re: [PATCH v1] convert: add support for 'encoding' attribute

2018-01-03 Thread Junio C Hamano
Torsten Bögershausen writes: > May be. > Originally utf8.c was about encoding and all kind of UTF-8 related stuff. > Especially it didn't know anything about strbuf. > I don't know why strbuf.h and other functions had been added here, > > I once moved them into strbuf.c without

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-29 Thread Lars Schneider
> On 29 Dec 2017, at 13:59, Torsten Bögershausen wrote: > > On 2017-12-28 17:14, Lars Schneider wrote:> >>> On 17 Dec 2017, at 18:14, Torsten Bögershausen wrote: >>> >>> On Mon, Dec 11, 2017 at 04:50:23PM +0100, lars.schnei...@autodesk.com wrote: From: Lars

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-29 Thread Torsten Bögershausen
On 2017-12-28 17:14, Lars Schneider wrote:> >> On 17 Dec 2017, at 18:14, Torsten Bögershausen wrote: >> >> On Mon, Dec 11, 2017 at 04:50:23PM +0100, lars.schnei...@autodesk.com wrote: >>> From: Lars Schneider >>> > >>> +`encoding` >>> +^^ >>> +

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-28 Thread Lars Schneider
> On 17 Dec 2017, at 18:14, Torsten Bögershausen wrote: > > On Mon, Dec 11, 2017 at 04:50:23PM +0100, lars.schnei...@autodesk.com wrote: >> From: Lars Schneider >> >> +`encoding` >> +^^ >> + >> +By default Git assumes UTF-8 encoding for text

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-23 Thread Torsten Bögershausen
On Mon, Dec 18, 2017 at 08:12:49AM -0500, Jeff King wrote: > On Mon, Dec 18, 2017 at 11:13:34AM +0100, Torsten Bögershausen wrote: > > > Just to confirm my missing knowledge here: > > Does this mean, that git-gui and gitk can decode/reencode > > the content of a file/blob, when the .gitattributes

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-18 Thread Johannes Sixt
Am 18.12.2017 um 11:13 schrieb Torsten Bögershausen: Just to confirm my missing knowledge here: Does this mean, that git-gui and gitk can decode/reencode the content of a file/blob, when the .gitattributes say so ? No. I think they parse the output of git-diff et.al., split it per file, and

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-18 Thread Junio C Hamano
Torsten Bögershausen writes: > Just to confirm my missing knowledge here: > Does this mean, that git-gui and gitk can decode/reencode > the content of a file/blob, when the .gitattributes say so ? These programs, when told that a file is in an encoding, read bytes from that file

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-18 Thread Jeff King
On Mon, Dec 18, 2017 at 11:13:34AM +0100, Torsten Bögershausen wrote: > Just to confirm my missing knowledge here: > Does this mean, that git-gui and gitk can decode/reencode > the content of a file/blob, when the .gitattributes say so ? That's my impression, yes. > If yes, would it make sense

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-18 Thread Jeff King
On Mon, Dec 18, 2017 at 11:54:32AM +0100, Lars Schneider wrote: > > warning: failed to encode 'file' from utf-8 to utf16 > > > > At least it figured out that it couldn't convert the content. It's > > slightly troubling that it would try in the first place, though; are > > there encoding pairs

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-18 Thread Lars Schneider
> On 15 Dec 2017, at 10:58, Jeff King wrote: > > On Mon, Dec 11, 2017 at 04:50:23PM +0100, lars.schnei...@autodesk.com wrote: > >> From: Lars Schneider >> >> Git and its tools (e.g. git diff) expect all text files in UTF-8 >> encoding. Git will

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-18 Thread Torsten Bögershausen
On Mon, Dec 11, 2017 at 09:47:24PM +0100, Johannes Sixt wrote: > Am 11.12.2017 um 16:50 schrieb lars.schnei...@autodesk.com: > >From: Lars Schneider > > > >Git and its tools (e.g. git diff) expect all text files in UTF-8 > >encoding. Git will happily accept content in

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-17 Thread Torsten Bögershausen
On Mon, Dec 11, 2017 at 04:50:23PM +0100, lars.schnei...@autodesk.com wrote: > From: Lars Schneider > > Git and its tools (e.g. git diff) expect all text files in UTF-8 > encoding. Git will happily accept content in all other encodings, too, > but it might not be able

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-15 Thread Jeff King
On Mon, Dec 11, 2017 at 04:50:23PM +0100, lars.schnei...@autodesk.com wrote: > From: Lars Schneider > > Git and its tools (e.g. git diff) expect all text files in UTF-8 > encoding. Git will happily accept content in all other encodings, too, > but it might not be able

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-14 Thread Junio C Hamano
Lars Schneider writes: > That way you could control the encoding for a text file specific > for each path similar to the "mode bits". That also means you could > change the encoding of a file while the blob content stays the same. That is exactly why I said that I

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-13 Thread Lars Schneider
> On 13 Dec 2017, at 19:11, Junio C Hamano wrote: > > Lars Schneider writes: > >> ... In a perfect world I think I would store >> the encoding of a file in the tree object. I didn't pursue that solution >> as this would change the Git data model

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-13 Thread Junio C Hamano
Lars Schneider writes: > ... In a perfect world I think I would store > the encoding of a file in the tree object. I didn't pursue that solution > as this would change the Git data model which would open a can of worms > for a problem that not that many people have

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-13 Thread Lars Schneider
> On 12 Dec 2017, at 20:31, Junio C Hamano wrote: > > Lars Schneider writes: > >> Our favorite is "treat-encoding-as". Do you consider this better >> or worse than "checkout-encoding"? > > I am afraid that "treat as" is not sufficiently specific

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-12 Thread Junio C Hamano
Lars Schneider writes: > Our favorite is "treat-encoding-as". Do you consider this better > or worse than "checkout-encoding"? I am afraid that "treat as" is not sufficiently specific and would invite a misinterpretation, e.g. "You record the bytes I throw at you as-is

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-12 Thread Lars Schneider
> On 12 Dec 2017, at 00:58, Eric Sunshine wrote: > > On Mon, Dec 11, 2017 at 6:47 PM, Lars Schneider > wrote: >> On 11 Dec 2017, at 19:39, Eric Sunshine wrote: >>> On Mon, Dec 11, 2017 at 10:50 AM,

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-12 Thread Lars Schneider
> On 12 Dec 2017, at 08:15, Johannes Sixt wrote: > > Am 12.12.2017 um 01:59 schrieb Junio C Hamano: >> Stepping back a bit, what does this thing do you are introducing? >> And what does the other thing do that J6t is using, that would get >> confused with this new one? >> What

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Johannes Sixt
Am 12.12.2017 um 01:59 schrieb Junio C Hamano: Stepping back a bit, what does this thing do you are introducing? And what does the other thing do that J6t is using, that would get confused with this new one? What does the other one do? "Declare that the contents of this path is in this

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Johannes Sixt
Am 12.12.2017 um 00:42 schrieb Lars Schneider: BTW: I am curios, can you share what encoding you use? My main use case is UTF-16 and I was surprised that I haven't found a single public repo on github.com with "encoding=utf-16" Shift-JIS and CP1252. These are used for Windows resource files

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Junio C Hamano
Lars Schneider writes: > I contemplated: > - "enc" or "encode" because "eol" and "ident" use abbreviations, too > (enc could be confused with encryption. plus, a user might ask > what is the difference between "enc" and "encoding" attribute :-) > - "wte",

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Eric Sunshine
On Mon, Dec 11, 2017 at 6:47 PM, Lars Schneider wrote: > On 11 Dec 2017, at 19:39, Eric Sunshine wrote: >> On Mon, Dec 11, 2017 at 10:50 AM, wrote: >>> From: Lars Schneider >>> >>> Git

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Lars Schneider
On 11 Dec 2017, at 19:39, Eric Sunshine wrote: > On Mon, Dec 11, 2017 at 10:50 AM, wrote: >> From: Lars Schneider >> >> Git and its tools (e.g. git diff) expect all text files in UTF-8 >> encoding. Git will

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Lars Schneider
On 11 Dec 2017, at 21:47, Johannes Sixt wrote: > Am 11.12.2017 um 16:50 schrieb lars.schnei...@autodesk.com: >> From: Lars Schneider >> Git and its tools (e.g. git diff) expect all text files in UTF-8 >> encoding. Git will happily accept content in all

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Johannes Sixt
Am 11.12.2017 um 16:50 schrieb lars.schnei...@autodesk.com: From: Lars Schneider Git and its tools (e.g. git diff) expect all text files in UTF-8 encoding. Git will happily accept content in all other encodings, too, but it might not be able to process the text (e.g.

Re: [PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread Eric Sunshine
On Mon, Dec 11, 2017 at 10:50 AM, wrote: > From: Lars Schneider > > Git and its tools (e.g. git diff) expect all text files in UTF-8 > encoding. Git will happily accept content in all other encodings, too, > but it might not be able to

[PATCH v1] convert: add support for 'encoding' attribute

2017-12-11 Thread lars . schneider
From: Lars Schneider Git and its tools (e.g. git diff) expect all text files in UTF-8 encoding. Git will happily accept content in all other encodings, too, but it might not be able to process the text (e.g. viewing diffs or changing line endings). Add an attribute to