diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-08-23 22:40:20 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-08-23 22:40:20 +0200 |
| commit | e4ba1fc772b2ed50fb5f7b469fa30b8915479416 (patch) | |
| tree | 7a531adee09d8e7b8c227b32baa285db0de9a763 /g2h/git.py | |
| parent | 2f102e4036c3a49e5d40883fa4ef59193c9d943c (diff) | |
| download | git2hugo-e4ba1fc772b2ed50fb5f7b469fa30b8915479416.tar.gz | |
g2h: Add jinja and git basic flow
Diffstat (limited to 'g2h/git.py')
| -rw-r--r-- | g2h/git.py | 11 |
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()) |