Open
Conversation
The reset and clean commands had an overlap which at times made it harder for users to understand the difference between them. This change deprecates reset in favour of a new flag in the clean command. ### Changes cmd/entire/cli/clean.go — Unified command - New entire clean defaults to cleaning current HEAD sessions (old reset behavior) - --all flag for repo-wide orphan cleanup (old clean behavior) - --session <id> flag for single-session cleanup - --dry-run flag for preview without action - --force flag to skip confirmation and active session guard - --all and --session are mutually exclusive - Moved activeSessionsOnCurrentHead() here from reset.go - Added previewCurrentHead() for dry-run support - Renamed internal functions: runCleanAll, runCleanAllWithItems, runCleanSession cmd/entire/cli/reset.go — Deprecated wrapper - Cobra Deprecated field set — auto-prints deprecation warning when used - Delegates to the same underlying strategy methods - Keeps --force and --session flags for backward compatibility cmd/entire/cli/clean_test.go — Comprehensive tests - Default mode: nothing to clean, force, dry-run, dry-run empty, sessions without shadow branch, multiple sessions, not git repo - --all mode: no orphans, preview, dry-run, force, sessions branch preserved, not git repo, subdirectory - runCleanAllWithItems unit tests: partial failure, all failures, no items, mixed types preview - Flag validation: mutual exclusion of --all and --session cmd/entire/cli/reset_test.go — Deprecated wrapper tests - TestResetCmd_IsDeprecated — verifies deprecation field - Retained core functional tests (nothing to reset, force, not git repo) ### Documentation - README.md — updated command table and troubleshooting section - docs/architecture/checkpoint-scenarios.md — updated cleanup examples Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: b79b35cd956d
Contributor
There was a problem hiding this comment.
Pull request overview
This PR deprecates the entire reset command in favor of a unified entire clean command that supports current-HEAD cleanup by default, plus repo-wide cleanup via --all, with added --session, --dry-run, and --force behaviors.
Changes:
- Updated
entire cleanto support default current-HEAD cleanup, repo-wide orphan cleanup (--all), single-session cleanup (--session), and dry-run previews. - Deprecated
entire resetvia Cobra’sDeprecatedfield and routed behavior through the same underlying cleanup/reset logic. - Expanded/adjusted tests and refreshed documentation to reflect the new command semantics.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/entire/cli/clean.go |
Implements the unified clean behaviors (default HEAD cleanup, --all, --session, --dry-run, --force, active-session guard). |
cmd/entire/cli/reset.go |
Marks reset as deprecated and delegates to the new clean/session logic while keeping compatibility flags. |
cmd/entire/cli/clean_test.go |
Adds coverage for the new default mode, --all mode, dry-run/force behaviors, and flag validation. |
cmd/entire/cli/reset_test.go |
Adds a deprecation test and trims/keeps core wrapper behavior tests. |
README.md |
Updates the command table and troubleshooting/docs to point users to clean (and --all). |
docs/architecture/checkpoint-scenarios.md |
Updates manual cleanup guidance to use entire clean --all. |
- Update clean --all help text to reflect that orphaned checkpoint entries can be removed (the branch itself is preserved) - Accept io.Writer in Reset/ResetSession instead of hardcoding os.Stderr, so callers use cmd.ErrOrStderr() and output goes through Cobra streams - Check for git repository before initializing logging in reset command to avoid creating .entire/logs in arbitrary directories - Parameterize runCleanSession with action verb so reset uses "Reset" wording and clean uses "Clean" wording in user-facing messages Signed-off-by: Paulo Gomes <paulo@entire.io> Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: abdf248e9af4
Replaces filepath.Join + os.Remove with os.OpenRoot + root.Remove, so path traversal in file names cannot escape the temp directory. Signed-off-by: Paulo Gomes <paulo@entire.io> Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: bc3ca6a2ea9a
…ire/tmp/ Replaces os.ReadDir with os.DirFS + fs.WalkDir so directory listing is scoped to the temp directory, consistent with deleteTempFiles. Signed-off-by: Paulo Gomes <paulo@entire.io> Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: fd7de86795d7
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reset and clean commands had an overlap which at times made it harder for users to understand the difference between them. This change deprecates reset in favour of a new flag in the clean command.
Changes
cmd/entire/cli/clean.go— Unified commandcmd/entire/cli/reset.go— Deprecated wrappercmd/entire/cli/clean_test.go— Comprehensive testscmd/entire/cli/reset_test.go— Deprecated wrapper testsDocumentation