[Top][All Lists]

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

cvs -s VAR=VALUE usage clarification

From: Bulgrien, Kevin
Subject: cvs -s VAR=VALUE usage clarification
Date: Wed, 23 Feb 2005 11:36:21 -0600

I have searched/scanned the info-cvs and bug-cvs archives, and do not
see evidence of this being addressed before, but, who knows, maybe I
flew right over it?

Does anyone know how cvs -s works?  I found one way to get it to work
but it seems more limited than I would have thought from reading the

The following example works as documented:

$ export CVSUMASK=7
$ cvs commit -m "test" blah
$ unset CVSUMASK

The way I read cederqvist, the following is equivalent:

$ cvs -s CVSUMASK=7 commit blah

Trouble is, it does not work.  This does not work either, and I even
tried removing the CVS prefix in the off chance that that might make
a difference:

$ cvs -s CVSIGNORE="junkfile" -nq update
? junkfile
$ cvs -s IGNORE="junkfile" -nq update
? junkfile

Nor this:

$ cvs -sEDITOR=joe commit snork

Am I doing something wrong, or is this the manual just too vague about
how -s is supposed to work.  I see this on both 1.11.16 and 1.11.17.

After some digging, I see that -s does work if used similarly to a
vague description given in C.8 Expansions in administrative files.
If, for example, commitinfo has something like this... ha ha...

  DEFAULT ${=run}

Now, "cvs -s run=/tmp/ commit blah" runs as a commit hook...
(and bombs if -s run= is not specified).  So anyway, -s does at least work
for some things.


$ cvs --version

Concurrent Versions System (CVS) 1.11.16 (client/server)


$ cvs --help-options
CVS global options (specified before the command name) are:


     -s VAR=VAL   Set CVS user variable.


I thought it would be nice to use -s in some scripts that need to make
sure things are done a certain way for a very specialize operation where
setting the environment was "more overhead".  There is an inexpensive
workaround, so its no sweat that it might not work, but then the manual
should ought to document actual usage, or cvs -s needs to be fixed/removed.

Can anyone confirm whether my I am doing something bogus or whether this
is really a possible bug?  Does the following imply that -s only works to
set values in the administrative files?



> -s variable=value 
> Set a user variable. See C.8 Expansions in administrative files. 


> If you want to pass a value to the administrative files which the user who
is running CVS can specify, use a user variable. To expand a user variable,
the administrative file contains ${=variable}. To set a user variable,
specify the global option `-s' to CVS, with argument variable=value. It may
be particularly useful to specify this option via `.cvsrc' (see section A.3
Default options and the ~/.cvsrc file). 
> For example, if you want the administrative file to refer to a test
directory you might create a user variable TESTDIR. Then if CVS is invoked
>   cvs -s TESTDIR=/work/local/tests
> and the administrative file contains sh ${=TESTDIR}/runtests, then that
string is expanded to sh /work/local/tests/runtests. 
> All other strings containing `$' are reserved; there is no way to quote a
`$' character so that `$' represents itself. 
> Environment variables passed to administrative files are: 
> The CVS-specific username provided by the user, if it can be provided
(currently just for the pserver access method), and to the empty string
otherwise. (CVS_USER and USER may differ when `$CVSROOT/CVSROOT/passwd' is
used to map CVS usernames to system usernames.) 
> The username of the system user. 
> Same as LOGNAME. Do not confuse this with the internal variable of the
same name. 

Kevin R. Bulgrien
Product Engineer

General Dynamics C4 Systems         
1915 Harrison Road                                    Tel: 903-295-1480 x288
Longview, TX 75604-5438                               Fax: 903-295-1479

reply via email to

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