[EMAIL PROTECTED] on 02/12/2000 01:02:01 AM
>[ On Friday, February 11, 2000 at 17:38:59 (-0500), Noel L Yap wrote: ]
>> Subject: Re: removing the need for "cvs add file" to contact the server....
>>
>> This has absolutely nothing to do with the original question, "How has/will
>> allowing the adding of empty directories hurt?"
>
>OK, let's start over again then.  First the reason why adding empty
>directories "hurts" CVS:
>
>CVS doesn't operate on directories, rather it operates within them on
>the files they contain.  There is no concept of an empty directory in
>CVS.

Yes there is.

>  In the most generic sense if a directory doesn't contain any
>CVS-managed files then it simply doesn't exist and that's all there is
>to it.

It's "cvs co", "cvs export", and "cvs up" that handle this behaviour.  No other
operation treats empty directories specially.  For example "cvs watch on
empty-dir" works just fine (as it should).

>  Having CVS somehow manage directories is beyond its design goals
>and indeed well and far beyond the needs of anyone using CVS for the
>purposes it was designed for.

I agree.  I'm not asking for "cvs add" to "manage" directories.  I'm asking for
it not to treat empty directories in any special way.  I've already shown (and
you've agreed to the implementation) that having "cvs add" treat empty
directories in a special way will complicate the code a lot (and extremely
increase disk access).

Someone else has also posted that having "cvs add" treat empty directories in a
special way doesn't guarantee that empty added local directories cannot exist
(via "cvs add newdir/file; cvs rm newdir/file").  This means that having the
invariant "thou shalt not have locally added empty directories" will complicate
"cvs rm" more.  What happened to simple tools that allows people to shoot
themselves in the foot?  Why should CVS "protect" users from the "mishaps" due
to empty directories?

>The bogosity of having to do "cvs add dir" in the first place was simply
>a hack to cause CVS to create a directory inside the repository.  In the
>olden days before CVS was able to operate remotely from the repository
>it woas sufficient to just do:  "mkdir `cat CVS/Repository`/newdir" and
>be done with it.

I'm not saying that "cvs add dir" should keep directly adding a directory into
the repository.  I'm saying (one more time) that "cvs add dir" shouldn't treat
"dir" specially depending on whether or not it's empty.

>No other command that works inside a CVS managed workspace treats a
>directory name as a command to do somethign to the directory itself.
>They *ALL* tell CVS to do its operations on the files within the named
>directory (and all subdirectories therein unless the '-l' common option
>is given too).

Again, take a look at "cvs watch on/off".

Taking another stance, "cvs add dir" will still act on files within dir.  The
difference with my proposition is that "dir/CVS" will be created whether or not
there're files within the hierarchy.  And, "dir" will get created upon "cvs ci"
whether or not there're files within the hierarchy.  There's absolutely no
reason to have additional complicated code to do this sort of checking.

>Andrew Nicholson proposed a very simple scheme that allows 'cvs add' to
>just do its thing in the same way *ALL* other CVS commands do so that it
>doesn't have to reserve any special meaning for operating on
>directories.  I've fleshed out these ideas into one simple proposal that
>fixes a number of very nagging problems all at once.

I've also posted pseudo-code that's much simpler due to the fact that it doesn't
have to check for the existence of files within the hierarchy.  It'll behave
exactly the same for "cvs add dir" as it would for "cvs add empty-dir" (or even
"cvs add empty-hierarchy").  It would even simplify documentation -- you'd just
document "cvs add dir" and not have any special documentation for "cvs add
dir-hierarchy-with-no-files" and "cvs add dir-hierarchy-with-files".

Noel


Reply via email to