Not sure if anyone is still interested in this issue. I ran into the same problems and here is my solution that uses git file filter.
Edit: Firstly, I cannot say that this is understandable, but this is the answer to the OP question! Read the entire offer before commenting. Also, thanks to @Toon Krijthe for advice to clarify the solution in place.
My solution is to use a filter for a βflatβ zip file into a monolithic extended (maybe huge) text file. During git, add / commit the zip file will be automatically expanded to this text format for normal text change, and during the check it will be automatically zipped.
A text file consists of entries, each of which represents a file in zip. So you can that this text file is a text image for the original zip. If the file in zip is actually text, it is copied to a text file; otherwise, it is encoded by base64 before copying to a text format file. It always saves the text file as a text file.
Although this filter does not make every file in a zip blob, the text file is mapped to a string that is a diff unit, while binary changes can be represented by updates to the corresponding base64, I think this is equivalent to what the OP imagines.
For more information and prototype code, you can read the following link:
Zippey git file filter
In addition, a loan to the place that inspired me to this decision: Description of the file filter
Sippey Apr 18 '14 at 9:19 2014-04-18 09:19
source share