Re: cvs init

2019-02-11 Thread David H. Gutteridge
On Fri, 8 Feb 2019 at 11:12:22 +, Patrick Welche wrote:
> On Thu, Feb 07, 2019 at 01:46:00PM -0500, Greg Troxel wrote:
> > As for the man page omission, maybe see if the bug is in upstream
> and
> > file a bug with them ;-) ?
> 
> I can give it a go ;-) That is part of the point, "init" doesn't
> appear.
> 
> > We could change the code to just not allow init of an existing dir
> at
> > all.
> 
> ... and maybe 
> https://wiki.netbsd.org/tutorials/how_to_setup_a_cvs_server/
> 
> which appears to do "mkdir mycompany"

Aside from the most recent upstream documentation* not being as
complete as we might like, there are two other general issues that
probably almost everyone knows of, but could be a bit of a stumbling
block for newer developers. One is that there are undocumented local
alterations and enhancements in the version NetBSD ships (there's more
than one PR open about this). The other is that the cvs(1) man page and
related info file NetBSD ships are missing fundamental commands that
are documented upstream, e.g., "add" and "remove" were examples, until
I fixed them the other day. (I happened to notice recently that "add"
was missing, which is why I started looking into this, but it wasn't at
the top of my to-do list.) And there's actually a PR open about "init"
being missing from NetBSD's distributed documentation: PR 45446. (And I
guess that wiki entry may need fixing, too.)

* The documentation shipped with CVS 1.11.23 is in some ways more
complete than what came with 1.12.13, because the 1.11 branch continued
to be maintained for a few years after the CVS project effectively
abandoned the 1.12 branch.

Also, part of why I'd referenced PR 45182 before is that there was a
broader issue raised in it: whether in general it's beneficial to
expect a "cvsadmin" group to exist locally to govern behaviour with
personal repositories. I imagine at this point the likelihood of
anything being reconsidered in this regard is low; it's more probable
NetBSD will move to a new VCS first.

Dave




Re: cvs init

2019-02-08 Thread Patrick Welche
On Thu, Feb 07, 2019 at 01:46:00PM -0500, Greg Troxel wrote:
> Patrick Welche  writes:
> 
> > $ cd /tmp
> > $ mkdir foo
> > $ cvs -d /tmp/foo init
> > cvs [init aborted]: init to an existing repository is restricted to members 
> > of the group cvsadmin
> > $ grep cvsadmin /etc/group 
> > $
...
> I just did "cvs -d /tmp/foo init" without creating foo first, and it
> worked fine (netbsd-8).
> 
> The error is about running init on an *existing* repository.

I mistakenly thought /tmp/foo would at least need to contain a CVSROOT
directory to count as a repository.

> As for the man page omission, maybe see if the bug is in upstream and
> file a bug with them ;-) ?

I can give it a go ;-) That is part of the point, "init" doesn't appear.

> We could change the code to just not allow init of an existing dir at
> all.

... and maybe https://wiki.netbsd.org/tutorials/how_to_setup_a_cvs_server/

which appears to do "mkdir mycompany"

Thanks for the correct syntax (and to David),


Patrick


Re: cvs init

2019-02-07 Thread David H. Gutteridge
On Fri, 2019-02-08 at 01:15 -0500, David H. Gutteridge wrote:
> On Thu, 07 Feb 2019, at 13:46:00 -0500, Greg Troxel wrote:
> > > $ cd /tmp
> > > $ mkdir foo
> > > $ cvs -d /tmp/foo init
> > > cvs [init aborted]: init to an existing repository is restricted
> > > to
> > members of the group cvsadmin
> > > $ grep cvsadmin /etc/group 
> > > $
> > > 
> > > I thought that if the cvsadmin group didn't exist on the system,
> > this
> > > restriction would be completely ignored? (according to "cvs admin"
> > command -
> > > no mention of it being applicable at all to "cvs init")
> > 
> > I just did "cvs -d /tmp/foo init" without creating foo first, and it
> > worked fine (netbsd-8).
> > 
> > The error is about running init on an *existing* repository.
> > 
> > I don't see that rerunning init on a repo that exists is something
> > anybody really wants to do, and if they do why using rm first is a
> > real problem.
> 
> The CVS documentation for version 1.12.13 states:
> 
> "cvs init is careful to never overwrite any existing files in the
> repository, so no harm is done if you run cvs init on an already set-
> up repository."
> https://web.archive.org/web/20111020045251/http://ximbiot.com/cvs/manual/cvs-1.12.13/cvs_2.html#SEC2

