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

Re: "git check-attr" lists macros as being "set" -- feature or bug?

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Aug 3, 2011, 13:19 UTC
Message-ID
<4E394AEB.7020006@alum.mit.edu>
In-Reply-To
<7vvcuoq13i.fsf@alter.siamese.dyndns.org>
On 07/26/2011 09:43 PM, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>> I don't know the original rationale, but it seems like the only sane
>> behavior to me.
I agree that the behavior is sane (and also convenient).
> When we say "check-attr tells you if the named attribute is set", do we
> say "but macros cannot be examined this way" in the documentation?  If
> not, I do not think we need any cluttering update.
I was confused by the following things:
* The word "macro" in other contexts (e.g., C macros) typically refers
to something that is fully replaced by its substitution text, leaving no
trace of the original macro or its name.
* In gitattributes(5), the following misleading text:
Show 13 quoted lines
> ------------
> *.jpg -text -diff
> ------------
>
> but that may become cumbersome, when you have many attributes.  Using
> attribute macros, you can specify groups of attributes set or unset at
> the same time.  The system knows a built-in attribute macro, `binary`:
>
> ------------
> *.jpg binary
> ------------
>
> which is equivalent to the above.
It is *not* equivalent to the above, rather it is equivalent to
*.jpg binary -text -diff
(neglecting, of course, the recursive expansion of "binary").
I will soon send a documentation patch.
> It is a separate issue if macros should also be listed as the new feature
> that lists all attributes given to a path. I tend to think the macro
> attributes as well as the other attributes they set should all be shown.
I agree.
Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Junio C Hamano
Message 4 of 4 in “"git check-attr" lists macros as being "set" -- feature or bug?”
  1. Michael HaggertyJul 26, 2011
  2. Jeff KingJul 26, 2011
  3. Junio C HamanoJul 26, 2011
  4. Michael HaggertyAug 3, 2011

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.