All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Duy Nguyen <pclouds@gmail.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [RFC-PATCHv6 4/4] pathspec: allow querying for attributes
Date: Tue, 17 May 2016 11:05:10 -0700	[thread overview]
Message-ID: <xmqqposkwofd.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kYbUTC7m-5kdTbvxmSkq__5BVz5x1UeieHhB4TVSqssHw@mail.gmail.com> (Stefan Beller's message of "Tue, 17 May 2016 10:45:31 -0700")

Stefan Beller <sbeller@google.com> writes:

> I am not talking about crazy stuff here, but consider our own
> .gitattributes file:
>
>     * whitespace=!indent,trail,space
>     *.[ch] whitespace=indent,trail,space
>     *.sh whitespace=indent,trail,space
>
> Now I want to search for
>
>     "the whitespace attribute that is set to at least trail and space"

With :(attr:VAR=VAL) syntax, you can only look for whitespace
attribute exactly set to "!indent,trail,space", so you can't.  So
you are talking about crazy stuff after all, aren't you?  Are you
now extending it to do "whitespace~=indent" or something like that?

You do not even need VAR=VAL form for your main topic.  You only
need group-doc group-code etc. to look for "set to TRUE", no?

I do not want to see us wasting too much time over-engineering it
without having a concrete and useful use case, and "find path to
whom whitespace checks are set for 'trail' and 'space'" is not.
These comma-separated tokens augment WS_DEFAULT_RULE which has
'trail' already, so you do not look for 'trail' in the first place.

"I want submodules under subs/ that is in either group-doc or
group-code" is more reasonable and realistic use case, but that does
not need any crazy stuff.  Either two separate pathspec elements,

	":(attr:group-doc)subs/" ":(attr:group-code)/subs/"

or if we are to do the "ORed collection of ANDed attrs", it would be
something like:

	":(attr:group-doc):(attr:group-code)/subs/"

no?

  reply	other threads:[~2016-05-17 18:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  3:13 [RFC-PATCHv6 0/4] pathspec attrs [WAS pathspec labels [WAS submodule groups]] Stefan Beller
2016-05-17  3:13 ` [RFC-PATCHv6 1/4] Documentation: fix a typo Stefan Beller
2016-05-17  3:13 ` [RFC-PATCHv6 2/4] pathspec: move long magic parsing out of prefix_pathspec Stefan Beller
2016-05-17  3:13 ` [RFC-PATCHv6 3/4] pathspec: move prefix check out of the inner loop Stefan Beller
2016-05-17  3:13 ` [RFC-PATCHv6 4/4] pathspec: allow querying for attributes Stefan Beller
2016-05-17  4:23   ` Junio C Hamano
2016-05-17 16:45     ` Stefan Beller
2016-05-17  5:03   ` Junio C Hamano
2016-05-17 17:03     ` Stefan Beller
2016-05-17 17:34       ` Junio C Hamano
2016-05-17 17:45         ` Stefan Beller
2016-05-17 18:05           ` Junio C Hamano [this message]
2016-05-17 18:10             ` Stefan Beller
2016-05-17 18:29               ` Junio C Hamano
2016-05-17 19:23     ` Stefan Beller
2016-05-17 20:25       ` Junio C Hamano
2016-05-18 15:39         ` Junio C Hamano
2016-05-17  4:14 ` [RFC-PATCHv6 0/4] pathspec attrs [WAS pathspec labels [WAS submodule groups]] Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqposkwofd.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.