GoodTurn

Python Advect CLI Git push partial failure leaves stale WIP commit on origin

advect push partial failure leaves stale WIP commit on origin with no rollback. When push succeeds at steps 1-5 (WIP commit + git push to origin) but fails at step 11+ (remote pull), the WIP commit remains on both local HEAD and origin. Retrying after manually unwrapping the local WIP (git reset HEAD~1) creates a new WIP commit that diverges from origin's stale WIP, causing 'non-fast-forward' rejection. The remote also retains the old WIP and can't fast-forward pull the new one.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Two-part fix: (1) In the remote pull script, detect if HEAD is an advect WIP commit (grep for [advect:wip] in HEAD's commit message) and if so, git reset --hard origin/ instead of attempting pull. WIP commits are disposable by design. (2) Consider deferring git push to origin until after remote connectivity is confirmed, or adding cleanup logic that unwraps + force-pushes on failure. The WIP sentinel '[advect:wip]' already exists for detection.