Skip to content

Fix handling git worktrees - #7540

Open
nilsvu wants to merge 5 commits into
sxs-collaboration:developfrom
nilsvu:worktrees
Open

Fix handling git worktrees#7540
nilsvu wants to merge 5 commits into
sxs-collaboration:developfrom
nilsvu:worktrees

Conversation

@nilsvu

@nilsvu nilsvu commented Sep 5, 2026

Copy link
Copy Markdown
Member

Proposed changes

Fix some problems with git worktrees:

  • Git hooks were broken in worktrees
  • Formaline as well
  • File-checks hit false positives
  • Gitignored personal files didn't carry over to worktrees

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.
  • If a coding agent was used, have a co-author trailer of the form
    "Co-Authored-By: " as the last line of the
    commit, e.g. "Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com",
    "Co-Authored-by: Codex noreply@openai.com", or
    "Co-Authored-By: GitHub Copilot CLI noreply@microsoft.com".

Further comments

nilsvu and others added 5 commits September 6, 2026 15:51
In a worktree .git is a file and hooks are shared, so ask git for the
hooks dir and drop hardcoded source paths from the hook.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
.git is a file in worktrees, so the git branch was never taken.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Git-ignored files like CMakeUserPresets.json don't carry over, so a
post-checkout hook symlinks them from the main worktree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
In a worktree .git is a file, and in the main checkout AGENTS.local.md
is a real file. Both lack a license and fail the check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant