[Top][All Lists]

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

RE: Lying about the author (and so).

From: Greg A. Woods
Subject: RE: Lying about the author (and so).
Date: Wed, 17 Apr 2002 17:43:58 -0400 (EDT)

[ 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;  <address@hidden>;  <address@hidden>;  <address@hidden>
Planix, Inc. <address@hidden>; VE3TCP; Secrets of the Weird <address@hidden>

reply via email to

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