Skip to content

Add undo, locked branches, remote-only view and script mode - #5

Merged
skunkworker merged 2 commits into
masterfrom
improvements-2026-09
Sep 24, 2026
Merged

skunkworker merged 2 commits into
masterfrom
improvements-2026-09

Conversation

@skunkworker

Copy link
Copy Markdown
Owner

Summary

Two commits:

  1. Split main.go into git.go, model.go and view.go. An AST script moved the code with no hand edits. Review this commit apart from the second one.
  2. Features and fixes. This commit completes the rest of the roadmap in docs/improvements.md.

Safety

  • fetch and push run with GIT_TERMINAL_PROMPT=0 and without a terminal, and stop after 60s. A remote that asks for a password cannot freeze the screen.
  • The app removes escape codes from commit messages, git errors and raw diffs before it shows them.
  • ctrl+c during a delete needs a second press.
  • Locked branches: the current branch, a branch in another worktree (+) and a protected branch (P). The default branch and pruner.protect globs are protected.

UX

  • u undoes the last delete. When you quit, the app prints restore commands.
  • m selects merged branches older than N days. N starts at pruner.staleDays, default 90.
  • Rows fit the terminal width. The list height counts the status and error lines.
  • The cursor starts on row 1.
  • Gone branches with no unique commits no longer show "not merged".
  • The app remembers the sort order between runs.
  • tab lists remote branches that no local branch tracks. R deletes them. c creates a local branch that tracks one.

Performance

  • The list shows before the merge queries finish. The queries run from Init.
  • v loads the diff in the background. A resize runs delta again only once, after a short wait.

Script mode

--prune-gone, --merged-older-than DAYS, --fetch, --yes, --dry-run. Nothing is deleted without --yes. Script mode never deletes remote branches.

Behavior changes

  • The default branch cannot be selected.
  • On the results screen, enter goes back to the list. q quits.

Tests

  • 97 tests pass with go test -race. 17 of them are new.
  • A fake git on PATH tests the network time limit.

🤖 Generated with Claude Code

skunkworker and others added 2 commits September 23, 2026 17:26
A mechanical move by an AST script: each top-level declaration went to
the file for its layer, with no hand edits. The Makefile now rebuilds on
any .go file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Safety:
- fetch/push run with GIT_TERMINAL_PROMPT=0, no controlling tty, and a
  60s timeout, so a remote asking for a password cannot hang the TUI
- commit subjects, git errors and raw diffs are stripped of escape codes
- ctrl+c while deleting needs a second press
- current, other-worktree (+) and protected (P, pruner.protect globs)
  branches are locked against selection

UX:
- u undoes the last delete; quitting prints restore commands
- m selects merged branches older than N days (pruner.staleDays)
- rows fit the terminal; list height counts status/error lines
- cursor starts on row 1; clean gone branches no longer read "not merged"
- sort choice persists between runs
- tab lists remote branches no local branch tracks; R deletes them,
  c creates a tracking branch

Performance:
- the list paints before the merge queries, which run from Init
- v loads diffs in the background; resize re-runs delta once, debounced

Script mode: --prune-gone / --merged-older-than, --fetch, --yes, --dry-run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@skunkworker
skunkworker merged commit 0584810 into master Sep 24, 2026
2 checks passed
@skunkworker
skunkworker deleted the improvements-2026-09 branch September 24, 2026 04:43
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