Hermes-Update: neue Commits im flachen Klon richtig zählen (281 statt 42 044); Wochenbericht duzt
- maintenance._hermes_bereich: --ancestry-path, wenn HEAD Vorfahr von origin/<branch> ist (seit dem Paketmanager ist der Checkout ein flacher Klon); sonst der einfache Bereich wie bisher - Wochenbericht: Lucy duzt, nennt nur als Aufgabe, was ausdrücklich auf den Commander wartet; ungetestete Radar-Kandidaten testet das Radar nachts selbst Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
934088a8d9
commit
6904bcbfb0
@@ -191,6 +191,19 @@ def _swap_update_available() -> bool:
|
||||
_comp_cache = {"ts": 0.0, "data": []}
|
||||
|
||||
|
||||
def _hermes_bereich(path: str, branch: str) -> list[str]:
|
||||
"""Der Bereich der neuen Commits für git rev-list/log. Der Hermes-Checkout ist seit dem Paketmanager (25.09.2026)
|
||||
ein flacher Klon: HEAD..origin/main zählte dann die ganze Vorgeschichte hinter der flachen Grenze mit (26.09.:
|
||||
42 044 statt 281). Mit --ancestry-path zählen nur Nachfahren von HEAD. Ist HEAD kein Vorfahr (Geschichte oben
|
||||
umgeschrieben), bleibt es beim einfachen Bereich — sonst sähe die Box gar kein Update mehr."""
|
||||
try:
|
||||
vorfahr = subprocess.run(["git", "-C", path, "merge-base", "--is-ancestor", "HEAD", f"origin/{branch}"],
|
||||
capture_output=True, text=True, timeout=8).returncode == 0
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
vorfahr = False
|
||||
return ["--ancestry-path", f"HEAD..origin/{branch}"] if vorfahr else [f"HEAD..origin/{branch}"]
|
||||
|
||||
|
||||
def _hermes_agent_update() -> dict:
|
||||
"""Hermes-Agent wird aus **git** aktualisiert (CLI `hermes update` = git pull origin <branch>).
|
||||
Darum HEAD vs. origin/<branch> prüfen (fetch + behind-count) — NICHT GitHub-Releases: die
|
||||
@@ -209,7 +222,7 @@ def _hermes_agent_update() -> dict:
|
||||
capture_output=True, text=True, timeout=60)
|
||||
info["reachable"] = (fetch.returncode == 0)
|
||||
if fetch.returncode == 0:
|
||||
cnt = subprocess.run(["git", "-C", path, "rev-list", "--count", f"HEAD..origin/{branch}"],
|
||||
cnt = subprocess.run(["git", "-C", path, "rev-list", "--count", *_hermes_bereich(path, branch)],
|
||||
capture_output=True, text=True, timeout=8)
|
||||
behind = int(cnt.stdout.strip() or "0") if cnt.returncode == 0 else 0
|
||||
info["behind"] = behind
|
||||
@@ -534,7 +547,7 @@ def hermes_update_details() -> dict:
|
||||
subprocess.run(["git", "-C", path, "fetch", "-q", "origin", branch],
|
||||
capture_output=True, text=True, timeout=60)
|
||||
log = subprocess.run(["git", "-C", path, "log", "--pretty=format:%h\x1f%s\x1f%cr",
|
||||
f"HEAD..origin/{branch}"], capture_output=True, text=True, timeout=10)
|
||||
*_hermes_bereich(path, branch)], capture_output=True, text=True, timeout=10)
|
||||
commits = []
|
||||
for line in (log.stdout or "").splitlines():
|
||||
parts = line.split("\x1f")
|
||||
|
||||
Reference in New Issue
Block a user