git-status-all: more ignored paths to a config constant

master
neingeist 1 year ago
parent 03ea4024c9
commit bea0e112ae

@ -8,15 +8,21 @@ from pathlib import Path
import contextlib
import os
import re
import subprocess
# TODO config file (and defaults here)
IGNORES = [
r"\.sync",
r"\.git/modules", # XXX check this again
r"\.local/share/containers/storage",
]
def git_directories(startdir) -> Path:
for dirpath, dirnames, _ in os.walk(startdir):
if '.sync' in dirpath:
continue
if '.git/modules' in dirpath:
# FIXME
if any(re.search(ignore, dirpath) for ignore in IGNORES):
continue
if set(['info', 'objects', 'refs']).issubset(set(dirnames)):
yield Path(dirpath)

Loading…
Cancel
Save