CVS diff with new files: fakeadd

Ever been disgruntled by the fact that you can't do a cvs diff with new files, because you haven't got write access on a Drupal contrib module's CVS repository and thus can't cvs add those new files? There's a solution though: edit CVS's Entries file. But who likes manually modifying files over and over again?

The solution: fakeadd! (I've attached the file to this post in case this site ever goes down.) This nice shellscript allows you to update the Entries file using a simple syntax: fakeadd  newfile.php.

A quick install how-to:

  1. Save the file to a location of your choice, I've saved it in ~/scripts.
  2. Open your ~/.bash_profile file (if you're using the bash shell, this is the default shell on OS X) and add the following:
    # Add custom scripts, such as the CVS fakeadd script.
    export PATH=$PATH:~/scripts
  3. Finally, make the script executable: chmod +x ~/scripts/fakeadd.
AttachmentSize
fakeadd665 bytes
Tags

Comments

It works. A couple extra pointers...

First, run the fakeadd script from the directory where the new file lives. If you're adding some new unit tests to D7, for example, they might be in ./includes/tests. fakeadd changes the CVS/Entries file in the current directory, so to add ./includes/tests/foo.test, you need to cd to includes/tests first.

Second, when making the patch, you need the -N flag:
cvs diff -N -up > foo.patch

Post new comment

The content of this field is kept private and will not be shown publicly.
Syndicate content