Repository navigation
fix(core): run undo on Git older than 2.42 - #507
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b72db1d396
ℹ️ 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".
Merged
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.
What changed for users
qq undoand TUI/undowork again on Git 2.32 through 2.41: stock macOS Git (2.39), Debian 12 (2.39), Ubuntu 22.04 (2.34). Before this, any restore with an ignored, protected, or submodule path below a folder (web/node_modules,pkg/__pycache__) failed withunknown switch `Z'.qq doctorno longer reports a Git work tree as "not a Git work tree" on Git older than 2.31.qq doctorwarns on thesnapshotsline and names 2.32. Snapshots andqq undorefuse withGit X is older than 2.32; snapshots and qq undo need Git 2.32 or newerinstead of restoring wrongly. Documented indocs/guide/install.md(system requirements) and theqq undosection ofdocs/guide/cli.md./workspaceas a Gitsafe.directory, so snapshots stay on when the mounted checkout's owner is not UID 1000.Git invocations
cat-file --batch-check -Z(2.42) →ls-tree -z <commit> -- :(literal)<path>…. Paths go as separate argv entries, so any byte, newline included, is exact. Arguments are batched at 16 KiB.rev-parse --path-format=absolute --git-path index(2.31) →rev-parse --is-inside-work-tree --absolute-git-dir, with the index at<git-dir>/index.-c core.fsmonitor=false→-c core.fsmonitor=. Before 2.36, Git treatsfalseas a hook command and runs/bin/false.ls-files --others --ignored --directorydoes not list ignored files inside a non-ignored untracked folder before 2.32 (fixed in 2.32,en/dir-traversal). There is no older form that is exact, so older Git refuses instead. Verified with Git built from source: 2.31.0 failsa_folder_named_with_a_newline_is_not_replaced_by_a_snapshotted_file; 2.32.0, 2.33.0, 2.34.1 (Ubuntu 22.04) and 2.39.5 pass all qq-core undo tests.Verification
New CI job
undo on Git 2.39 (debian:bookworm)runs the qq-core undo tests andcargo xtask smoke --only run-then-undo. New tests: an ignoredweb/node_modules/below a folder, and a folder whose name contains a newline. The smoke workspace now has an ignoredweb/node_modules/.git cat-file failed: error: unknown switch `Z'.cargo xtask checkpassed locally.The first branch run also exposed an existing flaky test,
a_restoring_command_id_is_reserved_against_every_other_request. It times out in 3 of 40 stress runs on Git 2.39, on main as well. Cause: the test's clean filter blocked on every call, not just the first, so a second filter call left the run waiting for the full 30 s timeout. The filter now holds only once; 30/30 stress runs pass on 2.39.Dubious ownership: reproduced with the origin/main image. A
/workspaceowned by UID 1234 givesfatal: detected dubious ownership, andqq doctorreportedsnapshots off: not a Git work tree. With the new image the same mount reportssnapshots on.