Skip to content

Guard remote deletes with a lease and fix five review findings - #11

Merged
skunkworker merged 1 commit into
masterfrom
jb/2026_11_11_analysis_fixes
Nov 12, 2026
Merged

skunkworker merged 1 commit into
masterfrom
jb/2026_11_11_analysis_fixes

Conversation

@skunkworker

Copy link
Copy Markdown
Owner

Summary

Six fixes from an analysis of v0.1.2. Each one was reproduced in a throwaway repository first.

  • Remote delete trusted the last fetch. A teammate's push after that fetch was deleted with the branch. The push now carries --force-with-lease on the commit the tracking ref was at. A lease refusal runs git ls-remote: a branch someone else already deleted counts as deleted. A gone upstream (no tracking ref) refuses the remote delete.
  • A reload changed the confirm screen. A fetch, checkout or undo that landed there removed the "will discard" warning and, for p, selected more branches. A reload now closes the screen with a status line.
  • The remote restore command named the wrong commit. The result line and the git push restore line used the local tip. They now use the remote's commit (branch.upSha).
  • The force retry ran inside Update (item 34). It now runs as one cmd per branch on the deleting screen.
  • Undo followed by a fast new delete crashed with an index out of range. d and a second u now wait while an undo runs.
  • m did not wait for the merge status. During the load it selected nothing.

Tests

  • Six new tests in review_test.go, one per fix. Each fails against the old code.
  • Four tests in main_test.go changed: three drive the background force retry, one gives its hand-made branch the remote commit.
  • go test -race, go vet and gofmt are clean.

Not in this PR

  • The tests read the global git config (tag.gpgsign breaks two of them locally).
  • v obeys diff.external.

🤖 Generated with Claude Code

A remote delete now carries --force-with-lease on the commit the last
fetch saw, so the remote refuses when a teammate pushed after it. A
branch someone else already deleted counts as deleted.

- A reload that lands on the confirm screen closes it: the new list had
  no commit counts, and a fetch selected more branches.
- The remote result and the push restore command name the remote's
  commit (branch.upSha), not the local tip.
- The force retry runs as cmds on the deleting screen (item 34).
- d and u wait while an undo runs: its answer indexes m.results.
- m waits for the merge status, like x and d.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@skunkworker
skunkworker merged commit d8ea488 into master Nov 12, 2026
2 checks passed
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