On Fri, Jan 18, 2019 at 09:41:03AM +0000, Sérgio Peixoto wrote:

> 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

Reply via email to