Git development
 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 10:34:04 -0700	[thread overview]
Message-ID: <xmqq37pgy4fn.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kbYB_4KO+XpYa0OhAcU63Q2M2kLWa03HcxeYS1HJOgfZw@mail.gmail.com> (Stefan Beller's message of "Tue, 17 May 2016 10:03:38 -0700")

Stefan Beller <sbeller@google.com> writes:

>> 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, ...

Remove the ambiguity by declaring that the list is always whitespace
separated.  No whitespace in var, no whitespace in val, no quoting.

The set of attributes with values expected to be used in the
pathspec "attribute match" magic, I do not think there is anything
that wants such a random arbitrary string.  The value side of an
attribute with value, e.g. "eol=crlf", "conflict-marker-size=7", is
designed to be a token that our C code is prepared to parse.

In other words, if you match the parsing semantics of parse_attr()
in attr.c, you are OK.  The attribute subsystem will not give users
anything that is more complex than what that routine is prepared to
parse, and that is a "whitespace separated list, no whitespace in
attribute names, no whitespace in values, no quoting".

  reply	other threads:[~2016-05-17 17:34 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 [this message]
2016-05-17 17:45         ` Stefan Beller
2016-05-17 18:05           ` Junio C Hamano
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=xmqq37pgy4fn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox