[Top][All Lists]

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

Re: restrict commits of single file

From: Michael Niegl
Subject: Re: restrict commits of single file
Date: Tue, 9 Oct 2007 00:00:49 +0200

Hello Arthur,

On Oct 8, 2007, at 10:38 PM, Arthur Barrett wrote:


committable. So I tried to put into the commitavail file
avail | <username>
unavail | <username> | <file_incl_full_path>

Is this a part of cvsacls or is it some other patch, I've seen the odd
reference to it but I'm not sure.  I usually use CVSNT on linux which
has inbuilt ACLs but this appears to be something else...

No, it's neither CVSNT nor cvsacl, it's the "standard" CVS version 1.12.13 running on on Red Hat 7.3. I'm not sure about the exact details of the server side as it is centrally hosted on a cluster and AFS and i do not have administrative rights there, except for the project that I'm responsible for.

This helps in that sense that the user can't commit the single file  
alone anymore. yet when the full module in which it is embedded is  
checked in, the file is committed too. Is there any way to prevent  
this? I already checked the Cederqvist too, but couldn't find  
anything in there, so maybe someone here has an idea.

You'd need to write a trigger.  Precommit (CVSNT only?) and Loginfo will
receive the names of all files checked in in the commit.  You'll need to
parse it to see if the "one file" is in the list and if so check that
the "other file(s)" are also in the list.  Precommit will fail the
commit if you return a +ve value but loginfo you'll only be able to send
an e-mail or something warning the user that they should have also
committed "the rest"...

Sadly, there is no precommit in CVS, at least not in the version we're using.

Again - I'd do this in a C/C++ trigger in CVSNT on linux or windows, but
CVS only has script (eg: perl) triggers, but you could achieve the same
results if you know Perl well.  IF you need an example CVSNT C/C++
trigger have a look at the audit or email triggers in the cvsnt source
repo, if you need a sample perl script look at the cvs contrib

The idea with the trigger seems to be quite a good one though, I guess even without precommit it should be possible to "scan" the list of files to be checked in and remove the file. Or maybe one could do a not-so-nice workaround with automatically checking out an older version and then commit it with a forced revision number. I'd prefer to do this in C++ too, but I'm afraid I will have to give my Perl skills a try on that ;-)

Thanks a lot for your help,


Arthur Barrett

Michael Niegl, BSc.

University of Applied Sciences Wr. Neustadt
J. Gutenbergstr. 3, A-2700 Wr. Neustadt, Austria
Tel.: +43 2622-89084-298    Fax: +43 2622-89084-99

PH/UAT/SCT                Bat 161-1-020
CH-1211 Geneva 23, Switzerland
Tel: +41 22 76 73599      Fax: +41 22 76 77150


reply via email to

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