Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add CVS directories recursively

Tags:

cvs

I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "cvs add" only adds the contents of the current directory, and using "cvs import" didn't look like the right thing either since it's still all code I'm producing (this howto claimed import is for 3rd party sources)

Do you guys know any way to recursively add everything in a given directory to the current CVS project (or if SVN or git makes this notably easier)?

like image 707
Chris Bunch Avatar asked Aug 07 '08 18:08

Chris Bunch


People also ask

How do I add a folder to CVS?

Create the directory in a local workspace. cvs add <dirname> . That's it. Note that unlike adding files, which require a subsequent cvs commit , when adding a directory the add happens on the server as soon as you've done the cvs add so make sure you choose the right directory name.

How do I list all files in a directory recursively?

Linux recursive directory listing using ls -R command. The -R option passed to the ls command to list subdirectories recursively.

How do I recursively search a folder?

An easy way to do this is to use find | egrep string . If there are too many hits, then use the -type d flag for find. Run the command at the start of the directory tree you want to search, or you will have to supply the directory as an argument to find as well. Another way to do this is to use ls -laR | egrep ^d .


1 Answers

I found this worked pretty effectively:

First, add all the directories, but not any named "CVS":

find . -type d \! -name CVS -exec cvs add '{}' \; 

Then add all the files, excluding anything in a CVS directory:

find . \( -type d -name CVS -prune \) -o \( -type f -exec cvs add '{}' \; \) 

Now, if anyone has a cure for the embarrassment of using CVS in this day and age...

like image 103
Tom Avatar answered Dec 31 '22 01:12

Tom