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

Re: [RFC PATCH 0/4] pathspec labels [WAS: submodule groups]

From
Junio C Hamano <gitster@pobox.com>
Date
May 16, 2016, 22:19 UTC
Message-ID
<xmqqzirpzlvd.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kaP7rPu64ORXrGcONyoM2jA+gfPpy3LFkbp0Axff9dsHg@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 9 quoted lines
>> Ah, of course.  I thought that you were trying to limit ":(attr:<attribute>)"
>> magic only to attributes that begin with "label-", which is where my
>> "why not?" comes from.
>
> And going by the logic you presented before, we would
> need to error out for the given pathspec ":(<string>)" if
>
> * either the string is not well known (e.g. diif, eol )
> * or is outside of the labeling namespace.

I do not think that follows _my_ line of thought. What is "well known"? Doesn't that change over time?

If we are to do the "attribute match", there is no useful enforcement point. An arbitrary version of Git cannot differentiate a random cruft users will write in their .gitattributes from a legitimate attribute that will be introduced in the future, so both "data in .gitattributes" and "pathspec magic that referes to attribute" cannot be limited by us.

So if we are going to take the arbitrary ":(attr:<attribute>)" route, "label-" prefix would be limitation on the "core Git" side and does not limit what end-user does. We will promise that we won't use names that begin with the prefix ourselves and leave them up to the projects. If the end user uses an attribute "foo", which does not begin with "label-", the end user is risking to be broken by future versions of Git.

If you want to compile an authoritative list of attributes used by core Git and maintain it forever, you are welcome to add warning, but I wouldn't bother if I were doing this series, at least at the beginning.

Previous: Stefan Beller
Message 25 of 25 in “pathspec labels [WAS: submodule groups]”
  1. 0/4 pathspec labels [WAS: submodule groups]Stefan Beller, May 13, 2016
  2. 1/4 Documentation: correct typo in example for querying attributesStefan Beller, May 13, 2016
  3. 2/4 pathspec: move long magic parsing out of prefix_pathspecStefan Beller, May 13, 2016
  4. 3/4 pathspec: move prefix check out of the inner loopStefan Beller, May 13, 2016
  5. Junio C HamanoMay 13, 2016
  6. 4/4 pathspec: record labelsStefan Beller, May 13, 2016
  7. Junio C HamanoMay 13, 2016
  8. Stefan BellerMay 13, 2016
  9. Junio C HamanoMay 13, 2016
  10. Stefan BellerMay 13, 2016
  11. Junio C HamanoMay 13, 2016
  12. Duy NguyenMay 15, 2016
  13. Junio C HamanoMay 15, 2016
  14. Junio C HamanoMay 15, 2016
  15. Duy NguyenMay 16, 2016
  16. Stefan BellerMay 16, 2016
  17. Junio C HamanoMay 16, 2016
  18. Stefan BellerMay 16, 2016
  19. Junio C HamanoMay 16, 2016
  20. Stefan BellerMay 16, 2016
  21. Junio C HamanoMay 16, 2016
  22. Stefan BellerMay 16, 2016
  23. Junio C HamanoMay 16, 2016
  24. Stefan BellerMay 16, 2016
  25. Junio C HamanoMay 16, 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.