1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
|
.\" Process this file with
.\" groff -man -Tascii cvsreport.1
.\"
.TH CVSREPORT 1 "29 November 2003"
.SH NAME
cvsreport \- generate CVS activity reports
.SH SYNOPSIS
.B cvsreport [options]
.SH DESCRIPTION
\fBcvsreport\fP can extract \fIchangesets\fP from a CVS repository history, then
format it in plain text or HTML, and finally store it and/or send it via mail.
A \fIchangeset\fP is a set of commit operations (addition, removal, modification)
which happen along a single invocation of the \fBcvs commit\fP command. Used from
client side, it produces a report starting from an arbitrary date from a simple
working copy. On the server side, it can automatically generate reports and mail
them upon commit.
\fBcvsreport\fP will read configuration settings first, then fetch the history
info from the CVS repository, and run the user commands. Reports can be customized
via a simple configuration file. Commands let you store or mail any number of
reports to any number of targets. As a default (ie. no options and no command),
\fBcvsreport\fP will generate an automatic text report on standard output (see
\fBCOMMANDS\fP).
.SH EXAMPLES
.TP
cvsreport -a -d/var/cvsroot -f now-1month -n10
Report at most ten changesets from anyone which happened a month ago on the local
repository \fI/var/cvsroot\fP, send result as plain text on standard output.
.TP
cvsreport -d/var/cvsroot -f '2003-05-25 16:00 UTC' -e 'file text report.txt >>log.txt'
Send all changesets commited by the current user on the local repository
\fI/var/cvsroot\fP, starting from May, 25th 2003 at 16:00 Universal Time (GMT).
A plain text output is written to \fIreport.txt\fP and appended to \fIlog.txt\fP.
.TP
cvsreport -a -dproject.com:/cvsroot -f now-3week-2day-1hour -e 'mail text+html foo@project.com bar@project.com'
Send a multipart message to \fIcvs@project.com\fP embedding both default text and
HTML outputs. It contains events from all users which happened on the remote repository
\fIproject.com:/cvsroot\fP, starting from 3 weeks, 2 days and 1 hour ago.
.TP
cvsreport -a -dproject.com:/cvsroot -f now-1week -e 'set myhtml {footer=; encoding=UTF-8} file myhtml -'
Collect all commit events from the past week, and reports them as UTF-8 encoded HTML
thru standard output. Also remove the default footer which advertises cvsreport.
.SH AUTOMATIC MAIL ON COMMITS
If you don't specify the \fB-f\fP option, \fBcvsreport\fP notes its startup
time, waits for its caller's termination, then report on any commit events
which occured in between. Add this line to \fBCVSROOT/commitinfo\fP (via CVS!)
in the repository you want to watch :
.nf
ALL cvsreport -e 'mail text developers@project.com commit@project.com' %s
.fi
Please see also the mail command configuration in the \fBCONFIGURATION\fP section.
.SH OPTIONS
.TP
.B "-a, --all"
Report commit events from all users. As a default, only report events belonging to
the current user.
.TP
.B "-c, --config" \fIconfig-file\fP
Load a user configuration file (see \fBCONFIGURATION\fP). It is loaded after the
global configuration file (see also \fB-l\fP). You can use this option several times
to load multiple scripts. See also \fB-e\fP.
.TP
.B "-d, --cvsroot" \fIcvsroot\fP
Set the repository root address, works as its
.BR cvs (1)
counterpart.
When \fBcvsreport\fP is run from a working copy, the content of \fICVS/Root\fP is
read first, and overriden with this option if present.
When run outside from a working copy, \fBcvsreport\fP will use the value of the
\fBCVSROOT\fP environment variable, then override it if this option is present.
.TP
.B "-D, --debug"
Output verbose activity information on stderr. If \fBcvsreport\fP detaches itself
from the current tty, the output is then appended to \fI/tmp/cvsreport.log\fP.
.TP
.B "-e, --execute" \fIcommand\fP
Execute a \fIcommand\fP set and/or configuration instructions. The syntax of the execute
argument is the same as described in \fBCONFIGURATION\fP and \fBCOMMANDS\fP.
.TP
.B "-f, --from" \fIdate\fP
Start fetching changesets from the given \fIdate\fP.
The date format is the versatile one from
.BR cvs (1).
.TP
.B "-h, --help"
Display a summary of available options and commands.
.TP
.B "-l, --local"
Ignore the global configuration file.
.TP
.B "-n, --number" \fIn\fP
Parse at most \fIn\fP changesets. When this option is not present,
there is no limit.
.TP
.B "-v, --version"
Display the version and copyright info.
.SH COMMANDS
.TP
.B file \fIset\fP [>>]\fIfile\fP ...
Write the report configured by \fIset\fP into the listed files. If `\fI>>\fP' is
prepended to the file name, the report is appended to the existing file. The special
file name '\fB-\fP' represents standard output.
.TP
.B mail \fIset1\fP[+\fIset2\fP] \fIaddress\fP ...
Sends a report to the list of addresses. It is possible to send an alternative
multipart message : both text and HTML versions are sent, and the content selection
is done on the mail client according to its own preferences.
The mail command relies on an external mailing program. It can be configured
via the \fImail\fP configuration set.
.TP
.B my \fIvariable\fP = \fIvalue\fP ...
Define a user variable, which can be then referred with \fB$(name)\fP later. See
\fBCONFIGURATION\fP for a list of default variables.
.TP
.B run \fIcommand\fP [\fIargs\fP] ...
Run a user command with its argument. It is only called if there is at least one
commit event reported, and it is called no more than once per report. It can be
useful to run a single command per changeset from a CVS repository, instead of
the default CVS recursive filter invocation (one call for every modified folder).
.TP
.B test
This dummy command forces cvsreport to retrieve the CVS history even if there's no
effective command to execute afterwards. Useful for diagnosis with \fB--debug\fP.
.SH CONFIGURATION
A configuration script defines so-called \fIsets\fP which are a simple collection
of key/value pairs, and can also include a list of commands executed at load time.
Here are the startup defaults written as a configuration script :
.nf
# Default text set
set text {
format = text
encoding = iso-8859-1
}
# Default HTML set
set html {
format = html
encoding = iso-8859-1
title = message
footer = Generated by cvsreport $(version)
cgi_links = no
cgi_urlbase = please_set_cgi_urlbase
cgi_download = no
}
# Defaults for the mail command
set mail {
command = mail
subject = message
from =
reply-to =
}
.fi
The syntax does not require whitespaces, they are only recommended for clarity. The
statement separator can be either a newline or a semi-colon. Comments are not
allowed after a statement, they are only accepted on their own line.
Variables, denotated by the \fB$(name)\fP syntax, are substituted with their value
at load time. cvsreport automatically defines some variables :
.RS
.TP
.I version
The current cvsreport version
.TP
.I localtime
The current time, expressed in the host time zone.
.TP
.I gmtime
The current time in GMT (or UTC).
.TP
.I sfproject
The project name when hosted on a SourceForge-based site. It is extracted from the
parent folder of the CVSROOT.
.RE
Every \fIset\fP can be used to describe a report or configure a command.
The \fBtext\fP set is the default text mode report. To create your own text report,
declare a set whose \fIformat\fP field is set to \fBtext\fP. It will automatically
inherit the values from the default text set.
Similarly, \fBhtml\fP is the default set for HTML based reports. If you create
a set with a \fIformat\fP field set to \fBhtml\fP, it will inherit the default
values from the default HTML text set.
These fields are common to both text and HTML reports :
.RS
.TP
.I encoding
Defines the document character set. Note that it is currently only used for the
HTML document charset and the mail encoding header, no special conversion or
character handling is actually done.
.TP
.I diff
Selects some files whose difference has to be included in the report. Expects a comma
separated list of regular expressions. These regexes are matched against the files
full path (module/path/file).
.RE
The following fields are specific to the text report :
.RS
.TP
.I diff_format
Can be set to either \fIunified\fP or \fIcontext\fP. If unset, uses the local user CVS
settings or global defaults.
.RE
The following fields are specific to the HTML report :
.RS
.TP
.I title
Set the page title (not displayed in document body). If set to \fBmessage\fP,
automatically extracts the first line of the first changeset log message.
.TP
.I footer
Set the page footer text. As a default, advertise cvsreport with a simple link to
its home page.
.TP
.I cgi_links
If set to \fByes\fP, add CVSweb/ViewCVS hyperlinks to version numbers and diff symbols.
.TP
.I cgi_urlbase
If \fIcgi_links\fP is active, set the CGI base location.
.TP
.I cgi_download
If set to \fByes\fP, links will download file revisions 'as is'.
.RE
The mail command can be configured with the \fImail\fP set.
The following fields are available :
.RS
.TP
.I command
Set the command invoked to send mail. It can be either \fIinternal\fP or the name of
an external program.
The internal mailer uses SMTP directly. If the \fIsmtp_server\fP parameter is not set,
the default SMTP server configured in Net::Config will be used.
The external command is expected to accept the standard BSD \fImailx\fP behaviour :
\fB-a\fP for headers, \fB-s\fP for subject, addresses as regular arguments and body
received via stdin.
.TP
.I smtp_server
Set the name of the SMTP server when the internal mailer is used. Ignored if an
external mail program is used.
.TP
.I subject
Set mail subject. If set to \fBmessage\fP, automatically extracts the first line
of the first changeset log message.
.TP
.I from
Set the sender name and address. If unspecified, is forged from various information
sources.
.TP
.I reply-to
If set, add as a regular Reply-To header to every mail sent.
.RE
If no command is given to \fBcvsreport\fP, it automatically issues a \fBfile text -\fP
command. You can also use scripts to specify a list of commands, using the syntax
described in \fBCOMMANDS\fP. These commands are collected at start up time and all
executed when the history has been retrieved.
.SH FILES
.I /etc/cvsreport.conf
.RS
The global configuration file.
.RE
.I /tmp/cvsreport.log
.RS
The debug output when there is no tty (eg. on server side).
.RE
.SH ENVIRONMENT
.IP CVSROOT
The value of \fBCVSROOT\fP is used like in \fBcvs (1)\fP, see the -d option.
.IP CVS_RSH
Set the access method for an external cvsroot (rsh, ssh), see \fBcvs (1)\fP.
.IP CVSREPORT_DEBUG
When set, equivalent to the \fB--debug\fP option.
.SH BUGS
Working on remote repositories is \fBawfully\fP slow (blame CVS).
.br
Usage of whitespace in file or folder names messes cvsreport up (blame again CVS).
.SH AUTHOR
Written by Vincent Caron <v.caron@zerodeux.net>
.SH COPYRIGHT
Copyright \(co 2003 Vincent Caron.
.br
This is Free Software released under the GNU GPL license.
.SH "SEE ALSO"
.BR cvs (1),
.BR mail (1)
|