Commit Graph

48 Commits

Author SHA1 Message Date
Adam Waldenberg 6d77989e34 Fix logic error in the threading code of the changes module (Fixes #118).
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.
2017-05-15 03:06:53 +02:00
Adam Waldenberg c80c822892 Ignore any unicode_escape decode fails when decoding emails (Fixes #122).
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.
2017-05-13 16:41:54 +02:00
Adam Waldenberg b3fbb3e3c3 Removed dangling semicolon in changes module. 2017-05-13 16:36:05 +02:00
Adam Waldenberg d0798d8358 Set ref to HEAD when starting changes analysis i (Fixes #132).
This gets rid of any invalid refs being set at a subsequent point during
execution.
2017-05-13 15:43:09 +02:00
Adam Waldenberg a56680c4b4 Handle git-rev-list and git-ls-tree with empty changesets (#132, #115).
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.
2017-05-13 15:41:13 +02:00
Adam Waldenberg 8cff4bd208 Removed logically redundant part of an if statement.
The len(self.commits) > 0 check was already being performed one level up.
2017-05-13 15:41:13 +02:00
Adam Waldenberg ba049a0367 Fix AttributeError thrown when no extensions were detected (Fixes #91).
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.
2015-12-12 07:49:58 +01:00
Adam Waldenberg ecc67a31a5 Repositories are now merged with __iadd__() instead of __add__().
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.
2015-11-25 17:28:50 +01:00
Adam Waldenberg 9ada057d81 Progress output now includes repository name (#24).
The name of the repository is only printed when multiple repositories
are specified. Otherwise, gitinspector falls back to the previous
behavior
2015-11-02 18:22:56 +01:00
Adam Waldenberg 46b21db196 The changes module now supports multiple repositories (See issue #24).
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.
2015-10-31 03:44:00 +01:00
Adam Waldenberg d30715cc84 The changes module now also outputs the progress when in text mode.
Furthermore, the output also shows the pass currently running. This is
important, as the progress goes from 0 to 100%, twice.
2015-10-29 03:37:08 +01:00
Adam Waldenberg 1ed9b5e3cf Re-factored the changes module and made it more independent.
This will make it easier to add support for the merging of statistics from
multiple repositories (as discussed in issue #24).
2015-10-29 03:09:46 +01:00
Adam Waldenberg 124636cb85 Restructured imports slightly. 2015-10-21 05:26:20 +02:00
Marc Harper 9abb9b3d56 Relative imports to fix packaging issues 2015-10-20 09:40:08 -07:00
Adam Waldenberg 1f2f120389 Fixed pylint violations reported by a newer version of pylint. 2015-10-12 03:15:30 +02:00
Adam Waldenberg 34337dec17 Refactored all outputable modules.
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.
2015-10-12 03:03:07 +02:00
Adam Waldenberg 38df413ebf Global cleanup fixing some pylint violations. 2015-10-05 06:17:10 +02:00
Adam Waldenberg 3e88fcb71a Added the possibility to include all file extensions in the analysis.
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.
2015-10-01 03:59:44 +02:00
Adam Waldenberg 243e52b5de The changes module could crash upon no detected file types (Fixes #68).
The sub list flattening happening after all the "changes threads" have
run should be happening before the len(self.commits) check, not after.
2015-09-30 15:10:46 +02:00
Adam Waldenberg e4827ee58e The changes module crashed on empty commit/revision lists (Fixes #68).
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.
2015-09-29 22:09:05 +02:00
Adam Waldenberg e3f741b518 Added support for extensionless files (Fixes #60).
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.
2015-09-26 01:52:04 +02:00
Adam Waldenberg 583b5fa753 Python 3 compatibility was broken with commit aeb9ad6 (Fixes #70). 2015-09-25 23:52:53 +02:00
Adam Waldenberg 582ffe7246 Fixed bug introduced with commit aeb9ad6 (Fixes #68).
The interval check was referencing commits instead of self.commits.
2015-09-24 21:40:57 +02:00
Adam Waldenberg da1553b57e Implemented filtering by commit message (Fixes #57).
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.
2015-09-24 03:38:35 +02:00
Adam Waldenberg aeb9ad69f9 Implemented threading in the changes module (Fixes #15).
This change results in a substantial speed up.
2015-09-19 04:32:02 +02:00
Adam Waldenberg 124ca74650 HTML output was broken when authors with quotes were sent to JavaScript.
Fixed by using json.dumps() to escape the author name before passing it to
the JavaScript output.
2015-09-08 01:35:42 +02:00
Adam Waldenberg 98c375a0ab Fixed bug indirectly introduced with commit 0447da19.
When reversing the git log, we forgot to take the interval into
consideration; breaking the --since and--until flags.
2015-09-07 02:22:58 +02:00
Adam Waldenberg b48c65efb1 All subprocess.Popen calls now use the list variant.
Most (all?) hard coded quotations have been removed in favor of automation
and the pipes or shlex modules.
2015-09-07 01:53:24 +02:00
Adam Waldenberg 568a5e5e8b Fixed the terminal column alignment for languages with multi-column chars.
This is for example needed for the Chinese and Korean translations to work
correctly when using terminal output.
2014-12-19 03:02:08 +01:00
Adam Waldenberg 1230fcf80c Changes.get_latest_author_by_email() was broken under Python 3.
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.
2014-12-18 04:30:04 +01:00
Adam Waldenberg d315829e9d Added commit filtering by revision (Fixes issue 33).
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.
2014-11-27 08:39:17 +01:00
Jon Warghed 68a6e90228 Handle escaping in get_latest_author_by_email() (Fixes issue 46).
Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
2014-11-19 07:46:07 +01:00
Adam Waldenberg 0447da1933 The git log is now read in reverse order.
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).
2014-02-19 06:36:06 +01:00
Adam Waldenberg 02e0858985 The two generated pie graphs now use the same colors (Fixes issue 26).
The same author should have the same color in the two graphs, something
that is more consistent and logical.
2014-02-14 17:26:26 +01:00
Adam Waldenberg 16154cd0ba Added age value to the blame output (Fixes issue 10).
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.
2014-01-27 03:11:15 +01:00
Adam Waldenberg 1edae66fee Added filtering of commits from specific authors or emails (Fixes issue 5).
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.
2013-07-30 06:32:58 +02:00
Adam Waldenberg 67418fa25d Changed the way e-mail addresses are collected when analyzing the git log.
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.
2013-07-25 23:36:50 +02:00
Adam Waldenberg c5aba56928 HTMLEmbedded output was broken in the changes module. 2013-07-22 15:32:26 +02:00
Adam Waldenberg 8e22f0d2ca Fixed broken text output in the changes module. 2013-07-22 05:57:04 +02:00
Adam Waldenberg 662cd3fa63 Fixed some behavior that got broken with the implementation of gravatars.
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).
2013-07-22 05:51:56 +02:00
Adam Waldenberg 35852f9859 Added support for gravatars in the changes, blame and timeline modules.
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.
2013-07-20 11:45:11 +02:00
Adam Waldenberg 9e39bf8ed2 Added the new localization strings to the pot file.
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.
2013-07-10 13:55:23 +02:00
Adam Waldenberg 3b82acdfa1 Added a --localize-output flag.
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.
2013-07-10 05:24:18 +02:00
Adam Waldenberg 0d8c3534dc There wasn't always enough room for the Swedish strings in the text output. 2013-06-26 03:23:58 +02:00
Adam Waldenberg 9c0633f8ad Added gettext (GNU) localization support. 2013-06-25 14:38:40 +02:00
Adam Waldenberg 2bfb3cfa67 Added hovering support to the pie charts in the HTML output.
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).
2013-06-18 03:09:59 +02:00
Adam Waldenberg 8a386225fd Added "ignore" parameter to unicode_escape decodings (Fixes issue 4). 2013-06-17 07:47:47 +02:00
Adam Waldenberg f36b82170f File structure rearranged to be more compatible with setuptools/Distribute.
The fact is, gitinspector is now stable enough to inlude support for python
distribution and setup. This is the first step towards that transition.
2013-06-14 03:16:30 +02:00