[Top][All Lists]

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

Re: CVS diff and unknown files.

From: Greg A. Woods
Subject: Re: CVS diff and unknown files.
Date: Wed, 2 Feb 2005 15:39:47 -0500 (EST)

[ On , February 2, 2005 at 16:02:12 (+0300), Sergei Organov wrote: ]
> Subject: Re: CVS diff and unknown files.
> What do we exactly mean by add-time here? The time when "cvs add"
> client command is invoked, or the time when new file is to be committed
> to the repository using "cvs commit"?

I've always meant the former -- i.e. "add-time" == 'cvs add' invocation.

To me the latter is a non-existant, and completely bogus, concept that's
best squashed and never thought of again.

> If the former, then server should not care/know about "cvs add" at all,
> so there is no such thing as "add-to-working-copy time" from the point
> of view of server, so there could be no server hooks invoked at this
> non-existing time, so these non-existing hooks can be neither the same
> nor different from commit-time hooks. In other words, I believe there
> should be no "cvs add" server command at all.

Hurray!  Yes, exactly!  "cvs add" (and "cvs rm") are no different than
using "vi" or "emacs", etc. to change files in the working directory.
The only difference being that the user needs to do something special to
record the presence of a to-be-managed (or or lack of presence of a
formerly managed) file in the working directory's CVS administrative
state files since normal local filesystem operations do not, and cannot,
be "noticed" after-the-fact by CVS.

> What I actually meant in the phrase you've taken out of contents and
> commented against is: iff somebody decides he needs to perform some
> checks on the server whenever user adds files to his working copy, he
> can arrange to invoke "cvs -n commit" after every "cvs add" (or as
> [optional] part of "cvs add"). This effectively makes *virtual*
> "add-time hooks" equal to "commit-time hooks" without any server-side
> "add-time hooks".

Yes -- we are in almost full agreement, but it cannot use '-n'.  (no
commitinfo scripts are run with '-n' and I don't think they should be or
ever need to be)

Also it's best not to ever even use the phrase "add-time hooks", virtual
or otherwise.  A commit of an added file is no different than any other
commit except that the file whole content now appears, not just some
changes to the file (or alternately every line of an empty file is
changed and replaced with all the lines of the new file).  It's
literally equivalent to "diff /dev/null newfile.c".

Commitinfo scripting hooks can (or at least they should be able to)
check to see if the whole file is appearing, or there are just changes
to an existing file, and one or more of those scripts can make decisions
based on any criteria available about the new file at commit time.

A commit of a new file is just a change of all the lines in the file.

One could even consider, logically speaking, that the file was dead (and
effectively in the Attic) and now it's being resurrected.  In fact
that's _exactly_ what happens when a file is removed & committed, and
then added and committed again.

                                                Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <address@hidden>
Planix, Inc. <address@hidden>          Secrets of the Weird <address@hidden>

reply via email to

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