Whenever filtering of author or email was enabled, problems could arise
when calculating comments percentage. Did some reshuffling of the logic;
resolving it.
It was not taking the caret (^) character into consideration when --since
was being specified, something which resulted in an excess of attributed
rows.
With this easy fix, the behavior should now be "correct".
This is flag should not be needed anymore, as gitinspector always uses
a reference point such as HEAD or some reivision when looking into the
repository (never the file structure directly).
Instead of specifying -x (or --exclude) multiple times, it is possible to
specify multiple filtering rules by separating each rule with a comma (,)
character. This enables the new support for filtering authors and email to
work in conjunction with git-config.
As a side effect, this means that we reserve the comma character for
internal use in gitinspector and that it can't be used in any regular
expression or filtering rule. However, this is not a big problem.
Of course, specifying -x multiple times (like before) is still supported.
To access this functionality; the -x flag can now be called in the
following ways:
-x file
-x file:<file>
-x author:<author name>
-x email:<email>
Just passing -x file will presume that the filtering rule is intended for
a file (just like the previous behavior).
All the filtering is case sensitive (even filtering by email) in order to
not break any regular expressions used. Case-insensitive matching can
instead be easily achieved with the appropriate regular expression.
To get reversed filtering (excluding everything not matched within -x) a
regular expression with the a syntax such as '^(?!<rule>)' can be used.
This works in the same manner as the other filtering available in the HTML
view. The minor authors of the responsibilities view equal the minor
authors of the blame view.
Previously, an email for a specific author was collected whenever some
insertions/deletions were detected in an active or valid extension. This
was introduced with the addition of gravatars.
This had the side-effect that if #author1 committed some rows to a file
with an inactive or non-valid extension and #author2 later moved some of
those rows into an active or valid extension, those rows could still
belong to #author1. Consequently, when associating the author name with
an email in the blame phase, there would not be any stored email for
#author1 and no email would be associated with that author or those blamed
lines.
Emails are now (instead) always stored and associated with an author
regardless of the work or files analyzed.
This is unnecessary as there is a get() function inside the changes module
to fetch an object of this class, so we can fetch this directly in
BlameOutput.__init__().
The error message when using an incompatible version of
Python contains a typo.
Signed-off-by: Chris Ring <chris@ringthis.com>
Reviewed-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
Previously; the __get_size_windows__() function could return "None",
whenever the terminal size couldn't be determined; something which broke
the execution.
There was some chance for misbehavior under Linux as well.
Previously, gitinspector always tried to merge authors with the same name
(independently of the email). This behavior tends to (for the most part)
help in projects missing a .mailmap file. Often; authors commit under the
same name, but with different emails on different computers (if they for
example have a work email on their office desktop).
Whenever different e-mail addresses are used by an author; gitinspector
will use the last email it finds and will generate a gravatar from that
email address. This behavior was chosen because authors mostly do not tend
to create a gravatar image for their old email accounts (but often have
one in their newer ones).
References to gravatar images are generated with HTML and XML outputs only
as these are the only formats where referencing gravatars makes sense
right now. The HTMLEmbedded format, for example, does not link to any
gravatars as that format prohibits the use of external links.
To accommodate the new images; the width of the generated HTML page has
been slightly increased. However, the HTML page should still fit on a
1280 display.
This is a better solution than simply relying on ValueError and also
helps us to maintain compatibility with all our other exceptions (it gives
us a msg attribute that we can access when catching the error).
Also localized the string for InvalidRegExpError.