Files
troupe-standup/wizard-work/ledger/_probe_git_log_structure.py
T

25 lines
750 B
Python

#!/usr/bin/env python3
"""Probe the interleaved git-log/numstat structure before committing to the
real extraction artifact."""
import subprocess
REPO = "/root/troupe-standup"
CMD = [
"git", "-C", REPO, "log",
"--numstat", "--date=short",
"--pretty=tformat:\\x1f%H\\x1f%h\\x1f%ad\\x1f%an\\x1f%ae\\x1f%s",
"--", "wizard-work/ledger",
]
out = subprocess.run(CMD, capture_output=True, text=True).stdout
lines = out.split("\n")
print("total lines (incl trailing empty):", len(lines))
print("first 40 non-empty lines:")
for ln in lines:
if ln == "":
continue
print(repr(ln[:200]))
if ln.count("\x1f") >= 5:
break
print("--- stderr ---")
print(subprocess.run(CMD, capture_output=True, text=True).stderr[:2000])