Re: [RFC-PATCHv6 4/4] pathspec: allow querying for attributes
- From
Stefan Beller <sbeller@google.com>
- Date
- May 17, 2016, 17:03 UTC
- Message-ID
- <CAGZ79kbYB_4KO+XpYa0OhAcU63Q2M2kLWa03HcxeYS1HJOgfZw@mail.gmail.com>
- In-Reply-To
- <xmqqvb2dxomo.fsf@gitster.mtv.corp.google.com>
On Mon, May 16, 2016 at 10:03 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
>
> int attr_match_nr;
> int attr_match_alloc;
> struct attr_match {
> struct git_attr *attr;
> char *value;
> enum attr_match_mode {
> ...
> } match_mode;
> } *attr_match;
> struct git_attr_check *attr_check;ok, I'll use that structure and go from here.
> > Then while parsing ":(attr:VAR1=VAL1 -VAR2 VAR3...)path/to/dir/",
This syntax is not pleasant to parse IMHO as it is not clear if the token after white space (-VAR2 here) is another attribute or the next part of the list of VAR1, i.e. this could also be:
:(attr:VAR1=VAL1 VAL2)
I wonder if we'd want to use the colon to separate different VARs:
:(attr:VAR1=VAL1 VAL2:-VAR2:VAR3)
which means:
match all path, that
* have VAR1 set to a value list containing at least
VAL1 and VAL2
* have VAR2 unset
* have VAR3 set to true.