Commit Graph

54 Commits

Author SHA1 Message Date
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 e543eeaf58 Only include valid extensions in blame output (#95). 2016-02-03 14:22:19 +01:00
Adam Waldenberg 6e0365e8ba Fix inconsistent behavior with -f "**" (#95).
Improved by taking advantage of the detected file types during the first
pass in the changes module.
2016-02-03 11:47:00 +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 98615ccbfc Support for multiple repositories is near completion (See issue #24).
Only the metrics module is lacking support. While the rest should work,
please note that it is completely untested as of now and probably
has some rough edges.
2015-10-31 05:10:00 +01:00
Adam Waldenberg 9287b187f7 Fixed some pylint violations. This also takes care of some bugs. 2015-10-31 00:03:51 +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 ce91c4176a Moved blame.Blame.output_progress to terminal.output_progress.
This enables us to output progress from multiple modules.
2015-10-29 03:36:53 +01:00
Adam Waldenberg 6606d8b13c Progress from the blame module is now printed regardless of --hard. 2015-10-29 03:36:49 +01:00
Adam Waldenberg 124636cb85 Restructured imports slightly. 2015-10-21 05:26:20 +02:00
Marc Harper 4f3e0d3073 Restore relative imports of changes and filtering 2015-10-20 09:48:32 -07: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 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 5a18732112 Added missing file close() in blame module. 2015-09-20 01:43:40 +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 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
Kamila Chyla 96e2b0fdf0 Prevent ZeroDivisionError in get_stability method (Fixes #63).
Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
2015-08-25 02:23:46 +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 bc6be1c56f Fixed some pylint violations. 2014-11-27 12:38:58 +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
Adam Waldenberg 1d2fd619bd Fixed a special and unique KeyError exception that could occur.
This is because of a mismatch between the changes module and the
blame module. Seems to be triggered by empty rows in source files.
2014-11-06 10:46:23 +01:00
Adam Waldenberg fa5e5411f5 Fixed problem with the new email detection patch. 2014-11-03 11:02:06 +01:00
Diomidis Spinellis b20f15e794 More stable author email extraction.
The email search regular expression in the git-blame output can be tripped
by a similar pattern appearing in the source code. The supplied patch
fixes the problem.

Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
2014-11-03 10:12:44 +01:00
Adam Waldenberg e902f7b82d Fixed possible exception occurring during stability value gathering.
For now, we return 100 % whenever an author is not found to have any
entries in the changes log. This can happen whenever an author uses the
same email but with different author names.

The solution would probably be to consider these commits to belong to the
same person and merge the results.

This will require some additional changes to the code and a redesign in
the way that author names and emails are mapped.
2014-02-19 06:33:17 +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 a1e90d0a9d The age value of the blame output now listens to the --weeks flag.
Consequently, the age value now shows the average age of all the rows
blamed to an author in months (or weeks when --weeks/-w is used).
2014-02-14 05:25:14 +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 98e3f45d65 Added stability value to the blame output. 2014-01-26 02:49:31 +01:00
Adam Waldenberg 2b4e6bb111 A newline was missing in the blame output when redirecting stdout. 2014-01-15 13:26:36 +01:00
Adam Waldenberg 791e9e39dd Removed unnecessary print in the blame module.
This print should only be enabled in any "interactive format", such as the
terminal (text) output.
2013-09-17 11:56:48 +02:00
Adam Waldenberg e263982806 Progress text of the blame module was being outputted wrong.
Some regression occurred in a previous commit as the progress text never
was purged out of the output.
2013-09-17 11:53:57 +02:00
Adam Waldenberg cf0f40cc4d There was a mistake in the calculation of comments in the blame module.
Whenever filtering of author or email was enabled, problems could arise
when calculating comments percentage. Did some reshuffling of the logic;
resolving it.
2013-08-13 19:26:14 +02:00
Adam Waldenberg c96d3c3ffe The blame module was not behaving quite right when used with "--since".
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".
2013-08-13 15:26:42 +02:00
Adam Waldenberg bc182c6924 Completely removed the missing module and the --checkout-missing option.
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).
2013-08-03 10:30:43 +02: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 353f8daee1 BlameOutput no longer takes an object of a Changes class as argument.
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__().
2013-07-25 14:37:19 +02:00
Adam Waldenberg d513ba530d HTMLEmbedded output was broken in the blame module. 2013-07-22 15:30:10 +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 bb72cc8f02 Added a handle_comment_block() function in the comment module.
This function moves most of the logic of handling comments into the
comment module itself, thus avoiding duplicated code and allowing for
a cleaner solution.
2013-07-02 23:03:09 +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 a498603a50 Fixed some small mistakes that occurred during localization. 2013-06-26 00:35:43 +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