2

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?

3 Answers 3

3

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:

  • Use a single patch queue and have all your patch order sequentially in it
  • Use several patch queues, with the qqueue command, and have patches grouped by whatever criteria fits you.

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.

Sign up to request clarification or add additional context in comments.

Comments

3

Both Git and Mercurial can easily handle both text and binary files. Use whichever you prefer. And yes, a VCS is the right choice.

11 Comments

VCS makes managing this a lot more complicated, believe it or not. For my purposes, its a lot cleaner if everything can be done in terms of some kind of patches and the patches are maintained in a repository.
A VCS is nothing else than a tool around such a repository containing patches.
@Vanwaril: It sounds like what you might be looking for is a patch queue? If so, there are projects that implement patch queues on top of both Mercurial and Git. For Mercurial, see hg mq, for Git, see git.wiki.kernel.org/index.php/…
Mercurial and Git can make binary patches.
@Vanwaril: hg mq can handle different patch queues (have a look at stevelosh.com/blog/2010/08/… ). More over you can easily change the patch order as long as they are really independent.
|
0

If you don't like a VCS as such, try using a ftp server containing patches. Version numbers can be used as directory names. This system can be backed with a script, which applies patches sequentially based on directory names.

In the project I'm working on, database patches are applied in this manner. However, they are maintained inside a VCS. A file can be used to maintain the current version, which will be read by the script to decide which patch to apply.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.