Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.gitattributes: treat all *.pdf files as binary
Some students may wish to commit PDF files into their downstream repos. The PDF file format[1] is _mostly_ text-like. As such, it is likely that the first 8000 bytes of any PDF file will _not_ contain a NUL byte, leading Git to treat the PDF file as a text file[2]. In AddressBook-Level4, our Travis `run-checks` scripts requires all text files, as determined by Git, to fulfill certain requirements such as only having LF line endings and not having any trailing whitespace. However, PDF files, although usually determined by Git to be text files, may not actually be _fully_ text. Particularly, PDF files may contain embedded binary streams which contain arbitrary binary data. This arbitrary binary data can cause PDF files to fail our Travis `run-checks` scripts. Given that PDFs _can_ contain binary data, it would thus make more sense to treat the entire file as binary. This both allows them to pass our `run-checks` scripts, as well as to prevent Git from giving not-very-useful text diffs when the PDF files are modified. As such, let's tell Git to treat all *.pdf files as binary. [1] https://en.wikipedia.org/wiki/PDF#File_structure [2] https://github.com/git/git/blob/ffc6fa0e396238de3a30623912980263b4f283ab/xdiff-interface.c#L201-L207
- Loading branch information