info-cvs
[Top][All Lists]
Advanced

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

Re: (no subject)


From: Larry Jones
Subject: Re: (no subject)
Date: Tue, 15 Dec 2009 17:12:51 -0500

Rez P writes:
>  
> Our CVS server is running on Linux and users use CVS.exe or WinCVS on
> Windows client machines.  Is there any way to block users from adding or
> committing certain files or file patterns to our CVS repository?

There's no hook for add, but commitinfo is for pre-commit checks.  (I
can't imagine why you thought cvswrappers was applicable -- it's for
specifying text vs. binary and whether automatic merges are allowed.)

> I'm reading about the commitinfo file but there aren't ample examples
> except some vague references in the file using default or all or
> REGULAR_EXPRESSION [tab] PROGRAM_TO_RUN, whatever that means.  

All of the trigger scripts use the same basic format, so you can glean a
lot of information by looking at the examples for the other files.  In
this case, you'll need to write a commitinfo script to check for bad
names, something like:

        #! /bin/sh
        #
        #       commitinfo.sh repos file...
        #
        # Verifies that the file names are all acceptable
        #
        shift
        for file
        do
                case "$file" in
                [Tt][Hh][Uu][Mm][Bb][Ss].[Dd][Bb])
                        echo "Disallowed file name: $file"
                        exit 1
                        ;;
                esac
        done
        exit 0

Then add a line to your commitinfo administrative file to call it.  For
example, if you want it to apply to all the directories in your
repository, you could use:

        ALL $CVSROOT/CVSROOT/commitinfo.sh
-- 
Larry Jones

Why is it you always rip your pants on the day everyone has to
demonstrate a math problem at the chalkboard? -- Calvin




reply via email to

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