handling zip files
Steve Barnes
gadgetsteve at hotmail.com
Sun Dec 15 14:10:14 UTC 2013
On 15/12/13 13:39, Franklin Siler wrote:
> On Dec 15, 2013, at 07:19, Steve Barnes <gadgetsteve at hotmail.com> wrote:
>
>> IMHO the one type of binary file that it almost never makes sense to track is a .zip file - track the contents and generate the .zip file on the fly either using pythons zipfile module or using one of the command line zip file tools.
> This is a very pure but ultimately unhelpful mode of thinking. The reality is that file handlers for non-text files would be incredibly useful: I would LOVE if there was easy support for sqlite files, for example. I’m working on unmarshaling them to text, compare with vimdiff, and merge back to binary when finished.
> I think there are many use cases where it makes perfect sense to track other binaries, including .zip and associated formats, such as Open Documents, in version control.
> I hear the frequent refrain “use an artifact repo!”, but I have yet to see one that doesn’t suck (tm).
>
> Cheers,
>
> Frank Siler
> Siler Industrial Analytics
> 314.799.9405
>
This is not purity but practicality - aside from being able to use
differencing tools - the many version control systems store the
differences between files and/or a compressed file system - in both
cases .zip files actually get bigger when put into the version control
system. Because of the way that zip works a one line change to a single
file may result it Megabytes of difference in the .zip file. Also
sending just compressible differences over networks or the internet when
you commit your changes.
It also resolves the problem if there is an automatic zip as part of the
build/release process then the zip file will always be up to date and
the source files can be readily compared with kdiff - if you take any
other approach you will eventually need a diff tool for every file type
and mercurial will go the way of MS-Office and you will have to install
it from DVD(s) - you will probably end up having to pay 1000s for the
licence(s) of all the supported file comparison tools.
You can also use a pre-commit, post-update hook to automatically update
any zip file(s) on the local file system so that they match the content
of the controlled files.
Gadget/Steve
More information about the Mercurial
mailing list