Don't offer adding a trailer in a rebase or a cherry-pick or reverts#105
Merged
Don't offer adding a trailer in a rebase or a cherry-pick or reverts#105
Conversation
Entire-Checkpoint: 05fc557f7824
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents the CLI from offering to add Entire-Checkpoint trailers during git sequence operations (rebase, cherry-pick, revert). These operations replay existing commits and shouldn't be linked to agent sessions. The implementation adds a detection function that checks for git state files/directories and returns early from PrepareCommitMsg() when such operations are in progress.
Changes:
- Added
isGitSequenceOperation()function to detect rebase/cherry-pick/revert state - Modified
PrepareCommitMsg()to skip trailer addition during sequence operations - Added comprehensive unit tests covering all sequence operation types and worktree scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/entire/cli/strategy/manual_commit_hooks.go | Added sequence operation detection and early return in PrepareCommitMsg hook |
| cmd/entire/cli/strategy/hooks_test.go | Added tests for isGitSequenceOperation covering all operation types and worktree edge cases |
There was a problem hiding this comment.
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.
Entire-Checkpoint: 87ae9c9a92c1
khaong
approved these changes
Jan 27, 2026
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.
Did a long rebase today, and a few commits in between had no trailer, so our hooks offered to add a trailer. This shouldn't be done in context of rebase, revert or cherry-pick
Note
Prevents adding
Entire-Checkpointtrailers when Git is replaying commits.isGitSequenceOperation()to detectrebase-merge,rebase-apply,CHERRY_PICK_HEAD, andREVERT_HEADusingGetGitDir()(supports worktrees)PrepareCommitMsgto no-op with debug logging during these sequence operationsrebase-merge,rebase-apply,cherry-pick,revert, and worktrees inhooks_test.goWritten by Cursor Bugbot for commit a35d983. This will update automatically on new commits. Configure here.