gitmercurialversioningpatchquilt

Versioning when binary AND text files are involved?


I have a project where I need to maintain changes to both the text and binary files. I have a couple of options:

  1. Use patches
  2. Use a versioning system like git or hg.

For my purposes, patches are a better option if it was only text files. However, since there are images that might be replaced/added/deleted, which is the best way to go?

Is there a clean diff/patch utility that can take care of binary differences as well (without me having to specify it is binary -- I should be able to diff the entire directory and not individual files, which I can't with bash's diff in binary mode) and use them as patches? If not, which versioning system is a cleaner option when it comes to binary files?


Solution

  • Mercurial has the notion of patch queue (with the mq extension enabled), largely inspired by quilt.
    This allows you to manage your patches in several ways:

    As a bonus, as patches queues are really patch files, you can easily change their order and even move/copy them from one queue to another (have a look in your .hg directory to find the patch queues).

    You can find a lot more of usefull information about managing patch queues at Steve Losh's tutorial on mercurial queue.