gabriel rosenkoetter on Mon, 13 May 2002 10:05:46 -0400


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

[PLUG] Proper CVS new-module creation.


Greg A. Woods is a very difficult person to get along with, but when
he's right, he's really right. (Just sometimes he's so abrasive in
pointing out that he's right that you want to hit him in the face.
And then ignore his advice.)

Anyhow, sounds like various PLUG readers could use his description
of the Right Way to deal with new, locally-developed sources in a
CVS repository.

(This comes from info-cvs@gnu.org. You may want to trawl through the
archives of it at http://mail.gnu.org/pipermail/info-cvs/.)

There are many answers there about how to configure pserver
correctly too, incidentally (which I've always ignored, since I
think pserver's a waste of time ;^>).

-- 
gabriel rosenkoetter
gr@eclipsed.net

----- Forwarded message from "Greg A. Woods" <woods@weird.com> -----

From: woods@weird.com (Greg A. Woods)
Subject: RE: Lying about the author (and so).
Date: Wed, 17 Apr 2002 17:43:58 -0400 (EDT)
Reply-To: info-cvs@gnu.org (CVS-II Discussion Mailing List)
To: "EXT-Corcoran, David" <david.corcoran@boeing.com>
Cc: info-cvs@gnu.org (CVS-II Discussion Mailing List)
Delivered-To: gr@eclipsed.net
In-Reply-To: <58B6DA1B98AA9149B13B029976A48BCC088F5A6B@xch-nw-31.nw.nos.boeing.com>
X-Mailer: VM 7.00 under Emacs 21.1.3
Organization: Planix, Inc.; Toronto, Ontario; Canada
Errors-To: info-cvs-admin@gnu.org
X-BeenThere: info-cvs@gnu.org
X-Mailman-Version: 2.0.9
Precedence: bulk
List-Help: <mailto:info-cvs-request@gnu.org?subject=help>
List-Post: <mailto:info-cvs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/info-cvs>,
	<mailto:info-cvs-request@gnu.org?subject=subscribe>
List-Id: Announcements and discussions for the CVS version control system <info-cvs.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/info-cvs>,
	<mailto:info-cvs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/info-cvs/>

[ On Wednesday, April 17, 2002 at 09:22:19 (-0700), EXT-Corcoran, David wrote: ]
> Subject: RE: Lying about the author (and so).
>
> > You should _NOT_ use 'cvs import' _unless_ you're managing third-party
> > code.
> 
> This conflicts with another opinion I found on usenet (link below):

You'll find an infinite number of opinions on the Net.

The reason you don't want to use "cvs import" unless you're managing
third-party code is primarily three-fold:

	- most people forget to clean out the unwanted dregs of an
          initial "import", and having a vendor branch left over in your
          module might make some other idiot^Wcolleague think he/she can
          do another import for some bizzare reason.

	- you'll undoutably need to learn how to use "cvs add"
          eventually anyway.

	- there can also be issues with ignored and unignored files
          accidentally (not) being imported -- a manual 'add' process
          ensures everything is where it needs to be and you can start
          out with a .cvsignore files and run 'cvs -nq update' to check
          that everything's in the state it should be before committing
          your freshly added files (i.e. either "added" or "ignored").

> He also suggests an alternate:
> 
> 	Another way to do it is to create the top level dir that will
> 	hold your sources inside the CVS repository, check out that
> 	"empty" project, copy your source tree to your checked out
> 	dir and then add everything from there.

That's exactly what I'm talking about......

>  I've done it both
> 	ways and import is MUCH easier.

An import appears easier, but then you have to clean up the unwanted
stuff it creates.

> So what is the prefered method of creating a new project given you are *NOT*
> third party code?

Until/unless someone implements my long-standing "cvs add" proposal the
preferred method is to "cvs import" an empty directory, check it out,
copy the sources into it, and then "cvs add" of them.

Or more explicitly using this document I've posted before in the form of
a patch to the (currently incorrect and misleading) manual:


Creating a directory tree from scratch
--------------------------------------

   For a new project, the easiest and best thing to do is start with an
empty temporary directory and use the `import' command to create the
corresponding (empty) directory inside the repository:

     $ mkdir junk
     $ cd junk
     $ cvs import -m "new directory for DIR" yoyodyne/DIR yoyo start
     $ cd ..
     $ rmdir junk

   Check that the permissions CVS sets on the directories inside
`$CVSROOT' are reasonable.  You'll generally want the directory to be
mode 0775, and owned by the Unix group whos members are to have commit
privileges in this new directory.  In general it's irrelevant which
user owns the directories and files so long as the directories are
group-writable.  *Note File permissions:: for more detailed information.

   You can now check out the project directory into a working
directory.  Note that since you hopefully have specified `checkout -P'
in your `~/.cvsrc' file (*note ~/.cvsrc::.), you'll need to specify the
`-f' option to prevent CVS from immediately removing the new, and
empty, working directory:

     $ cd /work
     $ cvs -f checkout -d DIR yoyodyne/DIR

   If you first define a module (*Note Defining the module::) then you
can check out your new working directory using just the module name:

     $ cd /work
     $ cvs -f checkout DIR

   Now use `add' to add files (and new directories) as they are created
in your project.  Note that due to a hard-to-fix "bug" you must be in
the directory where you add new files.

     $ cd /work
     $ vi newfile.c
     $ make test-newfile
     $ cvs add newfile.c
     $ cvs commit -m 'first working version' newfile.c


Creating a directory tree for an existing project
-------------------------------------------------

   When you begin using CVS you may already have several existing
projects that can be put under CVS control.  If the files are your own
creation (i.e. they are not derived from changes made to files still
primarily being maintained by some third party) then it's best to
simply add them to a new project directory as if you were creating them
from scratch.

   Start by first creating an empty project as in the "From scratch"
examples.  Then after creating a new empty working directory simply
copy all of the files and directories from your existing project into
this new working directory.  You should first clean out all generated
files, of course, so that they won't be added to CVS.

     $ cd /work/oldprojectdir
     $ make maintainer-clean
     $ pax -rw . /work/DIR

   Now go to the newly populated working directory and use `add' to add
all the new files and directories to CVS as if they were all just newly
created.  If your project is large you might wish to use a little shell
script you can type on the command-line to eliminate some of the
repetitiveness (don't type the prompts):

     $ cd /work/DIR
     $ cvs add *
     $ for subdir in $(find . type d -print); do
     >> cd $subdir;
     >> cvs add *
     >> cd /work/DIR
     >> done
     $ cvs commit -m 'initial commit to CVS'


-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>

_______________________________________________
Info-cvs mailing list
Info-cvs@gnu.org
http://mail.gnu.org/mailman/listinfo/info-cvs

----- End forwarded message -----

Attachment: pgpweEwMgL1LF.pgp
Description: PGP signature