Re: [PATCH v5 5/7] convert: add 'working-tree-encoding' attribute

2018-01-31 Thread Junio C Hamano
Lars Schneider writes: >> I am not sure why this is special cased and other codepaths have "if >> WRITE_OBJECT then die, otherwise error" checks, so no, I do not >> agree with your reasoning, at least not yet. > > The convert_to_git()/encode_to_git() machinery is used in two different > kinds of

Re: [PATCH v5 5/7] convert: add 'working-tree-encoding' attribute

2018-01-31 Thread Lars Schneider
> On 30 Jan 2018, at 22:56, Junio C Hamano wrote: > > Lars Schneider writes: > >>> On 30 Jan 2018, at 21:05, Junio C Hamano wrote: >>> >>> tbo...@web.de writes: >>> + if ((conv_flags & CONV_WRITE_OBJECT) && !strcmp(enc->name, "SHIFT-JIS")) { + char *re_src; +

Re: [PATCH v5 5/7] convert: add 'working-tree-encoding' attribute

2018-01-30 Thread Junio C Hamano
Lars Schneider writes: >> On 30 Jan 2018, at 21:05, Junio C Hamano wrote: >> >> tbo...@web.de writes: >> >>> + if ((conv_flags & CONV_WRITE_OBJECT) && !strcmp(enc->name, >>> "SHIFT-JIS")) { >>> + char *re_src; >>> + int re_src_len; >> >> I think it is a bad idea to >>

Re: [PATCH v5 5/7] convert: add 'working-tree-encoding' attribute

2018-01-30 Thread Lars Schneider
> On 30 Jan 2018, at 21:05, Junio C Hamano wrote: > > tbo...@web.de writes: > >> +if ((conv_flags & CONV_WRITE_OBJECT) && !strcmp(enc->name, >> "SHIFT-JIS")) { >> +char *re_src; >> +int re_src_len; > > I think it is a bad idea to > > (1) not check without CONV_WR

Re: [PATCH v5 5/7] convert: add 'working-tree-encoding' attribute

2018-01-30 Thread Junio C Hamano
tbo...@web.de writes: > + if ((conv_flags & CONV_WRITE_OBJECT) && !strcmp(enc->name, > "SHIFT-JIS")) { > + char *re_src; > + int re_src_len; I think it is a bad idea to (1) not check without CONV_WRITE_OBJECT here. (2) hardcode SJIS and do this always and to SJIS

[PATCH v5 5/7] convert: add 'working-tree-encoding' attribute

2018-01-29 Thread tboegi
From: Lars Schneider Git recognizes files encoded with ASCII or one of its supersets (e.g. UTF-8 or ISO-8859-1) as text files. All other encodings are usually interpreted as binary and consequently built-in Git text processing tools (e.g. 'git diff') as well as most Git web front ends do not visu