This particular problem is also briefly mentioned in issue #115. The
fix resolves the overflow problem resulting in an array with a dangling
"None" type at the end. It also takes care of a race condition where
two threads by accident could update the same data.
This is only needed with emails that have escape characters, as described
in issue #46. If the call fails, it will most likely not affect us and
can be safely ignored.
If the changeset was empty or filtered with no matching files a bunch of
errors would be thrown from git with no proper results being returned
back to gitinspector.
We now pipe stderr (catching the output) and also check the return code
when running these commands.
The bug was introduced with the commit ecc67a3 and was caused by the
initialization of an empty Changes object.
This fix makes sure that the __iadd__() method properly handles empty
change sets and returns a satisfactory object back when completing
execution.
Thus, we are overriding the "+=" operator instead of "+". This
implementation results in a much cleaner solution as we were directly
updating "self" when overriding __add__(), something which isn't really
an acceptable solution as we were changing the supplied in-parameters.
Just as before, all other parts of gitinspector currently do not
support fetching statistics from multiple repositories and just
simply fetch data from the last repository specified.
This prepares the source code for the changes discussed in issue #24.
Note that this is just a quick restructuring in order to see the resulting
classes and separation. More work will be done to make it more elegant
and with less dependencies between modules.
This functionality was briefly discussed in issue #61. To make
gitinspector consider all file extensions, it is now possible to supply
a double asterisk "**" to the list of file extensions.
Once again introduced with aeb9ad6, this could happen whenever a
repository had no commits or if the history was being filtered with
--since and/or --until and no commits were being detected within that
interval.
This can be enabled by passing a "*" to the list of defined file
types (-f). Originally, the plan was to also implement support for
regular expressions. However, this was skipped, as it complicated how
expressions for the file types flag were being passed on the command line.
When filtering, "git show" is called in order to pull the commit message
from the git log. While slow, it makes certain that the message itself is
pulled correctly, including any escape characters that might be present.
This is because of the patch committed with revision 68a6e90228. As
Python 3 stores unicode strings by default, we need to convert them back.
This change will hopefully fix it once and for all.
Specific commits can now be filtered by using;
-x, --exclude="revision:<SHA-1>"
Like with all other filtering in gitinspector, regular expressions are
supported. Likewise, multiple revisions can be specified using a comma or
by simply supplying multiple exclude parameters.
As usual, both the commit module and blame module take this filtering into
account.
This makes sure that the most recent email of an author is always used when
generating the gravatar. It also makes sure that the mappings between
author<->email are correct (and recent).
This completes the "code stability" functionality.
While code stability is a percentage (zero and up) that reflects the
stability of the authors code, the age value is a pseudo-value describing
the average age of all the authors rows. The older the code, the higher
the value.
Code stability can sometimes be above 100%, depending on the way git
calculates insertions and blamed rows.
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.
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.
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.
In the process, the new strings were also translated to Swedish. To
properly handle localized string constants, a new function "N_()" was
added which can be supplied to xgettext when collecting strings.
The default behaviour is now not to localize the output, only the help
text and error messages (all the user interaction).
The way localized messages are fetched in the modules has been modified
as well; to allow for the ability to enable and disable the localization.
The name of the author is now highlighted in the table whenever a pie
piece in the pie chart is hovered over. Currently, it does not work the
other way around (because of a limitation in the flot library).