From 3b2155901453a5e741193d21cba956f83f561e31 Mon Sep 17 00:00:00 2001 From: neingeist Date: Tue, 21 Oct 2025 17:07:31 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20git-status-all:=20ignore=20by=20fil?= =?UTF-8?q?e=20type=20(e.g.=20fuse.rclone)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git-status-all | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/git-status-all b/git-status-all index feed037..7fc322c 100755 --- a/git-status-all +++ b/git-status-all @@ -12,9 +12,11 @@ import re import subprocess import click +import psutil # TODO config file (and defaults here) +IGNORE_FS_TYPES = ['tmpfs', 'proc', 'sysfs', 'devpts', 'nfs', 'fuse.rclone'] IGNORES = [ r"\.sync", r"\.git/modules", # XXX check this again @@ -23,8 +25,24 @@ IGNORES = [ ] +mount_fs_map = {p.mountpoint: p.fstype for p in psutil.disk_partitions(all=True)} + + +def get_fs_type(path): + path = os.path.realpath(path) + while path != '/': + if path in mount_fs_map: + return mount_fs_map[path] + path = os.path.dirname(path) + return mount_fs_map.get('/', 'unknown') + + def git_directories(startdir) -> Path: for dirpath, dirnames, _ in os.walk(startdir): + fs_type = get_fs_type(dirpath) + if fs_type in IGNORE_FS_TYPES: + dirnames.clear() + continue if any(re.search(ignore, dirpath) for ignore in IGNORES): continue if set(["info", "objects", "refs"]).issubset(set(dirnames)):