Versions when binary and text files are involved?

I have a project where I need to support changes to both text and binary files. I have several options:

  • Using patches
  • Use a version control system such as git or hg.

For my purposes, patches are the best option if they are only text files. However, since there are images that can be replaced / added / removed, is this the best way to go?

Is there a clean diff / patch utility that can also take care of binary differences (without the need to specify it in binary form - I should be able to delimit the entire directory and not separate files, which I can not do with bash diff in binary mode) and use them like patches? If not , which version control system is cleaner when it comes to binary files?

+2
git mercurial versioning quilt
Feb 17 2018-11-11T00:
source share
3 answers

Mercurial has the concept of a patch queue (with the mq extension turned on), largely inspired by quilt .
This allows you to manage your fixes in several ways:

  • Use a single patch queue and sequentially set your patch order in it
  • Use multiple queues of patches with the qqueue command, and you have patches grouped by any criteria that suits you.

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

You can find more helpful information on managing patch queues in the Steve Losch Mercury Queue tutorial .

+2
Feb 17 '11 at 10:33
source share

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

+2
Feb 17 '11 at 7:10
source share

If you don't like VCS as such, try using an ftp server that contains patches. Version numbers can be used as directory names. This system can be copied using a script that sequentially applies patches based on directory names.

In the project I'm working on, database patches are applied this way. However, they are supported internally by VCS. The file can be used to support the current version, which will be read by the script, to decide which patch to apply.

0
Dec 17 '14 at 16:46
source share



All Articles