From dc119e472dbcdead577a50f5bb43914c3a6e3a83 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sat, 7 Jun 2025 23:32:51 +0100 Subject: [PATCH] feat: Add HH:MM timestamps to sidebar after date in git log --- gtm2.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gtm2.py b/gtm2.py index 039909c..170f1c0 100755 --- a/gtm2.py +++ b/gtm2.py @@ -11,7 +11,7 @@ VERSION = "2025-06-07.3" # --- Data Fetching & Utility Functions (Pure) --- def get_commits(filename): - cmd = ['git', 'log', '--pretty=format:%h %ad %s', '--date=short', '--', filename] + cmd = ['git', 'log', '--pretty=format:%h %ad %s', '--date=format:%Y-%m-%d %H:%M', '--', filename] result = subprocess.run(cmd, capture_output=True, text=True) return result.stdout.splitlines() @@ -332,9 +332,12 @@ def draw_status_bars(stdscr, state): # Get commit message for the selected commit commit_message = "" if state.commits and state.selected_commit_idx < len(state.commits): - commit_parts = state.commits[state.selected_commit_idx].split(' ', 2) - if len(commit_parts) >= 3: - commit_message = commit_parts[2] + # Format is now: hash date time message + # We need to split on more than just the first two spaces + commit_line = state.commits[state.selected_commit_idx] + parts = commit_line.split(' ', 3) # Split into hash, date, time, message + if len(parts) >= 4: + commit_message = parts[3] # Status bar percentages if len(state.file_lines) > 0: