inotify -watch for file to change

Here is a simple command for you. It uses inotify tools. So first you need to install :

sudo yum install inotify-tools

and then you can try something like this:

while true; 
do 
inotifywait -r -e modify --exclude=".swp" . && make; 
done

Here, once the file changes, we are running make, but you can do anything you want.

 

 

Enhanced by Zemanta

cvs add files recursively – not already in repository

When you have a lot of files in some repository and you have added a couple of new, in CVS there is no command to add just the new ones to the repository, so here is a workaround for that.

cvs status 2>/dev/null | awk '{if ($1=="?")print "cvs add -kb " $2}'

Well, if you are adding text files then you might want to remove the “-kB” in the cvs command above.

 

Enhanced by Zemanta

meld – cvs diff with ease

Visualization of the "history tree" ...
Visualization of the “history tree” of a revision controlled project, showing branching, merging, tagging, etc. (Photo credit: Wikipedia)

There are couple of ways to make life easier with CVS diff. But here is one that is really good.
First if you haven’t, install meld:

sudo yum install meld

meld is basically a diff viewer and pretty good at it 😉

Now open meld from the menu or from the terminal. And then select New. In the dialog box that appears select “Version Control Browser”. In the Directory box, browse to the folder where you have the code checked out and select ok. And you are all set.

To see the diff with cvs version just double click.

Note: If you are getting issues when you double click, ensure that you do not have any commands for diff in .cvsrc file.

There are other ways of doing this, but thats for some other day.

Enhanced by Zemanta