Stash the tag lines in the returned patch
[git-dm.git] / README
blobe60285d8ae26ba0851d5e9fc9df472b8a895ab23
1 The code in this directory makes up the "git data miner," a simple hack
2 which attempts to figure things out from the revision history in a git
3 repository. 
6 INSTALLING GITDM
8 gitdm is a python script and doesn't need to be proper installed like other
9 normal programs. You just have to adjust your PATH variable, pointing it to
10 the directory of gitdm or alternatively create a symbolic link of the script
11 inside /usr/bin.
13 Before actually run gitdm you may want also to update the configuration file
14 (gitdm.config) with the needed information.
17 RUNNING GITDM
19 Run it like this:
21    git log -p -M [details] | gitdm [options]
23 Alternatively, you can run with:
25    git log --numstat -M [details] | gitdm -n [options]
27 The [details] tell git which changesets are of interest; the [options] can
28 be:
30         -a      If a patch contains signoff lines from both Andrew Morton 
31                 and Linus Torvalds, omit Linus's.
33         -b dir  Specify the base directory to fetch the configuration files.
35         -c file Specify the name of the gitdm configuration file.  
36                 By default, "./gitdm.config" is used.
38         -d      Omit the developer reports, giving employer information
39                 only.
41         -D      Rather than create the usual statistics, create a file (datelc.csv)
42             providing lines changed per day, where the first column displays
43             the changes happened only on that day and the second sums the day it
44             happnened with the previous ones. This option is suitable for
45             feeding to a tool like gnuplot.
47         -h file Generate HTML output to the given file
49     -H file Export individual developer raw data as CSV. These data could be
50         used to evaluate the fidelity of developers.
52         -l num  Only list the top <num> entries in each report.
54     -n  Use --numstat instead of generated patches to get the statistics.
56         -o file Write text output to the given file (default is stdout).
58     -p prefix Dump out the database categorized by changeset and by file type.
59             It requires -n, otherwise it is not possible to get separated results.
61         -r pat  Only generate statistics for changes to files whose 
62                 name matches the given regular expression.
64         -s      Ignore Signed-off-by lines which match the author of 
65                 each patch.
67         -t      Generate a report by type of contribution (code, documentation, etc.).
68             It requires -n, otherwise this option is ignored silently.
71         -u      Group all unknown developers under the "(Unknown)"
72                 employer. 
74     -x file  Export raw statistics as CSV.
76     -w  Aggregate the data by weeks instead of months in the
77         CSV file when -x is used.
79         -z      Dump out the hacker database to "database.dump".
81 A typical command line used to generate the "who write 2.6.x" LWN articles
82 looks like:
84     git log -p -M v2.6.19..v2.6.20 | \
85         gitdm -u -s -a -o results -h results.html
87 or:
89     git log --numstat -M v2.6.19..v2.6.20 | \
90         gitdm -u -s -a -n -o results -h results.html
92 CONFIGURATION FILE
94 The main purpose of the configuration file is to direct the mapping of
95 email addresses onto employers.  Please note that the config file parser is
96 exceptionally stupid and unrobust at this point, but it gets the job done.  
98 Blank lines and lines beginning with "#" are ignored.  Everything else
99 specifies a file with some sort of mapping:
101 EmailAliases file
103         Developers often post code under a number of different email
104         addresses, but it can be desirable to group them all together in
105         the statistics.  An EmailAliases file just contains a bunch of
106         lines of the form:
108                 alias@address  canonical@address
110         Any patches originating from alias@address will be treated as if
111         they had come from canonical@address.
113     It may happen that some people set their git user data in the
114     following form: "joe.hacker@acme.org <Joe Hacker>". The 
115     "Joe Hacker" is then considered as the email... but gitdm says
116     it is a "Funky" email. An alias line in the following form can
117     be used to alias these commits aliased to the correct email
118     address:
120         "Joe Hacker" joe.hacker@acme.org
123 EmailMap file
125         Map email addresses onto employers.  These files contain lines
126         like:
128                 [user@]domain  employer  [< yyyy-mm-dd]
130         If the "user@" portion is missing, all email from the given domain
131         will be treated as being associated with the given employer.  If a
132         date is provided, the entry is only valid up to that date;
133         otherwise it is considered valid into the indefinite future.  This
134         feature can be useful for properly tracking developers' work when
135         they change employers but do not change email addresses.
138 GroupMap file employer
140         This is a variant of EmailMap provided for convenience; it contains
141         email addresses only, all of which are associated with the given
142         employer.
144 VirtualEmployer name
145     nn% employer1
146     ...
149         This construct (which appears in the main configuration file)
150         allows causes the creation of a fake employer with the given
151         "name".  It directs that any contributions attributed to that
152         employer should be split to other (real) employers using the given
153         percentages.  The functionality works, but is primitive - there is,
154         for example, no check to ensure that the percentages add up to
155         something rational.
157 FileTypeMap file
159         Map file names/extensions onto file types.  These files contain lines
160         like:
162                 order <type1>,<type2>,...,<typeN>
164                 filetype <type> <regex>
165                 ...
167         This construct allows fine graned reports by type of contribution
168         (build, code, image, multimedia, documentation, etc.)
170         Order is important because it is possible to have overlapping between
171         filenames.  For instance, ltmain.sh fits better as 'build' instead of
172         'code' (the filename instead of '\.sh$').  The first element in order
173         has precedence over the next ones.
176 OTHER TOOLS
178 A few other tools have been added to this repository:
180   treeplot
181         Reads a set of commits, then generates a graphviz file charting the
182         flow of patches into the mainline.  Needs to be smarter, but, then,
183         so does everything else in this directory.
185   findoldfiles
186         Simple brute-force crawler which outputs the names of any files
187         which have not been touched since the original (kernel) commit.
189   committags
190         I needed to be able to quickly associate a given commit with the
191         major release which contains it.  First attempt used 
192         "git tags --contains="; after it ran for a solid week, I concluded
193         there must be a better way.  This tool just reads through the repo,
194         remembering tags, and creating a Python dictionary containing the
195         association.  The result is an ugly 10mb pickle file, but, even so,
196         it's still a better way.
198   linetags
199         Crawls through a directory hierarchy, counting how many lines of
200         code are associated with each major release.  Needs the pickle file
201         from committags to get the job done.
204 NOTES AND CREDITS
206 Gitdm was written by Jonathan Corbet; many useful contributions have come
207 from Greg Kroah-Hartman.
209 Please note that this tool is provided in the hope that it will be useful,
210 but it is not put forward as an example of excellence in design or
211 implementation.  Hacking on gitdm tends to stop the moment it performs
212 whatever task is required of it at the moment.  Patches to make it less
213 hacky, less ugly, and more robust are welcome.
215 Jonathan Corbet
216 corbet@lwn.net