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

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

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jul 26, 2011, 12:10 UTC
Message-ID
<4E2EAEA3.8000307@alum.mit.edu>

I am doing some work on git-check-attr, and I noticed something funny: If a macro is used to set or clear attributes on a file in .gitattributes, then the name of the macro itself is listed as an attribute on that file. Example:

$ git init Initialized empty Git repository in /tmp/foo/.git/ $ echo '[attr]notest !test' > .gitattributes $ echo 'no notest' >> .gitattributes

# This is expected: $ git check-attr test -- no no: test: unspecified

# This I found surprising: $ git check-attr notest -- no no: notest: set

I don't see the correct behavior documented anywhere. If this is considered a bug, then I offer to fix it. If it is considered a feature, then I offer to document it.

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Next: Jeff King
Message 1 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.