Skip to content

Migrate remote-tidy onto the CleanPipeline seam#204

Merged
jakebromberg merged 1 commit into
mainfrom
migrate/clean-remote
Jun 22, 2026
Merged

Migrate remote-tidy onto the CleanPipeline seam#204
jakebromberg merged 1 commit into
mainfrom
migrate/clean-remote

Conversation

@jakebromberg

Copy link
Copy Markdown
Owner

Step 3 of #118 (4 of 5). Moves git-remote-tidy onto git_tidy_core::clean::run_clean. CleanResult<RemovedRemote> unchanged.

The prune-vs-remove split is preserved verbatim in act: orphaned remotes prune tracking refs (count carried in refs_pruned), configured/unreachable remotes are removed. Origin protection stays an act-level guard (prints the warning, returns Outcome::Skipped) rather than a decide filter, matching the original.

Behavior-preserving: all existing tests pass unchanged. Local CI green.

Refs #118

Rewrite git-remote-tidy's hand-rolled clean loop to delegate to the shared git_tidy_core::clean::run_clean seam (issue #118 step 3). The public run_clean signature and CleanResult<RemovedRemote> return type are unchanged, so no callers or tests required edits.

Remotes are grouped per repo, so the seam is invoked once per RepoGroup and the per-group CleanResults are accumulated into the combined succeeded/failed/skipped buckets; this keeps each group's repo_path and name stable for that call's act closure while leaving the loop oblivious to grouping. The decide predicate is the existing should_clean classification filter unchanged: with --all it admits any non-Active remote, otherwise only Unreachable.

The prune-vs-remove split is preserved verbatim inside act: orphaned remotes have their tracking refs pruned via prune_remote_refs (emitting "pruned N refs for ...", carrying the per-remote count in RemovedRemote.refs_pruned), while configured/unreachable remotes are removed via remote_remove (emitting "removed ..."); dry-run short-circuits both with the original "would prune refs for"/"would remove" wording and refs_pruned 0. Origin protection stays an act-level guard rather than a decide filter because it prints a warning before skipping: removing the origin remote without --force writes "warning: skipping origin remote in ... (use --force to remove)" and returns Outcome::Skipped. Success maps to Outcome::Cleaned(RemovedRemote), action failures to Outcome::Failed(FailedItem) so the loop continues.

Refs #118
@jakebromberg jakebromberg merged commit 96fe41d into main Jun 22, 2026
3 checks passed
@jakebromberg jakebromberg deleted the migrate/clean-remote branch June 22, 2026 17:46
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