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