• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

CHANGELOGH A D01-Dec-20045 KiB12995

LICENSEH A D01-Dec-200417.6 KiB341281

READMEH A D01-Dec-200411.6 KiB268209

cvsplot.plH A D03-May-202237.2 KiB1,355966

README

1Cvsplot v1.7.4
2
3Cvsplot is used for collecting statistics from CVS controlled files.
4Simple statistics such as how the total number of files and lines of
5code change against time.  It runs under any flavour of UNIX, and
6under Windows (assuming Perl from http://www.activestate.com is
7installed).
8
9A simple invocation would be:
10
11cvsplot.pl -cvsdir :ext:cvsbox:/usr/local/cvsroot -rlog product \
12           -linedata linedata.txt -filedata filedata.txt
13
14Note, if using perl 5.8, the DateManip module contains characters that
15are non UTF-8 characters.  All invocations of cvsplot.pl should be
16done with the LANG environment variable set to "C".  With the bash
17shell, this would be:
18
19LANG=C cvsplot.pl ...
20
21I have been told this is no longer necessary with DateManip version
225.42 and above.
23
24The above command effectively retrieves cvs history information for
25all CVS controlled files in the "product" module from the CVS
26repository.  The -cvsdir argument is the same as the CVSROOT
27environment variable.  The results are stored into the linedata.txt
28and filedata.txt files in a simple text format.  Each line consists of
29a data point (corresponding to a CVS commit), which includes the date
30of the commit, and the corresponding number.
31
32For linedata.txt, this number represents the total number of lines
33for active files that exist in the repository up until that date.  For
34filedata.txt, this represents the total number of files that exists in
35the repository up until that date.  Note files which have been
36indicated as binary to CVS are ignored.
37
38If the period of interest is well defined, then it is possible to trim
39the statistics reported by optionally specifying start and/or end
40dates.  For example, if we are only interested in statistics starting
41from the 28th March, 2001, then the following can be entered:
42
43cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
44           -filedata filedata.txt -start "28th March, 2001"
45
46The -end option is used to specify the final date, for example:
47
48cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
49           -filedata filedata.txt -start "28th March, 2001" \
50           -end "2nd May, 2001"
51
52The date formats supported are very flexible, as the Date::Manip perl
53module is used for date parsing and manipulation.  The above command
54could have also been expressed as:
55
56cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
57           -filedata filedata.txt -start "2001/03/28" \
58           -end "2001/05/02"
59
60It is possible to specify filesets in order to restrict what statistics
61are generated.  For example, assuming we are only interested in C
62files, header files and java files, the following command could be
63specified:
64
65cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
66           -filedata filedata.txt -include '\.java$' -include '\.c$' \
67           -include '\.h$'
68
69The argument given to the -include option is in the syntax of a perl
70regular expression.  To avoid shell expansion, single quotes must be
71used.  It is also possible to specify files that should not be
72included.  Assuming we are interested in java and C files, but don't
73want to run statistics down the "kernel" sub-directory, then the
74following command could be issued:
75
76cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
77           -filedata filedata.txt -exclude '^kernel' \
78           -include '\.java$' -include '\.c$' -include '\.h$'
79
80The order of the -exclude and -include options is important.
81Whenever cvsplot examines a file, it runs through the list of -exclude
82and -include options in the order specified on the command line.  If
83the filename matches a -exclude option, it is skipped.  If a filename
84matches a -include option, it includes the file when collecting
85statistics.  If no -include or -exclude options have been specified,
86then the default behaviour is to include all files.  If -include or
87-exclude options have been specified, and a file doesn't match any of
88the include or exclude patterns, then it is *not* included when
89collecting statistics.
90
91The -include and -exclude options and semantics were based on the
92--include and --exclude options from rsync.
93
94It is also possible to provide a specific CVS branch in which to
95gather statistics.  The above command can be run against the
96RELEASE1 branch as follows:
97
98cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
99           -filedata filedata.txt -exclude '^kernel' \
100           -include '\.java$' -include '\.c$' -include '\.h$' \
101           -branch RELEASE1
102
103In addition to generating statistics into a text file, it is also
104possible to generate plots as a png file, assuming gnuplot is
105installed on your system.  I run cvsplot.pl in a cron job so that my
106team's statistics are updated nightly on our internal web-server.
107Gnuplot supports many other file formats, such as png, gif, jpg and
108postscript.
109
110To generate png files which will plot the statistics, the -gnuplot
111options are specified:
112
113cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
114           -filedata filedata.txt -gnuplotfiledata filedata.png \
115           -gnuplotlinedata linedata.png
116
117The filedata.png file presents the statistics in filedata.txt as a png
118file generated by gnuplot.  Similarly for linedata.png.
119
120Its also possible to generate plots which combine both the line and
121file data into a single plot, using the -gnuplotlinefiledata switch.
122
123cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
124           -filedata filedata.txt -gnuplotfiledata filedata.png \
125           -gnuplotlinedata linedata.png \
126           -gnuplotlinefiledata linefiledata.png
127
128For gnuplot users, it is possible to specify the "terminal parameters"
129sent to gnuplot when generating the plots.  For example, to generate
130the plots as a postscript eps using Times-Roman font, the following
131could be specified:
132
133cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
134           -filedata filedata.txt -gnuplotfiledata filedata.eps \
135           -gnuplotlinedata linedata.eps \
136           -gnuplotsetterm "post eps 'Times-Roman'"
137
138Its also possible to specify general gnuplot commands (separated by
139semi-colons) which will get executed before the final "plot" commands
140to generate the graphs.  One possibility might be to change the
141formatting of the x values, from their default %m/%y (month/year)
142format, such as %d/%m (day/month) and to set the title of the graph:
143
144cvsplot.pl -cvsdir /usr/local/cvsroot -rlog product -linedata linedata.txt \
145           -filedata filedata.txt -gnuplotfiledata filedata.eps \
146           -gnuplotlinedata linedata.eps \
147           -gnuplotsetterm "post eps 'Times-Roman'" \
148           -gnuplotcommand "set format x '%d/%m'; set title 'CVS History'"
149
150The above commands use the "cvs rlog" command, to retrieve the
151relevant information.  This command is properly implemented in CVS
152versions >= 1.11.1.  If you have an older version of CVS, you can still
153use cvsplot, however you need a checked out version of the module you
154want to gather statistics from (to run "cvs log" against).  Make sure
155the checkout is done without the -P flag, and those directories which
156are pruned will be excluded from the statistics, which is not what you
157want.  The only difference in command syntax is the argument to
158-cvsdir refers to your checked out sandbox, and the -rlog command is
159omitted.  For example, the previous command would be the following,
160assuming the product module was checked out in the ~/product
161directory.
162
163cvsplot.pl -cvsdir ~/product -linedata linedata.txt \
164           -filedata filedata.txt -gnuplotfiledata filedata.eps \
165           -gnuplotlinedata linedata.eps \
166           -gnuplotsetterm "post eps 'Times-Roman'" \
167           -gnuplotcommand "set format x '%d/%m'; set title 'CVS History'"
168
169Finally, for large plots, it is definately worth trying the -linestyle
170option, as this can dramatically improve readability.
171
172For platforms (such as windows) where gnuplot may not be in the
173standard PATH, and/or has a different name, the -gnuplot option can be
174used to specify the full path to the gnuplot binary.
175
176Since version 1.7.0, it is now possible to retrieve per-user
177statistics as well.  The -userdata option specifies the file which
178will store user commit information.  This file is used as input for
179gnuplot, when plotting per-user information.  An example invocation
180is:
181
182cvsplot.pl -cvsdir ~/product -linedata linedata.txt \
183           -filedata filedata.txt -userdata userdata.txt \
184           -gnuplotfiledata filedata.png \
185           -gnuplotlinedata linedata.png \
186           -gnuplotuserdata userdata.png \
187           -userlist fred,joe,peter,paul
188
189This command will create userdata.png, which will contain CVS line
190counts for contributions made by usernames fred, joe, peter and paul.
191If there is no -userlist argument, this will default to all found users
192in the CVS logs, which for some installations can be very large, and
193produce unreadable graphs.
194
195It is also possible to specify groups of users, as another way of
196reducing graph clutter.  The userdata graph will have a line displayed
197per-group rather than per-user.
198
199cvsplot.pl -cvsdir ~/product -linedata linedata.txt \
200           -filedata filedata.txt -userdata userdata.txt \
201           -gnuplotfiledata filedata.png \
202           -gnuplotlinedata linedata.png \
203           -gnuplotuserdata userdata.png \
204           -userlist group1=fred,joe \
205           -userlist group2=peter,paul
206
207It is also possible to specify a "default" group, so that any users
208not explicitly listed will be automatically become a member of this
209group.  This is achieved via the -defaultusergroup option, as shown
210below, in the case of the default group known as "group3".
211
212cvsplot.pl -cvsdir ~/product -linedata linedata.txt \
213           -filedata filedata.txt -userdata userdata.txt \
214           -gnuplotfiledata filedata.png \
215           -gnuplotlinedata linedata.png \
216           -gnuplotuserdata userdata.png \
217           -userlist group1=fred,joe \
218           -userlist group2=peter,paul \
219           -defaultusergroup group3
220
221An option to mention which affects all linecount statistics
222(-linedata and -userdata options) is -countchangedlines.  If this
223option is specified, then the line counts reported are the number of
224lines _changed_, not lines _added_.  For example, if a commit involved
225removing two lines and adding three lines, with -countchangedlines,
226this would be recorded as an addition of five lines.  Without
227-countchangedlines, this would be just one line.  Some users requested
228-countchangedlines, as it can be used a form of a very rough
229productivity meaurement.
230
231CVS global arguments can be set for all CVS commands executed by
232cvsplot.pl, via the -cvs-global-args switch.  For example, the command
233below:
234
235cvsplot.pl -cvs-global-args "-f -q" ...
236
237Will ensure that ~/.cvsrc will not be read for default settings, and
238that all CVS commands will output the minimal amount of information to
239stderr.  Execute cvs --help-options for the complete list of global
240arguments available.
241
242----------------------------------------------------------------------
243
244Requirements:
245
246Cvsplot uses the Date::Manip and String::ShellQuote (for UNIX
247platforms) perl modules.  Run cvsplot and it will tell you if these
248modules are missing, and will provide instructions on how to fetch and
249install them.
250
251Gnuplot comes with most Linux distributions, and can be found at
252http://www.gnuplot.org.  If the -gnuplot* options are not used, then
253its not necessary to install gnuplot.  Window versions are also
254available.
255
256----------------------------------------------------------------------
257
258Updates:
259
260Updates can be found from http://cvsplot.sourceforge.net.
261
262Comments:
263
264Please send comments to sits@users.sourceforge.net
265Thank you!
266
267
268