Discussion:
(no subject)
Rez P
2009-12-15 19:12:14 UTC
Permalink
Hi

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? Many of our users accidentally commit Windows Thumbs.db files into CVS. I added Thumbs.db to my cvswrappers file but it's not working and users still manage to check them in; I think because cvswrappers only gets used when users use the import command.

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.

Rhethorical and not CVS related: How come program Developers always lack the communication skills as to how to relate to the common masses and speak or write at our level of comprehension? If they provided ample examples, most of us wouldn't be asking however dumb or smart questions! Every computer book or manual I read, contains tons and tons of useless information as how to pass options or parameters to a command or they talk vague generalities but none of them provide specific examples applying specifically to the topic at hand!! Unix/Linux being the worst case in example by far. It's like bunch of automatons from another planet wrote and created the commands and utilities. The --help section of Linux commands are pretty much useless w/o examples. End of Rant. Sorry I just get frustrated when I can't find good examples.

Thanks


_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/
Larry Jones
2009-12-15 22:12:51 UTC
Permalink
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
Rez P
2009-12-15 22:20:56 UTC
Permalink
Thanks Larry. Sorry for forgetting to add a subject line to my email. I guess I misunderstood the function of cvswrapper file and now I know better. BTW, is there a repository of shell scripts and hooks for CVS somewhere? Thanks again.



Rez

> Subject: Re: (no subject)
> To: ***@hotmail.com
> Date: Tue, 15 Dec 2009 17:12:51 -0500
> CC: info-***@nongnu.org
> From: ***@siemens.com
>
> 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

_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/
Larry Jones
2009-12-15 22:39:16 UTC
Permalink
Rez P writes:
>
> BTW, is there a repository of shell scripts and hooks for CVS somewhere?

The only one I know of is the contrib directory in the CVS source
distribution.
--
Larry Jones

Nobody knows how to pamper like a Mom. -- Calvin
Rez P
2009-12-16 17:39:56 UTC
Permalink
Thank you for all your help. In commitinfo.sh you emailed me, is a left parantheses missing or is the right one a typo and extra?

> Subject: Re: Commitinfor and cvswrapper
> To: ***@hotmail.com
> Date: Tue, 15 Dec 2009 17:39:16 -0500
> CC: info-***@nongnu.org
> From: ***@siemens.com
>
> Rez P writes:
> >
> > BTW, is there a repository of shell scripts and hooks for CVS somewhere?
>
> The only one I know of is the contrib directory in the CVS source
> distribution.
> --
> Larry Jones
>
> Nobody knows how to pamper like a Mom. -- Calvin

_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
Larry Jones
2009-12-16 18:24:47 UTC
Permalink
Rez P writes:
>
> Thank you for all your help. In commitinfo.sh you emailed me, is a
> left parantheses missing or is the right one a typo and extra?

You're welcome. Neither, that's the syntax of the case command:

case word in
pattern) list ;;
...
esac
--
Larry Jones

I've got to start listening to those quiet, nagging doubts. -- Calvin
Rez P
2009-12-16 18:37:24 UTC
Permalink
Great and thanks again.

> Subject: Re: Commitinfor and cvswrapper
> To: ***@hotmail.com
> Date: Wed, 16 Dec 2009 13:24:47 -0500
> CC: info-***@nongnu.org
> From: ***@siemens.com
>
> Rez P writes:
> >
> > Thank you for all your help. In commitinfo.sh you emailed me, is a
> > left parantheses missing or is the right one a typo and extra?
>
> You're welcome. Neither, that's the syntax of the case command:
>
> case word in
> pattern) list ;;
> ...
> esac
> --
> Larry Jones
>
> I've got to start listening to those quiet, nagging doubts. -- Calvin

_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
Loading...