Skip to content

Fix: /undo destructively interacts with git staging (#8214) - #8303

Merged
etraut-openai merged 2 commits into
openai:mainfrom
Galaxy-0:fix/issue-8214-undo-git-staging
Dec 19, 2025
Merged

etraut-openai merged 2 commits into
openai:mainfrom
Galaxy-0:fix/issue-8214-undo-git-staging

Conversation

@Galaxy-0

Copy link
Copy Markdown
Contributor

Fixes #8214 by removing the '--staged' flag from the undo git restore command. This ensures that while the working tree is reverted to the snapshot state, the user's staged changes (index) are preserved, preventing data loss. Also adds a regression test.

@etraut-openai

Copy link
Copy Markdown
Contributor

@Galaxy-0, thanks for the contribution. Could you please fix the linter (cargo clippy) errors?

@etraut-openai etraut-openai added the needs-response Additional information is requested label Dec 19, 2025
@Galaxy-0
Galaxy-0 force-pushed the fix/issue-8214-undo-git-staging branch from dbd4343 to ac79d3a Compare December 19, 2025 06:31
Previously, /undo would run git restore --staged, which wiped out any changes the user had staged since the last formatting. This change removes the --staged flag, ensuring that strictly the working tree is reverted to the snapshot state, while preserving the user's index (staged changes). Added regression test.
@Galaxy-0
Galaxy-0 force-pushed the fix/issue-8214-undo-git-staging branch from ac79d3a to d54b01d Compare December 19, 2025 07:07
@Galaxy-0

Copy link
Copy Markdown
Contributor Author

Fixed clippy lints and rebased on latest main. Ready for review!

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Dec 19, 2025
@jif-oai

jif-oai commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

@codex review

@jif-oai jif-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok for me if Codex does not raise any nits

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
etraut-openai merged commit 014235f into openai:main Dec 19, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/undo destructively interacts with git staging

3 participants