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

Re: Change on check-attr behavior

From
Jeff King <peff@peff.net>
Date
Jan 18, 2019, 16:58 UTC
Message-ID
<20190118165800.GA9956@sigill.intra.peff.net>
In-Reply-To
<CAK3b1GJPZ5X3uEP1a-NF9PZkE0tTKVLda5hM32jExVz_OD2E=g@mail.gmail.com>
On Fri, Jan 18, 2019 at 09:41:03AM +0000, Sérgio Peixoto wrote:
Show 13 quoted lines
> Create a file  .git/info/attributes with contents
> 
> If the contents are:
> [attr]allowed-ext
> *.py allowed-ext=100
> 
> then the problem occurs.
> 
> If contents are:
> #[attr]allowed-ext
> *.py allowed-ext=100
> 
> the problem is gone
Ah, thanks, that's the secret sauce: it only affects macros.

I don't know how representative that attributes file is of your real repo, but there's possibly one immediate workaround: there's no need for the [attr] line here. You are free to define your own attributes, and only need "[attr]" if you're defining a macro that expands to other attributes.

Now, on to the actual bug. The simplest reproduction is:
  (echo "[attr]foo bar"; echo "* foo") >.gitattributes
  git check-attr foo file

which should report "foo" as set. This bisects to 60a12722ac (attr: remove maybe-real, maybe-macro from git_attr, 2017-01-27), and it seems like an unintentional regression there. I haven't yet poked into that commit to see what the fix will look like.

-Peff
Previous: Sérgio PeixotoNext: Jeff King
Message 4 of 15 in “Change on check-attr behavior”
  1. Sérgio PeixotoJan 17, 2019
  2. Jeff KingJan 17, 2019
  3. Sérgio PeixotoJan 18, 2019
  4. Jeff KingJan 18, 2019
  5. attr: do not mark queried macros as unsetJeff King, Jan 18, 2019
  6. Jeff KingJan 18, 2019
  7. Stefan BellerJan 18, 2019
  8. Jeff KingJan 22, 2019
  9. Duy NguyenJan 22, 2019
  10. Junio C HamanoJan 22, 2019
  11. Duy NguyenJan 21, 2019
  12. Jeff KingJan 22, 2019
  13. Duy NguyenJan 22, 2019
  14. Junio C HamanoJan 22, 2019
  15. Jeff KingJan 23, 2019

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.