Cybrkyd's git repositories

GitGen • commit: c1fcb4f

commit c1fcb4f0dd3797315e0639db4c6b03f9df39cbb20023ff8ae11ba7f880d30c6c
author cybrkyd <noreply@cybrkyd.com> 2026-01-15 12:09:56 +0000
committer cybrkyd <noreply@cybrkyd.com> 2026-01-15 12:09:56 +0000

Commit Message

- Added "Committer" info to commit overview and commit details pages
- Commit meta is now a table on both commit overview / commit details
- Author and Committer have date/time

📊 Diffstat

gitgen.py 98
main.css 12
2 files changed, 82 insertions(+), 28 deletions(-)

Diff

diff --git a/gitgen.py b/gitgen.py
index e0b3f25..db1a6a7 100644
--- a/gitgen.py
+++ b/gitgen.py
@@ -164,7 +164,7 @@ class GitRepoScanner:
log = self.run_git_command(repo_path, [
'log', '--max-count=50',
- '--pretty=format:%H|%an|%ae|%ad|%s|%P',
+ '--pretty=format:%H|%an|%ae|%ad|%s|%P|%cn|%ce|%cd',
'--date=iso'
])
if not log:
@@ -173,8 +173,8 @@ class GitRepoScanner:
commits = []
for line in log.strip().split('\n'):
- parts = line.split('|', 5)
- if len(parts) == 6:
+ parts = line.split('|', 8)
+ if len(parts) == 9:
commit_hash = parts[0]
# Get tags for this commit
tags_output = self.run_git_command(repo_path, [
@@ -188,13 +188,18 @@ class GitRepoScanner:
'hash': commit_hash,
'short_hash': commit_hash[:7],
'author': parts[1],
- 'email': parts[2],
- 'date': parts[3],
+ 'author_email': parts[2],
+ 'author_date': parts[3],
'message': parts[4],
'parent_hash': parts[5],
+ 'committer': parts[6],
+ 'committer_email': parts[7],
+ 'committer_date': parts[8],
'tags': tags,
'author_escaped': html.escape(parts[1]),
- 'email_escaped': html.escape(parts[2]),
+ 'author_email_escaped': html.escape(parts[2]),
+ 'committer_escaped': html.escape(parts[6]),
+ 'committer_email_escaped': html.escape(parts[7]),
'message_escaped': html.escape(parts[4]).replace('\n', '<br>'),
})
@@ -207,13 +212,15 @@ class GitRepoScanner:
header = self.run_git_command(repo_path, [
'log', '-1', commit_hash,
- '--pretty=format:%H|%an|%ae|%ad|%B|||',
+ '--pretty=format:%H|%an|%ae|%ad|%B|||%cn|%ce|%cd',
'--date=iso'
])
if not header:
return {}
- head = header.split('|||', 1)[0].split('|', 4)
+ parts = header.split('|||', 1)
+ head = parts[0].split('|', 4)
+ committer_info = parts[1].split('|', 2) if len(parts) > 1 else ['', '', '']
parents = self.run_git_command(repo_path, ['log', '-1', commit_hash, '--pretty=format:%P']) or ""
files = self.run_git_command(repo_path, [
'log', '-1', '--name-status', '--pretty=', commit_hash
@@ -229,14 +236,19 @@ class GitRepoScanner:
'hash': head[0],
'short_hash': head[0][:7],
'author': head[1],
- 'email': head[2],
- 'date': head[3],
+ 'author_email': head[2],
+ 'author_date': head[3],
'message': head[4].strip(),
'parent_hash': parents.strip(),
+ 'committer': committer_info[0] if len(committer_info) >= 1 else head[1],
+ 'committer_email': committer_info[1] if len(committer_info) >= 2 else head[2],
+ 'committer_date': committer_info[2] if len(committer_info) >= 3 else head[3],
'files': [],
'diff': diff,
'author_escaped': html.escape(head[1]),
- 'email_escaped': html.escape(head[2]),
+ 'author_email_escaped': html.escape(head[2]),
+ 'committer_escaped': html.escape(committer_info[0] if len(committer_info) >= 1 else head[1]),
+ 'committer_email_escaped': html.escape(committer_info[1] if len(committer_info) >= 2 else head[2]),
'message_escaped': html.escape(head[4].strip()).replace('\n', '<br>'),
}
@@ -479,17 +491,32 @@ class HTMLGenerator:
tags_html = ""
if commit.get('tags'):
tags_list = " ".join([f'<span class="tag-badge">{html.escape(tag)}</span>' for tag in commit['tags']])
- tags_html = f'<span class="label" >tag:</span>{tags_list}</span>'
+ tags_html = f'{tags_list}'
html_fragments.append(f"""
<div class="commit-item commit-meta">
- <span class="label">commit:</span>
- <span class="value"><a href="commits/{commit['short_hash']}.html">{commit['hash']}</a></span>
- <span class="label">date:</span>
- <span class="value">{commit['date']}</span>
- <span class="label">author:</span>
- <span class="value">{commit['author_escaped']} &lt;{commit['email_escaped']}&gt;</span>
- {tags_html}
+ <table summary='commit info' class='commit-info'>
+ <tr>
+ <th>commit</th>
+ <td colspan='2' class='oid'><a href="commits/{commit['short_hash']}.html">{commit['hash']}</a></td>
+ </tr>
+
+ <tr>
+ <th>author</th>
+ <td>{commit['author_escaped']} &lt;{commit['author_email_escaped']}&gt;</td>
+ <td class='right'>{commit['author_date']}</td>
+ </tr>
+
+ <tr>
+ <th>committer</th>
+ <td>{commit['committer_escaped']} &lt;{commit['committer_email_escaped']}&gt;</td>
+ <td class='right'> {commit['committer_date']}</td>
+ </tr>
+
+ <tr>
+ <td>{tags_html}</td>
+ </tr>
+ </table>
<div class="commit-message-box">
<h3>Commit Message</h3>
@@ -543,7 +570,7 @@ class HTMLGenerator:
tags_html = ""
if tags:
tags_list = " ".join([f'<span class="tag-badge">{html.escape(tag)}</span>' for tag in tags])
- tags_html = f'<span class="label">tag:</span>{tags_list}</span>'
+ tags_html = f'{tags_list}'
diffstat_content = ""
total_insertions = 0
@@ -642,20 +669,35 @@ class HTMLGenerator:
</div>
<div class="commit-item commit-meta">
- <span class="label">commit:</span>
- <span class="value">{commit['hash']}</span>
- <span class="label">date:</span>
- <span class="value">{commit['date']}</span>
- <span class="label">author:</span>
- <span class="value">{commit['author_escaped']} &lt;{commit['email_escaped']}&gt;</span>
- {tags_html}
+ <table summary='commit info' class='commit-info'>
+ <tr>
+ <th>commit</th>
+ <td colspan='2' class='oid'>{commit['hash']}</td>
+ </tr>
+
+ <tr>
+ <th>author</th>
+ <td>{commit['author_escaped']} &lt;{commit['author_email_escaped']}&gt;</td>
+ <td class='right'>{commit['author_date']}</td>
+ </tr>
+
+ <tr>
+ <th>committer</th>
+ <td>{commit['committer_escaped']} &lt;{commit['committer_email_escaped']}&gt;</td>
+ <td class='right'> {commit['committer_date']}</td>
+ </tr>
+
+ <tr>
+ <td>{tags_html}</td>
+ </tr>
+ </table>
<div class="commit-message-box">
<h3>Commit Message</h3>
<p>{commit_details['message_escaped']}</p>
</div>
</div>
- {file_changes}
+ {file_changes}
{f'''
<div class="diff-view">
diff --git a/main.css b/main.css
index b893d81..3218979 100644
--- a/main.css
+++ b/main.css
@@ -254,6 +254,18 @@ pre code{padding:0;font-size:inherit;color:#000;white-space:inherit;background-c
justify-self: start;
}
+ .commit-info {
+ text-align:left;
+ }
+
+ .commit-info th {
+ min-width: 110px;
+ }
+
+ .commit-info td.right {
+ text-align:right;
+ }
+
.commit-meta .commit-message-box {
grid-column: 1 / -1;
}