summaryrefslogtreecommitdiffstats
path: root/g2h/git.py
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2025-08-23 22:40:20 +0200
committerChristoph Schlosser <christoph@linux.com>2025-08-23 22:40:20 +0200
commite4ba1fc772b2ed50fb5f7b469fa30b8915479416 (patch)
tree7a531adee09d8e7b8c227b32baa285db0de9a763 /g2h/git.py
parent2f102e4036c3a49e5d40883fa4ef59193c9d943c (diff)
downloadgit2hugo-e4ba1fc772b2ed50fb5f7b469fa30b8915479416.tar.gz
g2h: Add jinja and git basic flow
Diffstat (limited to 'g2h/git.py')
-rw-r--r--g2h/git.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/g2h/git.py b/g2h/git.py
new file mode 100644
index 0000000..e6984c4
--- /dev/null
+++ b/g2h/git.py
@@ -0,0 +1,11 @@
+import git
+
+class Git:
+ def __init__(self, repo_path):
+ try:
+ self.repo = git.Repo(repo_path)
+ except git.InvalidGitRepositoryError:
+ raise ValueError(f"Invalid git repository at {repo_path}")
+
+ def get_all_commits(self):
+ return list(self.repo.iter_commits())