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

Re: [PATCH 5/5] pathspec: record labels

From
Junio C Hamano <gitster@pobox.com>
Date
May 16, 2016, 18:52 UTC
Message-ID
<xmqq8tz93kf9.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kbN_pzAVeAa-St_KRs60SbURTfKKP0v+do_+MK7orTkTg@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
> So "warn and ignore" for data from .gitattributes and die for
> commandline arguments? That makes sense.
Yes.

On the "command line" front, because we may want to give different meanings to these two entries in the future:

        :(label=-doc)Documentation/
	:(label=!doc)Documentation/

we should diagnose -doc (FALSE) as an error, not treating it as the same as !doc (UNSET). And we should warn and ignore -doc (FALSE) in .gitattributes. Yes, ignoring it would be more or less equivalent to treating it as UNSET, but because we may use -doc (FALSE) for a better purpose later, we should still warn.

Show 9 quoted lines
> Ok, so here is the warn-and-ignore code:
>
>
>         if (ATTR_TRUE(check.value))
>                 ret = 1; /* has all the labels */
>         else if (ATTR_FALSE(check.value)) {
>                 warning(_("Path '%s': Label must not be false. Treat
> as if no label was set"), path);
>                 ret = 0;

s/Treat as if .../The -label may be used differently in future versions of Git, so do not use it/;

But if we are going in the direction of :(attr:crlf=auto), all this discussion is moot, isn't it? I haven't formed a firm opinion on this, but it sure does sound tempting, doesn't it?

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