Creating patches using CVS

Today I needed to create a patch to LTIB build system, oh gosh, LTIB uses CVS to version control.

LTIB people suggest me to use “cvs diff -u” to create patches, but it is not too easy as it appears. If you haven’t write access to repository, “cvs diff -u” will only works to existent files on CVS server which you change in your local copy.

Then if you create a new directory and a new file you need other approach. You need to install cvsutils to get the command “cvsdo”. The cvsdo will pretend to write the CVS entries and the normal cvs will think these files really exist on external repository.

Then this is the tip:
* First modify the file which already existent on repository;
When you got finished, execute:
$ cvs diff -u > ~/mymod.patch

* Create the directories and files you want;
Then execute:
$ cvsdo add newdirectoryadded/
$ cvsdo add newdirectoryadded/newfileonthisnewdir.c
$ cvsdo diff newdirectoryadded >> ~/mymod.patch

I hope there is some other easy way to create patch using CVS, but on my searches I just found it.

This is because I love git, I don’t need recreating wheel to get it working.