Signierskript: ein Klon von vor dem Rewrite darf nicht pullen

Am 07.09.2026 sind drei Commits am Ende von main entfernt und der Branch per
Force-Push zurueckgesetzt worden. Ein aelterer Klon - der Mac, auf dem
signiert wird - steht damit VORAUS statt zurueck. Der Waechter sagte dort
"Erst 'git pull' ausfuehren", und genau das ist die Falle: der Merge holt die
entfernten Commits zurueck in die Historie, der naechste Push stellt sie auf
dem Server wieder her, und zwar ohne --force.

Git kann diese Lage nicht von echter ungepushter Arbeit unterscheiden. Das
Skript entscheidet deshalb nicht, sondern listet die nur lokal vorhandenen
Commits auf, nennt beide Moeglichkeiten samt richtigem Befehl und bricht ab.
Nur der schlichte Rueckstand empfiehlt weiterhin 'git pull'.

Beide Zweige gegen Wegwerf-Repos in der jeweiligen Form geprueft, nicht nur
geparst - die erste Fassung stufte die Lage als "auseinandergelaufen" ein und
haette dem Mac zum Pushen geraten.

APPLE_DEV_BACKLOG.md nennt den einmaligen Schritt im Abschnitt "Vorher".

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
2026-09-07 20:58:05 +02:00
co-authored by Claude Opus 5
parent 0e84248d38
commit 185a044c5e
3 changed files with 50 additions and 1 deletions
+13
View File
@@ -4916,6 +4916,19 @@ staleness bug this project keeps fixing elsewhere (cache-busting, OTA-bundle-ver
tree is clean and `HEAD` is exactly `origin/main` (fetches first, aborts with a clear message
otherwise) — added right after `cd "$APP"`, before the web build.
**Nachtrag 2026-09-07: the guard now distinguishes two cases, and the reason is a real
trap.** On that day `main`'s history was rewritten once - three commits at the tip, all of
which contained nothing but a document that has since moved to its own repository, were
removed and the branch force-pushed back to `0e84248`. **Every clone made before that date
is now *ahead* of `origin/main`, not behind it**, so `git pull` there is exactly wrong: the
merge pulls the removed commits back into the history, and the next push restores them on
the server - without even needing `--force`. Git cannot tell that apart from genuine
unpushed work, so the script does not decide: it lists the commits that exist only locally,
names both possibilities (push them, or `git fetch origin && git reset --hard origin/main`)
and aborts. Only the plain behind-case still recommends `git pull`. Both branches verified
against throwaway repositories built to each shape, not just parsed - the first version of
this fix classified the situation as "diverged" and would have told the Mac to push.
---
## AK. Full panel↔companion-app parity audit, done in resumable chapters (started 2026-08-29)