sourcecred/.gitattributes
William Chargin e91a2ae247
Treat Sharness snapshots as binary (#1846)
Summary:
The Sharness snapshots contain large data files that are effectively
blobs, but happen to be encoded as UTF-8 JSON. Consequently, they fill
up a terminal with junk when they wriggle into a `grep` or `diff` or
similar. This patch fixes that by teaching Git to treat them as binary.
If you ever want to see a raw diff (unlikely, since these files have
many kilobytes of data with no newlines), just pass `-a`/`--text`.

This isn’t perfect—e.g., it only works with Git (not, e.g., Ripgrep)—but
it’s better than nothing.

Test Plan:
Run `git grep 6961` and note that the result now shows just three lines,
including the desired text result and two “Binary file matches” notes.
Run `git grep -a 6961` and note that the monstrosity returns.

wchargin-branch: sharness-snapshots-binary
2020-06-08 09:43:51 -07:00

3 lines
75 B
Plaintext

# Large single-line snapshot files.
sharness/__snapshots__/**/*.json -diff