mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-03-11 19:18:53 +01:00
-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.
This commit is contained in:
parent
3a34be0d06
commit
adf6ee412f
2 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,10 @@ def get():
|
|||
def add(string):
|
||||
__filters__.append(string)
|
||||
|
||||
def clear():
|
||||
global __filters__
|
||||
__filters__ = []
|
||||
|
||||
def get_filered():
|
||||
return __filtered_files__
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ def main():
|
|||
|
||||
#We need the repo above to be set before we read the git config.
|
||||
config.init(__run__)
|
||||
clear_x_on_next_pass = True
|
||||
|
||||
for o, a in __opts__:
|
||||
if o in("-c"):
|
||||
|
@ -178,6 +179,9 @@ def main():
|
|||
elif o in("--weeks"):
|
||||
__run__.useweeks = optval.get_boolean_argument(a)
|
||||
elif o in("-x", "--exclude"):
|
||||
if clear_x_on_next_pass:
|
||||
clear_x_on_next_pass = False
|
||||
filtering.clear()
|
||||
filtering.add(a)
|
||||
|
||||
except (format.InvalidFormatError, optval.InvalidOptionArgument, getopt.error) as exception:
|
||||
|
|
Loading…
Reference in a new issue