I know via gitattributes
diff=...
one can set files specified by a name pattern to use a textconv
specified filter for git-diff
et al., but is there any way to have git-diff
use a specific diff filter for all files git
determines to be text files, no matter their name, but without affecting non-text files?
Asked
Active
Viewed 397 times
2

Tobias Kienzler
- 25,759
- 22
- 127
- 221
-
2I wish I could just do `git diff --textconv=path/to/script` to generate an ad-hoc different view of a diff. – rjmunro Jan 13 '16 at 15:51
-
1@rjmunro That alone would be nice indeed. Best I might come up with might be a script parsing `git log` for the changed files, adding them to a temporary `.gitattributes` file with the `textconv` and undo that after `git diff`. And I'd probably forget to check for binary files... – Tobias Kienzler Jan 13 '16 at 18:22
-
1You don't need the `git log`, you can use `*` in the .gitattributes folder. This means the diff is actually not that hard to do. – rjmunro Jan 18 '16 at 10:14
-
@rjmunro Indeed, what was I thinking? So the only problem would stem from files git would otherwise determine to be binary... – Tobias Kienzler Jan 18 '16 at 10:21