From 9a86c0467bbe42056f73fdf5b03fff757d7c4a9b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 7 Oct 2022 17:27:49 +0100 Subject: [PATCH] .gitattributes: Mark minified javascript as binary to filter greps When doing a git grep (of rustc-dev-guide or of rust-lang/rust with --recurse-submodules), if the grep happens to match within the minified javascript, the resulting long single lines can cause a text pager or editor to slow down and distract from more useful matches. Minified javascript isn't formatted for human consumption, by definition, so mark it as binary, which causes git grep to instead just state that it matches without printing the matching "line". --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index fd394480f15c3..ba72ee9592231 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,9 @@ # Set the default behavior, in case people don't have core.autocrlf set. * text=auto eol=lf +# git grep shouldn't match entries in huge minified javascript +*.min.js binary + # Older git versions try to fix line endings on images, this prevents it. *.png binary *.jpg binary