Re: [PATCH 17/28] attr: expose validity check for attribute names

2016-10-11 Thread Brandon Williams
On 10/11, Stefan Beller wrote: > On Tue, Oct 11, 2016 at 11:40 AM, Brandon Williams wrote: > > > Wouldn't a +1 indicate that the attr name is valid while the 0 > > indicates that it is invalid? > > Right. > > > It looks to me like we are checking each > > character and if we run into one that

Re: [PATCH 17/28] attr: expose validity check for attribute names

2016-10-11 Thread Brandon Williams
On 10/11, Stefan Beller wrote: > On Tue, Oct 11, 2016 at 10:28 AM, Brandon Williams wrote: > > On 10/10, Stefan Beller wrote: > >> From: Junio C Hamano > >> -static int invalid_attr_name(const char *name, int namelen) > >> +int attr_name_valid(const char *name, size_t namelen) > >> { > >>

Re: [PATCH 17/28] attr: expose validity check for attribute names

2016-10-11 Thread Stefan Beller
On Tue, Oct 11, 2016 at 11:40 AM, Brandon Williams wrote: > Wouldn't a +1 indicate that the attr name is valid while the 0 > indicates that it is invalid? Right. > It looks to me like we are checking each > character and if we run into one that doesn't work then we have an error > and return 0

Re: [PATCH 17/28] attr: expose validity check for attribute names

2016-10-11 Thread Stefan Beller
On Tue, Oct 11, 2016 at 10:28 AM, Brandon Williams wrote: > On 10/10, Stefan Beller wrote: >> From: Junio C Hamano >> -static int invalid_attr_name(const char *name, int namelen) >> +int attr_name_valid(const char *name, size_t namelen) >> { >> /* >>* Attribute name cannot begin wi

Re: [PATCH 17/28] attr: expose validity check for attribute names

2016-10-11 Thread Brandon Williams
On 10/10, Stefan Beller wrote: > From: Junio C Hamano > -static int invalid_attr_name(const char *name, int namelen) > +int attr_name_valid(const char *name, size_t namelen) > { > /* >* Attribute name cannot begin with '-' and must consist of >* characters from [-A-Za-z0-9_.

[PATCH 17/28] attr: expose validity check for attribute names

2016-10-10 Thread Stefan Beller
From: Junio C Hamano Export attr_name_valid() function, and a helper function that returns the message to be given when a given pair is not a good name for an attribute. We could later update the message to exactly spell out what the rules for a good attribute name are, etc. Signed-off-by: Jun