diff --git a/git/config.py b/git/config.py
index 8343102..41cb97c 100644
--- a/git/config.py
+++ b/git/config.py
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
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
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
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