info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bulk-Add


From: Laine Stump
Subject: Re: Bulk-Add
Date: 26 Feb 2001 18:47:36 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Richard Cobbe <address@hidden> writes:

> > If there is only the import method to handle huge directory-trees,
> > then the second question is answered as well.
> > The situation is:
> > - Someone adds some directories and files on the working directory.
> > - He has no idea of CVS.
> > - After some days he comes to me to add/commit his new/changed files 
> >   and folders to the repository.
> > - He cannot remamber which files and folders he created (sic!).
> > - Now I would like to add all new files and folders (lots of them).
> 
> Yuk.  That, I'm afraid, is a situation I don't really know how to handle.
> Perhaps someone else on the list can contribute?

It seems like shell scripts are becoming a lost art...

Okay, assuming that the work directory this other person is using
began its life by being checked out from CVS, just do something like
this from the toplevel directory:

   cvs update | grep '^\?' | cut -d" " -f2-100 | \
   while read f
   do
      cvs add "$f"
   done

You may need to do this a few times (once for each level of new
directory created), because I haven't made it recursive.

The first line prints a list of all files that cvs thinks need to be
added (anything that isn't already in the repository, and which
doesn't match any of the patterns in .cvsignore, or the default
cvsignore list (see the documentation, including the -I option).

On the other hand, if the work directory the other person is using
*didn't* begin its life being checked out from CVS, then shame on you!
;-) You can get around that by checking out a new work directory and
merging in the other person's changes by hand, but that's a lot of
extra work for no gain.

Finally, if your client is on Windows, don't *completely* despair -
install the CygWin tools from www.cygwin.com - it includes a copy of
the bash shell, which makes running Windows almost tolerable (and can
run the simple script above).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]