Re: [PATCH 32/36] pathspec: allow querying for attributes
From: Stefan Beller <hidden>
Date: 2016-10-27 21:32:45
On Wed, Oct 26, 2016 at 6:33 AM, Duy Nguyen [off-list ref] wrote:
(sorry if this should have been answered if I went through the series patch by patch, I wanted to do a proper review but finally have to admit to myself I won't, so I just skim through a single giant diff instead) On Sun, Oct 23, 2016 at 6:32 AM, Stefan Beller [off-list ref] wrote:quoted
+attr;; +After `attr:` comes a space separated list of "attribute +requirements", all of which must be met in order for the +path to be considered a match;What about (attr=abc def,attr=ghi lkj)? Does it mean (abc && def) || (ghi && lkj), or abc && def && ghi && lkj? Or is it forbidden to have multiple 'attr' attribute in the same pathspec?
Good point. I'll add a test for that.
Remembering the original discussion, multiple attrs
are forbidden for now as it is unclear what you want to see
as a user.
To model (abc && def) || (ghi && lkj), you would need to give
multiple pathspec items as these are naturally ORed:
git ls-files :(attr:abc def) :(attr:ghi lkj) .
(compare "git ls-files Makefile README" which gives
2 files to you, that are named respectively.)
To get "abc && def && ghi && lkj" you go with
git ls-files :(attr:abc def ghi lkj) .
as then all things included into this one attr are
ANDed. I hope the documentation is clear for one
attr.
Thanks,
Stefan