Skip to content

Add explicit discard flag for unpushed cleanup worktrees#743

Closed
chubes4 wants to merge 1 commit into
mainfrom
fix/737-discard-unpushed-cleanup
Closed

Add explicit discard flag for unpushed cleanup worktrees#743
chubes4 wants to merge 1 commit into
mainfrom
fix/737-discard-unpushed-cleanup

Conversation

@chubes4

@chubes4 chubes4 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Add --discard-unpushed / discard_unpushed as an explicit data-loss opt-in for bounded cleanup-eligible worktree removal.
  • Keep plain --force from discarding unpushed commits implicitly.
  • Record and print exact discarded handles, unpushed counts, and after-removal path evidence.

Closes #737.

Verification

  • php -l inc/Workspace/WorkspaceWorktreeCleanupEngine.php && php -l inc/Cli/Commands/WorkspaceCommand.php && php -l inc/Abilities/WorkspaceAbilities.php && php -l inc/Tasks/WorktreeCleanupChunkTask.php && php -l tests/smoke-worktree-bounded-cleanup-eligible-apply.php && php -l tests/smoke-worktree-cleanup-cli.php
  • php tests/smoke-worktree-bounded-cleanup-eligible-apply.php
  • php tests/smoke-worktree-cleanup-cli.php

@chubes4

chubes4 commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Duplicate of #742 for the same branch; keeping #742 as the canonical PR for issue #737.

@chubes4 chubes4 closed this Jun 16, 2026
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.

Cleanup force mode needs an operator-approved discard path for cleanup-eligible worktrees

1 participant