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

Re: [PATCH 1/2] gitattributes: Clarify discussion of attribute macros

From
Jeff King <peff@peff.net>
Date
Aug 3, 2011, 19:46 UTC
Message-ID
<20110803194632.GB23848@sigill.intra.peff.net>
In-Reply-To
<1312378890-31703-2-git-send-email-mhagger@alum.mit.edu>
On Wed, Aug 03, 2011 at 03:41:29PM +0200, Michael Haggerty wrote:
Show 8 quoted lines
> -which is equivalent to the above.  Note that the attribute macros can only
> -be "Set" (see the above example that sets "binary" macro as if it were an
> -ordinary attribute --- setting it in turn unsets "text" and "diff").
> +Setting the "binary" attribute also unsets the "text" and "diff"
> +attributes as above.  Note that attribute macros can only be "Set",
> +though setting one might have the effect of setting or unsetting other
> +attributes or even returning other attributes to the "Unspecified"
> +state.

This is slightly confusing. You can "unset" an attribute macro, and it will be reported as "unset". Which seems to contradict what is written above (although the error comes from the previous text). I think there are two possibilities for what a user might expect unsetting a macro to do for the sub-attributes:

  1. Leave them unspecified.
  2. Negate them (i.e., "-binary" means "text diff".
and we do (1).

I don't know if that was intentional, or if the behavior is simply accidental and the original code was simply never meant to have "-binary" called at all.

-Peff
Previous: Michael HaggertyNext: Junio C Hamano
Message 3 of 7 in “Clarify semantics of git attribute macros”
  1. 0/2 Clarify semantics of git attribute macrosMichael Haggerty, Aug 3, 2011
  2. 1/2 gitattributes: Clarify discussion of attribute macrosMichael Haggerty, Aug 3, 2011
  3. Jeff KingAug 3, 2011
  4. Junio C HamanoAug 3, 2011
  5. Jeff KingAug 3, 2011
  6. 2/2 gitattributes: Reword "attribute macro" to "macro attribute"Michael Haggerty, Aug 3, 2011
  7. Philip OakleyAug 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.