(cvs.info.gz) syntax
Info Catalog
(cvs.info.gz) Trigger Scripts
(cvs.info.gz) Trigger Script Security
C.3.1 The common syntax
-----------------------
The administrative files such as `commitinfo', `loginfo', `rcsinfo',
`verifymsg', etc., all have a common format. The purpose of the files
are described later on. The common syntax is described here.
Each line contains the following:
* A regular expression or the literal string `DEFAULT'. Some script
hooks also support the literal string `ALL'. Other than the `ALL'
and `DEFAULT' keywords, this is a basic regular expression in the
syntax used by GNU emacs. See the descriptions of the individual
script hooks for information on whether the `ALL' keyword is
supported ( Trigger Scripts).
* A whitespace separator--one or more spaces and/or tabs.
* A file name or command-line template.
Blank lines are ignored. Lines that start with the character `#' are
treated as comments. Long lines unfortunately can _not_ be broken in
two parts in any way.
The first regular expression that matches the current directory name
in the repository or the first line containing `DEFAULT' in lieu of a
regular expression is used and all lines containing `ALL' is used for
the hooks which support the `ALL' keyword. The rest of the line is
used as a file name or command-line template as appropriate. See the
descriptions of the individual script hooks for information on whether
the `ALL' keyword is supported ( Trigger Scripts).
_Note: The following information on format strings is valid as long as
the line `UseNewInfoFmtStrings=yes' appears in your repository's config
file ( config). Otherwise, default format strings may be
appended to the command line and the `loginfo' file, especially, can
exhibit slightly different behavior. For more information,
Updating Commit Files._
In the cases where the second segment of the matched line is a
command line template (e.g. `commitinfo', `loginfo', & `verifymsg'),
the command line template may contain format strings which will be
replaced with specific values before the script is run.
Format strings can represent a single variable or one or more
attributes of a list variable. An example of a list variable would be
the list available to scripts hung on the loginfo hooks - the list of
files which were just committed. In the case of loginfo, three
attributes are available for each list item: file name, precommit
version, and postcommit version.
Format strings consist of a `%' character followed by an optional
`{' (required in the multiple list attribute case), a single format
character representing a variable or a single attribute of list
elements or multiple format characters representing attributes of list
elements, and a closing `}' when the open bracket was present.
_Flat format strings_, or single format characters which get replaced
with a single value, will generate a single argument to the called
script, regardless of whether the replacement variable contains white
space or other special characters.
_List attributes_ will generate an argument for each attribute
requested for each list item. For example, `%{sVv}' in a `loginfo'
command template will generate three arguments (file name, precommit
version, postcommit version, ...) for each file committed. As in the
flat format string case, each attribute will be passed in as a single
argument regardless of whether it contains white space or other special
characters.
`%%' will be replaced with a literal `%'.
The format strings available to all script hooks are:
c
The canonical name of the command being executed. For instance,
in the case of a hook run from `cvs up', CVS would replace `%c'
with the string `update' and, in the case of a hook run from `cvs
ci', CVS would replace `%c' with the string `commit'.
n
The null, or empty, string.
p
The name of the directory being operated on within the repository.
r
The name of the repository (the path portion of `$CVSROOT').
R
On a server, the name of the referrer, if any. The referrer is
the CVSROOT the client reports it used to contact a server which
then referred it to this server. Should usually be set on a
primary server with a write proxy setup.
Other format strings are file specific. See the docs on the
particular script hooks for more information ( Trigger Scripts).
As an example, the following line in a `loginfo' file would match
only the directory `module' and any subdirectories of `module':
^module\(/\|$\) (echo; echo %p; echo %{sVv}; cat) >>$CVSROOT/CVSROOT/commitlog
Using this same line and assuming a commit of new revisions 1.5.4.4
and 1.27.4.1 based on old revisions 1.5.4.3 and 1.27, respectively, of
file1 and file2 in module, something like the following log message
should be appended to commitlog:
module
file1 1.5.4.3 1.5.4.4 file2 1.27 1.27.4.1
Update of /cvsroot/module
In directory localhost.localdomain:/home/jrandom/work/module
Modified Files:
file1 file2
Log Message:
A log message.
Info Catalog
(cvs.info.gz) Trigger Scripts
(cvs.info.gz) Trigger Script Security
automatically generated byinfo2html