aboutsummaryrefslogtreecommitdiff
path: root/git-arr
diff options
context:
space:
mode:
authorAlberto Bertogli <albertito@blitiri.com.ar>2015-11-07 12:54:22 +0100
committerAlberto Bertogli <albertito@blitiri.com.ar>2015-11-07 13:04:09 +0100
commitcacf2ee2cc9f291e5759b854126d25216ee01cd4 (patch)
tree88e9f1002703f3cc853ad3db138f398d4878b7c8 /git-arr
parentc4e6484bb00e93b55e1f94f3464a40a3bd12f01f (diff)
downloadgit-arr-fork-cacf2ee2cc9f291e5759b854126d25216ee01cd4.zip
git-arr: Implement an "ignore" option
When having symbolic links to the same repositories (e.g. if you have "repo" and a "repo.git" linking to it), it can be useful to ignore based on regular expressions to avoid having duplicates in the output. Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Diffstat (limited to 'git-arr')
-rwxr-xr-xgit-arr9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-arr b/git-arr
index a245855..7e665dd 100755
--- a/git-arr
+++ b/git-arr
@@ -5,10 +5,11 @@ git-arr: A git web html generator.
from __future__ import print_function
-import sys
-import os
import math
import optparse
+import os
+import re
+import sys
try:
import configparser
@@ -58,6 +59,7 @@ def load_config(path):
'git_url_file': 'cloneurl',
'embed_markdown': 'yes',
'embed_images': 'no',
+ 'ignore': '',
}
config = configparser.SafeConfigParser(defaults)
@@ -88,6 +90,9 @@ def load_config(path):
config.remove_section(s)
for s in config.sections():
+ if config.get(s, 'ignore') and re.search(config.get(s, 'ignore'), s):
+ continue
+
fullpath = find_git_dir(config.get(s, 'path'))
if not fullpath:
raise ValueError(