-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 not working #5439
Comments
Nevermind, I figured it out: You have to use |
It is… in the gitattributes and gitignore docs (as this has nothing to do with Linguist; Linguist just takes advantage of the functionality). This has come up plenty times in the discussions and older issues. I think my comment at #5175 (comment) provides a good overview and reference to all relevant docs and demonstrates how to check the attributes without involving Linguist. |
Yes, I know, it's mostly my problem. I've tried reading that git manual many times, but after a couple of lines my eyes just glaze over. Not sure if it's the layout or just this jargon filled writing style, but for the life of me I can't make sense of that and usually end up copy n pasting stuff from stackoverflow instead.. I do think though that you could reduce the load of confused tickets like mine if the documentation here https://github.com/github/linguist/blob/master/docs/overrides.md#documentation would just use the more common case as an example. Most people probably will want to exclude the entire |
@lildude Are you referring to the requirement of adding |
.gitattribute parsing rules have been changed in rugged[1] between v0.28.5 and v1.0.0 (I believe something changed in libgit2, but it requires a bit more time to found the particular revision and I also guess it is required only for the history, so I gave up). As a result linguist[2] fails to find all files to be suppressed that are specified via the pattern in .gitattributes entry. Several users have been also experienced the same effect (for more info see github-linguist/linguist#5175 and github-linguist/linguist#5439). The fix itself is quite trivial: to suppress the files located not only in the specified directory, but also all in its subdirectories, double asterisk glob has to be used. [1]: https://github.com/libgit2/rugged [2]: https://github.com/github/linguist Signed-off-by: Igor Munkin <imun@cpan.org>
.gitattribute parsing rules have been changed in rugged[1] between v0.28.5 and v1.0.0 (I believe something changed in libgit2, but it requires a bit more time to found the particular revision and I also guess it is required only for the history, so I gave up). As a result linguist[2] fails to find all files to be suppressed that are specified via the pattern in .gitattributes entry. Several users have been also experienced the same effect (for more info see github-linguist/linguist#5439 and github-linguist/linguist#5451). The fix itself is quite trivial: to suppress the files located not only in the specified directory, but also all in its subdirectories, double asterisk glob has to be used. [1]: https://github.com/libgit2/rugged [2]: https://github.com/github/linguist Signed-off-by: Igor Munkin <imun@cpan.org>
Describe the bug
I have the following lines in
.gitattributes
:https://github.com/flack/openpsa/blob/c19ae95c45782bebb38f6ad4a2113e6f1c4818cf/.gitattributes#L7-L16
unfortunately, linguist ignores them completely, both when I run it locally and on github, too.
Expected behaviour
The listed folders should be excluded
Additional notes
I have tried (locally) to remove all lines from
.gitattributes
and just add a singlestatic/* linguist-vendored
, but even that doesn't work. Clearly, I'm missing something, but I have no idea what, my code looks like all the examples I could find onlineThe text was updated successfully, but these errors were encountered: