git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC-PATCHv6 4/4] pathspec: allow querying for attributes

From
Junio C Hamano <gitster@pobox.com>
Date
May 17, 2016, 17:34 UTC
Message-ID
<xmqq37pgy4fn.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kbYB_4KO+XpYa0OhAcU63Q2M2kLWa03HcxeYS1HJOgfZw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 5 quoted lines
>> 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".

Previous: Stefan BellerNext: Stefan Beller
Message 10 of 18 in “[RFC-PATCHv6 0/4] pathspec attrs [WAS pathspec labels [WAS submodule groups]]”
  1. Stefan BellerMay 17, 2016
  2. 1/4 Documentation: fix a typoStefan Beller, May 17, 2016
  3. 2/4 pathspec: move long magic parsing out of prefix_pathspecStefan Beller, May 17, 2016
  4. 3/4 pathspec: move prefix check out of the inner loopStefan Beller, May 17, 2016
  5. 4/4 pathspec: allow querying for attributesStefan Beller, May 17, 2016
  6. Junio C HamanoMay 17, 2016
  7. Stefan BellerMay 17, 2016
  8. Junio C HamanoMay 17, 2016
  9. Stefan BellerMay 17, 2016
  10. Junio C HamanoMay 17, 2016
  11. Stefan BellerMay 17, 2016
  12. Junio C HamanoMay 17, 2016
  13. Stefan BellerMay 17, 2016
  14. Junio C HamanoMay 17, 2016
  15. Stefan BellerMay 17, 2016
  16. Junio C HamanoMay 17, 2016
  17. Junio C HamanoMay 18, 2016
  18. Junio C HamanoMay 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.