Skip to content

Whitelist only certain binary files #2504

Answered by BurntSushi
matko031 asked this question in Q&A
Discussion options

You must be logged in to vote

No, there is no way to do this unfortunately. The way binary file filtering is handled is a bit distinct from other types of filtering because binary file filtering is fundamentally different. It requires actually attempting to read the contents of the file to determine whether it's binary or not. And even then, the concept of "binary" is itself a heuristic.

One possibility is to just use --binary or even -a/--text and then blacklist other binary files. Probably not a great solution in general, but it might work well enough in some cases.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants