5 ms·
Yes! Use `<pattern> -linguist-generated` (the minus sets a negative override for any gitattribute). Here's a test demonstrating that this usage works: https:/
by brasic 4y ago
Yes! Use `<pattern> -linguist-generated` (the minus sets a negative override for any gitattribute).
Here's a test demonstrating that this usage works: https://github.com/github/linguist/blob/32ec19c013a7f81ffaeead25e6e8f9668c7ed574/test/test_repository.rb#L63-L117 https://github.com/github/linguist/blob/32ec19c013a7f81ffaee...
- jakub_g 4y agoDoes this really work for jump to file? (we're not talking language statistics or supressing diffs on PRs, which is mostly what linguist readme is talking about). Quoting the docs on finding files: https://docs.github.com/en/search-github/searching-on-github/finding-files-on-github https://docs.github.com/en/search-github/searching-on-github... > File finder results exclude some directories like build, log, tmp, and vendor. To search for files within these directories, use the filename code search qualifier. (The inability of quick jumping to files from /build/ folder with `T` has been driving me crazy for YEARS!) Correct me if I'm wrong, but checking those two files: - https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml https://github.com/github/linguist/blob/master/lib/linguist/... - https://github.com/github/linguist/blob/master/lib/linguist/generated.rb https://github.com/github/linguist/blob/master/lib/linguist/... I don't see `/build` matching anything there. So to me this `/build` suppression from search results seems like controlled by some other piece of software at GitHub :/ Also, files from `/build` are not hidden in diffs, so per this table: https://github.com/github/linguist/blob/HEAD/docs/overrides.md#summary https://github.com/github/linguist/blob/HEAD/docs/overrides.... they are not "linguist-generated".
- brasic 4y agoI checked and you're right: The endpoint that returns the file list has a hardcoded set of excludes and pays no attention to `.gitattributes`. I think it's reasonable to respect the linguist overrides here so I'll open a PR to remove entries from the exclude if the repo has a `-linguist-generated` or `-linguist-vendored` gitattribute for that directory [1]. So in your case you can add build/** -linguist-generated to `.gitattributes` and once my PR lands files under `build` should be findable in file-finder. Thanks for pointing this out! Feel free to DM me on twitter (@cbrasic) if you have more questions. [1] Recursively matching a directory with gitattributes requires the `/**` syntax unlike .gitignore: https://git-scm.com/docs/gitattributes#:~:text=with%20a%20few%20exceptions https://git-scm.com/docs/gitattributes#:~:text=with%20a%20fe...
- jakub_g 4y agoAwesome! Thanks!
- hoten 4y agoAmazing, thanks!
- brasic 4y agoFor anyone watching this thread, shoot me a DM if you’d like to test this change. It should be enabled in all repos within a week or two.
- brasic 4y agoThis is shipped for github.com! See https://github.com/github/docs/commit/37df8eadb1f3bd0c2606537d61a87c6ad0acdb74 https://github.com/github/docs/commit/37df8eadb1f3bd0c260653... which is now live on https://docs.github.com/en/search-github/searching-on-github/finding-files-on-github https://docs.github.com/en/search-github/searching-on-github...