Commit Graph

19 Commits

Author SHA1 Message Date
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 f368c0019a Fixed mistake in the filtering module related to hash filtering.
FILTERING_EMAIL_INFO_TEXT was erroneously being defined twice.
2015-09-22 02:41:16 +02: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 bc00f9731b Fixed some pylint violations in the filtering module. 2014-01-08 04:17:25 +01:00
Adam Waldenberg a4a0e409a2 Filtering rules can now be separated by a comma.
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.
2013-08-03 09:41:21 +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 064a2e11b8 Added InvalidRegExpError in the filtering module.
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.
2013-07-14 12:19:31 +02:00
Adam Waldenberg adf6ee412f -x and --exclude options now clear the filtering rules when first found.
This behavior is preferred in order for us to be able to override any
exclude filter set via git-config.
2013-07-14 04:29:00 +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 bfdac450c4 Regular expression handling now throws an error on an invalid regex.
Previously, it was giving of an incomprehensible error from the "re"
module in Python.
2013-07-01 00:15:42 +02:00
Adam Waldenberg aec58ac499 Filtering and the -x/--exclude option now support regular expressions.
Thanks to this change; we can support the --exclude option in conjunction
with git-config.
2013-06-30 23:58:49 +02:00
Adam Waldenberg f20c3c1895 Made some changes to ensure compatibility in Python 2 with gettext.
The gettext.install() functions supplies a way to force it to return
unicode which helps with compatibility between Python 2 & 3. To make it
work properly when merging those returned string with strings in the
different modules of gitinspector we also had to do some changes to make
sure all string literals are in unicode.
2013-06-25 16:37:18 +02:00
Adam Waldenberg 9c0633f8ad Added gettext (GNU) localization support. 2013-06-25 14:38:40 +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