Re: [PATCH v2 09/12] attr: (re)introduce git_check_attr() and struct git_attr_check

2016-05-16 Thread Junio C Hamano
Eric Sunshine writes: > This field is unused, and git_attr_check_initl() neglects to > initialize it (if it is intended to be used in the future). There are two patterns to use the new API: - initl() variant is "initialize it once, never extend"; it is very much deliberate. This is used by

Re: [PATCH v2 09/12] attr: (re)introduce git_check_attr() and struct git_attr_check

2016-05-16 Thread Eric Sunshine
On Mon, May 16, 2016 at 5:05 PM, Junio C Hamano wrote: > A common pattern to check N attributes for many paths is to > > (1) prepare an array A of N git_attr_check_elem items; > (2) call git_attr() to intern the N attribute names and fill A; > (3) repeatedly call git_check_attrs() for path with

[PATCH v2 09/12] attr: (re)introduce git_check_attr() and struct git_attr_check

2016-05-16 Thread Junio C Hamano
A common pattern to check N attributes for many paths is to (1) prepare an array A of N git_attr_check_elem items; (2) call git_attr() to intern the N attribute names and fill A; (3) repeatedly call git_check_attrs() for path with N and A; A look-up for these N attributes for a single path P s