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.
This commit is contained in:
Adam Waldenberg 2013-08-03 09:41:21 +02:00
parent 1edae66fee
commit a4a0e409a2
1 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class InvalidRegExpError(ValueError):
def get():
return __filters__
def add(string):
def __add_one__(string):
global __filters__
for i in __filters__:
if (i + ":").lower() == string[0:len(i) + 1].lower():
@ -43,6 +43,11 @@ def add(string):
return
__filters__["file"][0].append(string)
def add(string):
rules = string.split(",")
for rule in rules:
__add_one__(rule)
def clear():
global __filters__
for i in __filters__: