Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-23 Thread Junio C Hamano
Jeff King writes: > But with Coccinelle, it's a lot easier to apply the change tree-wide, and > to convert topics in flight as they get merged. The maintainer still > gets conflicts with topics-in-flight that touch converted areas, though. > So I'd be curious to hear if Junio's

Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-23 Thread Jeff King
On Tue, Jan 23, 2018 at 11:25:58AM +0100, Simon Ruderich wrote: > On Mon, Jan 22, 2018 at 07:54:01PM -0500, Jeff King wrote: > > But anyway, that was a bit of a tangent. Certainly the smaller change is > > just standardizing on sizeof(*foo), which I think most people agree on > > at this point.

Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-23 Thread Simon Ruderich
On Mon, Jan 22, 2018 at 07:54:01PM -0500, Jeff King wrote: > But anyway, that was a bit of a tangent. Certainly the smaller change is > just standardizing on sizeof(*foo), which I think most people agree on > at this point. It might be worth putting in CodingGuidelines. Personally I prefer

Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-23 Thread Simon Ruderich
On Mon, Jan 22, 2018 at 01:35:25PM +0100, Lars Schneider wrote: >>> + enc->name = xstrdup_toupper(value); /* aways use upper case names! */ >> >> "aways" -> "always" and I think the comment should say why >> uppercase is important. > > Would that be better? > > /* Aways use upper case

Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-22 Thread Jeff King
On Mon, Jan 22, 2018 at 01:35:25PM +0100, Lars Schneider wrote: > >> + enc = xcalloc(1, sizeof(struct convert_driver)); > > > > I think this should be "sizeof(struct encoding)" but I prefer > > "sizeof(*enc)" which prevents these kind of mistakes. > > Great catch! Thank you! > > Other code

Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-22 Thread Lars Schneider
> On 21 Jan 2018, at 15:22, Simon Ruderich wrote: > > On Sat, Jan 20, 2018 at 04:24:17PM +0100, lars.schnei...@autodesk.com wrote: >> +static struct encoding *git_path_check_encoding(struct attr_check_item >> *check) >> +{ >> +const char *value = check->value; >> +

Re: [PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-21 Thread Simon Ruderich
On Sat, Jan 20, 2018 at 04:24:17PM +0100, lars.schnei...@autodesk.com wrote: > +static struct encoding *git_path_check_encoding(struct attr_check_item > *check) > +{ > + const char *value = check->value; > + struct encoding *enc; > + > + if (ATTR_TRUE(value) || ATTR_FALSE(value) ||

[PATCH v4 5/6] convert: add 'working-tree-encoding' attribute

2018-01-20 Thread lars . schneider
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