-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.gitattributes cannot represent a grammar name containing spaces #4496
Comments
It certainly does 😁 Even a copy of your The problem you're hitting is a known limitation with the way GitHub caches the blobs: the cache, and thus syntax highlighting, isn't refreshed when you make changes to the |
Thank you very much @lildude ! I confirmed that the problem was the GitHub cache issue. After touching the file, the highlighting is now working properly. I will close this issue. It would be helpful to document the .gitattributes syntax somewhere -- if I had confidence that my syntax was correct, then I would have tried harder to get it working before opening this issue. Unfortunately the linguist FAQ is apparently no longer published. |
Yeah, good idea. I think we can add it to https://github.com/github/linguist#using-gitattributes. As for the FAQ... it's not yet been published 😉. #4271 is the PR (/me nudges @pchaigno) |
Preliminary Steps
Please confirm you have...
Problem Description
I can specify a line like this in my .gitattributes file, and it works fine:
But If I try to use a grammar name that contains spaces, it does NOT work:
The reason is that .gitattributes lines are a sequence of value pairs that are delimited by spaces. I examined Git's parser, and as far as I can tell, it actually provides no way to escape the value part of a
name=value
pair.I also found an old Linguist FAQ document which suggests to put dashes instead of spaces, but that does NOT work either:
Substituting hyphens for spaces seems like a pretty good solution. Should we implement that? If so, where's the code?
Last modified on:
2019-04-15
The text was updated successfully, but these errors were encountered: