Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove empty directory from CVS?

Tags:

cvs

I'm not quite sure how this happened, but somehow a completely empty hierarchy of directories has ended up in my repository:

com/ com/companyname/ com/companyname/blah/ com/sun/ com/sun/java/ com/sun/java/jax_rpc_ri/ 

I think what happened was that these directories did have files in them, but then a developer realized he/she shouldn't have checked them in in the first place since these are by-products of the build process, so he/she removed the files but somehow the empty directories are left in the repository as ancient relics.

How can I remove this from CVS? The only results I seem to be able to find on google say that there shouldn't be a need to remove empty directories as CVS won't keep them around in the first place, and that the -P (prune) options to cvs update should remove them from the working directory - which is zero help if you actually have empty directories in your repository.

A cvs remove and cvs commit doesn't seem to take care of this situation:

$ cvs remove -Rf com cvs remove: Removing com cvs remove: Removing com/companyname cvs remove: Removing com/companyname/blah cvs remove: Removing com/sun cvs remove: Removing com/sun/java cvs remove: Removing com/sun/java/jax_rpc_ri $ cvs commit com cvs commit: Examining com cvs commit: Examining com/companyname cvs commit: Examining com/companyname/blah cvs commit: Examining com/sun cvs commit: Examining com/sun/java cvs commit: Examining com/sun/java/jax_rpc_ri $ ls -l com total 24 drwxrwxr-x  2 matt matt 4096 Oct 15 14:38 CVS drwxrwxr-x  9 matt matt 4096 Oct 15 14:38 companyname drwxrwxr-x  4 matt matt 4096 Oct 15 14:38 sun 

It's still there!

Does SVN have this weird behavior too?

like image 714
matt b Avatar asked Oct 15 '08 14:10

matt b


People also ask

How do I remove a folder from my CVS repository?

Remove the file from your working copy of the directory. You can for instance use rm . Use ' cvs remove filename ' to tell CVS that you really want to delete the file. Use ' cvs commit filename ' to actually perform the removal of the file from the repository.

How do I get rid of empty folders?

Click to open My Computer. Choose the Search tab at the top line. In the opening Search Menu, set Size filter to Empty (0 KB) and check All subfolders option. From the list of the files and folders that don't take up any disk space, right-click the empty folder(s) and select Delete.

Can I delete empty folders in C drive?

It is definitely not safe to delete all empty folders from your C drive, there are many folders used by Windows and the installed software that will be empty from time to time and the folders themself are still required for when Windows or that software needs the folder to be there.

How do you remove multiple empty directories?

Delete Empty Files in a Directory First, search all the empty files in the given directory and then, delete all those files. This particular part of the command, find . -type f -empty -print, will find all the empty files in the given directory recursively. Then, we add the -delete option to delete all those files.


2 Answers

AFAIK the CVS protocol does not allow to remove directories. You should go to the server console and remove them from the real physical repository.


http://www.network-theory.co.uk/docs/cvsmanual/Removingdirectories.html

You don't remove the directory itself; there is no way to do that.

like image 163
Jorge Ferreira Avatar answered Sep 19 '22 00:09

Jorge Ferreira


CVS checkout and update will always check out empty directories; that's just the way CVS is built. Do an update with "-P" -- "prune" -- to remove empty directories:

cvs update -dP 

(Adding "-d" will update new directories that have appeared since your last update; otherwise, CVS will ignore them.)

like image 30
Commodore Jaeger Avatar answered Sep 20 '22 00:09

Commodore Jaeger