Skip to content

adds entire reset that deletes the shadow branch and session state for the current HEAD commit#134

Merged
gtrrz-victor merged 5 commits intomainfrom
gtrrz-victor/adds-entire-reset-command
Feb 3, 2026
Merged

adds entire reset that deletes the shadow branch and session state for the current HEAD commit#134
gtrrz-victor merged 5 commits intomainfrom
gtrrz-victor/adds-entire-reset-command

Conversation

@gtrrz-victor
Copy link
Contributor

@gtrrz-victor gtrrz-victor commented Feb 2, 2026

Note

Medium Risk
Adds a new destructive cleanup command that deletes local session state files and shadow branches; failures or incorrect targeting could orphan or remove in-progress session metadata.

Overview
Adds a new entire reset command (with --force) to delete the current HEAD’s manual-commit shadow branch and any matching .git/entire-sessions/*.json state files, allowing users to start fresh on the same base commit.

Updates user-facing messaging/docs to point to entire reset (instead of the older rewind reset wording), wires the command into the CLI root, and adjusts the SessionResetter interface/ManualCommitStrategy.Reset implementation accordingly, including unit tests for common scenarios.

Written by Cursor Bugbot for commit 4df8957. This will update automatically on new commits. Configure here.

@gtrrz-victor gtrrz-victor requested a review from a team as a code owner February 2, 2026 06:48
Copilot AI review requested due to automatic review settings February 2, 2026 06:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new entire reset command that allows users to delete the shadow branch and session state for the current HEAD commit, enabling them to start fresh without existing checkpoints. The command is implemented for the manual-commit strategy only, as the auto-commit strategy doesn't use shadow branches.

Changes:

  • Adds new entire reset command with --force flag support for skipping confirmation prompts
  • Implements reset functionality in the ManualCommitStrategy via the SessionResetter interface
  • Updates documentation and error messages to reference the new command instead of the old entire rewind reset
  • Includes comprehensive test coverage for various reset scenarios

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/entire/cli/reset.go New command implementation with validation for git repository and strategy support
cmd/entire/cli/strategy/manual_commit_reset.go Core reset logic that finds sessions, confirms deletion, and cleans up shadow branches
cmd/entire/cli/reset_test.go Comprehensive test suite covering multiple scenarios including edge cases
cmd/entire/cli/root.go Registers the new reset command in the CLI
cmd/entire/cli/hooks_claudecode_handlers.go Updates error messages to reference entire reset instead of entire rewind reset
README.md Adds command to reference table and updates examples to use the new command name

gtrrz-victor and others added 3 commits February 3, 2026 11:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Entire-Checkpoint: 00c9e2351016
@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/adds-entire-reset-command branch from 03ebba1 to 761c588 Compare February 3, 2026 00:34
Entire-Checkpoint: 4c06989c549b
@gtrrz-victor gtrrz-victor merged commit 152989a into main Feb 3, 2026
4 checks passed
@gtrrz-victor gtrrz-victor deleted the gtrrz-victor/adds-entire-reset-command branch February 3, 2026 05:16
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

}

// Verify no shadow branch was created or exists
shadowBranch := "entire/" + commitHash.String()[:7]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test uses incorrect shadow branch name format

Low Severity

The test TestResetCmd_SessionsWithoutShadowBranch constructs the shadow branch name as "entire/" + commitHash.String()[:7], but the actual shadow branch naming format used throughout the codebase is entire/<commit[:7]>-<worktreeHash[:6]> (produced by checkpoint.ShadowBranchNameForCommit). This inconsistency means the test's assertion for verifying no shadow branch exists is checking for a branch with the wrong name, making it ineffective. The other reset tests correctly use checkpoint.ShadowBranchNameForCommit(commitHash.String(), worktreeID) for consistency.

Fix in Cursor Fix in Web

@khaong khaong mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants