SoftwareIntrospectionLab/cvsanaly — pull request #145 by apepper (2011-11-02 10:48:49+00:00)
Title: HunkBlame: Functionality to ignore comments only lines.

I wrote a bigger extension for `HunkBlame` to __not__ trace lines, that only contain comments.

In order for this to work, `Pygments` needs to be installed. Also the option `--hb-ignore-comments` respectively `hb_ignore_comments` needs to be set to `True`. The default is `False`.

With this option, every file, that get's analyzed by HunkBlame is run thru a lexer of pygments and the output tokens of pygments are analyzed by line. If a line only contains empty space or a comment, `HunkBlame` will not trace the origin.

I wrote this, to increase the quality of the blamed commits. Comments usually do not modify the runtime behavior of an application.

Observations:

* With the repository of `cvsanaly` with this option 5031 hunk_blames are found. Without the option it's 5216 hunk_blames.
* With the option runtime of `HunkBlame` increases by a factor of 2 to 3 or even more. This is because for every file pygmentize needs to analyse the content.

Please provide feedback to extension of the extension `HunkBlame`.