Skip to content

fix(core): run undo on Git older than 2.42 - #507

Merged
lg2m merged 4 commits into
mainfrom
fix/undo-old-git
Oct 30, 2026
Merged

lg2m merged 4 commits into
mainfrom
fix/undo-old-git

Conversation

@lg2m

@lg2m lg2m commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

What changed for users

  • qq undo and TUI /undo work 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 with unknown switch `Z'.
  • qq doctor no longer reports a Git work tree as "not a Git work tree" on Git older than 2.31.
  • Minimum Git is now 2.32. On older Git, qq doctor warns on the snapshots line and names 2.32. Snapshots and qq undo refuse with Git X is older than 2.32; snapshots and qq undo need Git 2.32 or newer instead of restoring wrongly. Documented in docs/guide/install.md (system requirements) and the qq undo section of docs/guide/cli.md.
  • Docker image: the runtime image now marks /workspace as a Git safe.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 treats false as a hook command and runs /bin/false.
  • What sets the minimum: ls-files --others --ignored --directory does 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 fails a_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 and cargo xtask smoke --only run-then-undo. New tests: an ignored web/node_modules/ below a folder, and a folder whose name contains a newline. The smoke workspace now has an ignored web/node_modules/.

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 /workspace owned by UID 1234 gives fatal: detected dubious ownership, and qq doctor reported snapshots off: not a Git work tree. With the new image the same mount reports snapshots on.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T02:23:50.688567Z 9d921f1 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread crates/qq-core/src/undo.rs Resolved
@lg2m lg2m added the ci:full label Oct 30, 2026
@lg2m
lg2m merged commit 2ee582e into main Oct 30, 2026
28 of 30 checks passed
@lg2m
lg2m deleted the fix/undo-old-git branch October 30, 2026 02:36
@lg2m lg2m mentioned this pull request Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant