New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forcing git to consider PDFs as binary files #484
Comments
I cannot reproduce this problem. My git detects binary files just fine as is. Is this really a problem that needs to be solved? PDFs don't really get changed, they only ever get added. |
With commit 31ac8124469b466750cc18396b72547b6d1c613d
Author: Richard Smith <richard@metafoo.co.uk>
Date: Wed Nov 19 11:59:42 2014 -0800
Added papers N4296 (new working draft with post-Urbana motions) and
N4297 (editor's report for same).
diff --git a/papers/n4296.pdf b/papers/n4296.pdf
new file mode 100644
index 0000000..2cfe24f
--- /dev/null
+++ b/papers/n4296.pdf
@@ -0,0 +1,354848 @@
+%PDF-1.4
+%320324305330
+1 0 obj
+<< /S /GoTo /D (section*.1) >>
+endobj
+4 0 obj
+(Contents)
+endobj
[...] This is how it should look like (after applying #1022): commit 31ac8124469b466750cc18396b72547b6d1c613d
Author: Richard Smith <richard@metafoo.co.uk>
Date: Wed Nov 19 11:59:42 2014 -0800
Added papers N4296 (new working draft with post-Urbana motions) and
N4297 (editor's report for same).
diff --git a/papers/n4296.pdf b/papers/n4296.pdf
new file mode 100644
index 0000000..2cfe24f
Binary files /dev/null and b/papers/n4296.pdf differ
[...] Specifically, the following PDF files are recognized as text files:
Well,
|
@tkoeppe: Care to reconsider my pull request, then? |
@jensmaurer: OK, considering. @zygoloid, do you mind a new file in the repository? |
@aaronpuchert: To be pedantic, the PDF files you are seeing as text are serialized as text. That's why they're 11MB, rather than the binary-serialized versions that come it at under 6MB. Your proposal would be adding a deliberate override to not treat those text files as text. |
They're not really text files, rather a mixture of plain text and binary blobs. Run If you look at the other PDF files, you find that they are a mixture of text and binary as well, but there are more binary blobs, or they are right at the beginning. Otherwise, they are in no way different. They might have been generated by different applications though. Also, the diff of PDFs will most likely not be useful at all, whether they are more text or more binary. |
OK, fair enough. I'll let @zygoloid make the commit, so he's aware there's a new file now. |
Thanks for fixing the issue! |
It seems that git is incorrectly considering some PDFs as text files, e.g.
papers/n4431.pdf
. One can force git to consider files with certain endings to be binary using the.gitattributes
file. According to the docs, the lineshould solve the issue.
The text was updated successfully, but these errors were encountered: