Skip to content

Preserve sync-time push leases - #60

Merged
brdv merged 1 commit into
mainfrom
preserve-sync-push-leases
Jul 23, 2026
Merged

brdv merged 1 commit into
mainfrom
preserve-sync-push-leases

Conversation

@brdv

@brdv brdv commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

Carry the exact remote branch tips observed by stck sync into stck push so intended restack rewrites remain safe and publishable.

Sync now records explicit leases only for branches it rewrites and refuses to authorize a rewrite when the remote already contains unintegrated commits. Push accepts the resulting non-ancestor history only while each remote still matches its sync-time snapshot, pins every force-with-lease invocation to an exact SHA or branch absence, and clears stale plans when post-sync drift is detected.

Stack position: follow-up to the completed 10-PR plan. Base: document-sync-recovery. Parent PR: #59.

Changelist

  • src/sync_state.rs — persist sync-time remote branch leases through resumable sync and push state
  • src/gitops.rs — resolve fetched remote tips and push with explicit SHA-or-absence leases
  • src/commands.rs — validate lease eligibility during sync and enforce captured expectations during push
  • tests/harness/mod.rs, tests/push.rs, tests/sync.rs, tests/real_git.rs — cover intended rewritten pushes, remote drift rejection, missing remotes, retries, and the original real-Git failure
  • USAGE.md, docs/sync-recovery.md — document the exact-lease safety and recovery contract

@brdv brdv self-assigned this Jul 23, 2026
@brdv
brdv force-pushed the document-sync-recovery branch from 6ea74aa to d66941a Compare July 23, 2026 14:07
@brdv
brdv force-pushed the preserve-sync-push-leases branch from 43ffb2b to 0a792f5 Compare July 23, 2026 14:07
@brdv
brdv force-pushed the document-sync-recovery branch from d66941a to 8b7b3f0 Compare July 23, 2026 14:10
@brdv
brdv force-pushed the preserve-sync-push-leases branch from 0a792f5 to b6eda30 Compare July 23, 2026 14:10
@brdv
brdv force-pushed the document-sync-recovery branch from 8b7b3f0 to bbef7fd Compare July 23, 2026 14:16
@brdv
brdv force-pushed the preserve-sync-push-leases branch from b6eda30 to 4948005 Compare July 23, 2026 14:16
@brdv
brdv force-pushed the document-sync-recovery branch from bbef7fd to 0825425 Compare July 23, 2026 14:20
@brdv
brdv force-pushed the preserve-sync-push-leases branch from 4948005 to 60c082d Compare July 23, 2026 14:20
@brdv
brdv force-pushed the document-sync-recovery branch from 0825425 to 2f44159 Compare July 23, 2026 14:22
@brdv
brdv force-pushed the preserve-sync-push-leases branch from 60c082d to bf42bfc Compare July 23, 2026 14:22
@brdv
brdv force-pushed the document-sync-recovery branch from 2f44159 to 4a3b35c Compare July 23, 2026 14:24
@brdv
brdv force-pushed the preserve-sync-push-leases branch from bf42bfc to c3cf822 Compare July 23, 2026 14:24
@brdv
brdv force-pushed the document-sync-recovery branch from 4a3b35c to ab93920 Compare July 23, 2026 14:25
@brdv
brdv force-pushed the preserve-sync-push-leases branch from c3cf822 to 8d69e76 Compare July 23, 2026 14:25
Base automatically changed from document-sync-recovery to main July 23, 2026 14:28
@brdv
brdv force-pushed the preserve-sync-push-leases branch from 8d69e76 to d3d6d3f Compare July 23, 2026 14:29
@brdv
brdv merged commit 59d4784 into main Jul 23, 2026
2 checks passed
@brdv
brdv deleted the preserve-sync-push-leases branch July 23, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant