Diff between 673722c331afe9187901c181750cfb35c47d3acf and 5bb0fa6a35b1d54bacad8b2189a6af36a1a7bbaf

Changed Files

File Additions Deletions Status
git/config.py +27 -6 modified
git/repository.py +4 -1 modified
highlight.py +1 -1 modified

Full Patch

diff --git a/git/config.py b/git/config.py
index 8343102..41cb97c 100644
--- a/git/config.py
+++ b/git/config.py
@@ -2,20 +2,41 @@ import pygit2 as git
 
 
 def get_repo_owner(repo_path: str) -> str | None:
-    """Return lipasto.owner from repo config, None when missing or on error."""
-    try:
-        repo = git.Repository(str(repo_path))
-    except git.GitError:
+    config = _load_repo_config(repo_path)
+    if not config:
         return None
 
     try:
-        config = repo.config
+        return config["lipasto.owner"]
+    except KeyError:
+        return None
     except git.GitError:
         return None
 
+
+def is_repo_hidden(repo_path: str) -> bool:
+    config = _load_repo_config(repo_path)
+    if not config:
+        return False
+
     try:
-        return config["lipasto.owner"]
+        raw_value = config["lipasto.hidden"]
     except KeyError:
+        return False
+    except git.GitError:
+        return False
+
+    return str(raw_value).strip().lower() == "true"
+
+
+def _load_repo_config(repo_path: str):
+    try:
+        repo = git.Repository(str(repo_path))
+    except git.GitError:
         return None
+
+    try:
+        return repo.config
     except git.GitError:
         return None
+
diff --git a/git/repository.py b/git/repository.py
index 7c5c113..2032011 100644
--- a/git/repository.py
+++ b/git/repository.py
@@ -1,7 +1,7 @@
 from pathlib import Path
 import pygit2 as git
 
-from .config import get_repo_owner
+from .config import get_repo_owner, is_repo_hidden
 
 
 # scans given path for bare git repos and list their names and paths
@@ -23,6 +23,9 @@ def get_bare_repos(path):
         if not repo or not repo.is_bare:
             continue
 
+        if is_repo_hidden(item):
+            continue
+
         description = _read_description(item / "description")
         owner = get_repo_owner(item)
         repos.append(
diff --git a/highlight.py b/highlight.py
index 8bab634..c6eaa8a 100644
--- a/highlight.py
+++ b/highlight.py
@@ -6,7 +6,7 @@ from pygments.lexers import guess_lexer
 from pygments.lexers import guess_lexer_for_filename
 from pygments.util import ClassNotFound
 
-STYLE = "sas"
+STYLE = "default"
 
 
 # reference: https://git.kernel.org/pub/scm/infra/cgit.git/tree/filters/syntax-highlighting.py?id=dbaee2672be14374acb17266477c19294c6155f3