I realized I may have been unclear: I wasn't advocating for that as a
normal practice, or denying the code treats this as an error. I meant
that it's kind of counterintuitive to put a statement like that in
documentation without a caveat. (Basically what everyone else is saying
too.)

> > As for the man page omission, maybe see if the bug is in upstream
> > and
> > file a bug with them ;-) ?
> > 
> > We could change the code to just not allow init of an existing dir
> > at
> > all.
> 
> There is also a related NetBSD PR filed back in 2011:
> http://gnats.netbsd.org/45182

That PR is no longer relevant, it was addressed by christos@ in 2011.

Dave




Re: cvs init

2019-02-07 Thread David H. Gutteridge
On Thu, 07 Feb 2019, at 13:46:00 -0500, Greg Troxel wrote:
> > $ cd /tmp
> > $ mkdir foo
> > $ cvs -d /tmp/foo init
> > cvs [init aborted]: init to an existing repository is restricted to
> members of the group cvsadmin
> > $ grep cvsadmin /etc/group 
> > $
> >
> > I thought that if the cvsadmin group didn't exist on the system,
> this
> > restriction would be completely ignored? (according to "cvs admin"
> command -
> > no mention of it being applicable at all to "cvs init")
> 
> I just did "cvs -d /tmp/foo init" without creating foo first, and it
> worked fine (netbsd-8).
> 
> The error is about running init on an *existing* repository.
> 
> I don't see that rerunning init on a repo that exists is something
> anybody really wants to do, and if they do why using rm first is a
> real problem.

The CVS documentation for version 1.12.13 states:

"cvs init is careful to never overwrite any existing files in the
repository, so no harm is done if you run cvs init on an already set-up
repository."
https://web.archive.org/web/20111020045251/http://ximbiot.com/cvs/manual/cvs-1.12.13/cvs_2.html#SEC2

> As for the man page omission, maybe see if the bug is in upstream and
> file a bug with them ;-) ?
> 
> We could change the code to just not allow init of an existing dir at
> all.

There is also a related NetBSD PR filed back in 2011:
http://gnats.netbsd.org/45182

Regards,

Dave




Re: cvs init

2019-02-07 Thread Greg Troxel
Patrick Welche  writes:

> $ cd /tmp
> $ mkdir foo
> $ cvs -d /tmp/foo init
> cvs [init aborted]: init to an existing repository is restricted to members 
> of the group cvsadmin
> $ grep cvsadmin /etc/group 
> $
>
> I thought that if the cvsadmin group didn't exist on the system, this
> restriction would be completely ignored? (according to "cvs admin" command -
> no mention of it being applicable at all to "cvs init")

I just did "cvs -d /tmp/foo init" without creating foo first, and it
worked fine (netbsd-8).

The error is about running init on an *existing* repository.

I don't see that rerunning init on a repo that exists is something
anybody really wants to do, and if they do why using rm first is a real
problem.

As for the man page omission, maybe see if the bug is in upstream and
file a bug with them ;-) ?

We could change the code to just not allow init of an existing dir at
all.


cvs init

2019-02-07 Thread Patrick Welche
$ cd /tmp
$ mkdir foo
$ cvs -d /tmp/foo init
cvs [init aborted]: init to an existing repository is restricted to members of 
the group cvsadmin
$ grep cvsadmin /etc/group 
$

I thought that if the cvsadmin group didn't exist on the system, this
restriction would be completely ignored? (according to "cvs admin" command -
no mention of it being applicable at all to "cvs init")

I'm pretty sure this used to work... (today's amd64 -current)

Thoughts?


Cheers,

Patrick