From e499805d88e08acc6d2609210af0d6648d1df987 Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Wed, 1 Jul 2026 22:13:44 +0200 Subject: [PATCH 1/3] fix: ensure that a git user id exists in gitaudit repos This commit adds the git-user `dump-things-servive` with the email `dump-things-service@localhost` to the git configuration of a `gitaudit`-repo. --- dump_things_service/audit/gitaudit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dump_things_service/audit/gitaudit.py b/dump_things_service/audit/gitaudit.py index 4302680..b47fc0e 100644 --- a/dump_things_service/audit/gitaudit.py +++ b/dump_things_service/audit/gitaudit.py @@ -328,6 +328,8 @@ class GitAuditBackend(AuditBackend): if is_empty: call_git(['init', '--bare', str(self.path)], capture_output=True) self.repo = Repo(self.path) + call_git(['config', 'user.name', 'dump-things-service'], cwd=self.path) + call_git(['config', 'user.email', 'dump-things-service@localhost'], cwd=self.path) apply_changeset( self.repo, {'README.txt': 'A git-based audit backend\n'}, -- 2.52.0 From 5f7ee8f58a8d3e849447ad256eaa34db4976481e Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Wed, 1 Jul 2026 22:21:25 +0200 Subject: [PATCH 2/3] chore: format according to `hatch fmt` --- dump_things_service/audit/gitaudit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dump_things_service/audit/gitaudit.py b/dump_things_service/audit/gitaudit.py index b47fc0e..ae8f602 100644 --- a/dump_things_service/audit/gitaudit.py +++ b/dump_things_service/audit/gitaudit.py @@ -329,7 +329,9 @@ class GitAuditBackend(AuditBackend): call_git(['init', '--bare', str(self.path)], capture_output=True) self.repo = Repo(self.path) call_git(['config', 'user.name', 'dump-things-service'], cwd=self.path) - call_git(['config', 'user.email', 'dump-things-service@localhost'], cwd=self.path) + call_git( + ['config', 'user.email', 'dump-things-service@localhost'], cwd=self.path + ) apply_changeset( self.repo, {'README.txt': 'A git-based audit backend\n'}, -- 2.52.0 From 319db2035223c77eedbc0a6fb6a2ea34c4eb6119 Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Wed, 1 Jul 2026 23:18:00 +0200 Subject: [PATCH 3/3] fix: fix type annotations in `gitaudit`-code --- dump_things_service/audit/gitaudit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dump_things_service/audit/gitaudit.py b/dump_things_service/audit/gitaudit.py index ae8f602..926babc 100644 --- a/dump_things_service/audit/gitaudit.py +++ b/dump_things_service/audit/gitaudit.py @@ -67,9 +67,9 @@ class GitAuditBackend(AuditBackend): auto_flush_timeout: int = 60, ): self.path = path - self.index_path = None - self.cached_index_entries = [] - self.current_change_set = {} + self.index_path: Path | None = None + self.cached_index_entries: list[str] = [] + self.current_change_set: dict[Path, str] = {} self.lock = Lock() self.last_flush_time = 0 if auto_flush_timeout < 1: -- 2.52.0