Skip to content

docs: enable Windows long paths before worktree checkout - #7416

Merged
thomhurst merged 2 commits into
mainfrom
issue-7320-windows-long-paths
Nov 3, 2026
Merged

thomhurst merged 2 commits into
mainfrom
issue-7320-windows-long-paths

Conversation

@thomhurst

@thomhurst thomhurst commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Windows worktree checkouts can fail on the deeply nested template snapshots before a checkout is registered. Document enabling repository-local core.longpaths before creating a worktree in AGENTS.md and the worktree lifecycle guide, including how to inspect and reuse a branch left by a failed checkout.

Validation: git diff --check passed. A temporary repository confirmed that the documented setting is visible in both the shared checkout and its linked worktree. Windows checkout validation was not run on this macOS host; this change only documents the workaround reported in the issue.

Closes #7320

Summary by CodeRabbit

  • Documentation
    • Added Windows setup guidance for enabling long-path support before creating a worktree.
    • Added recovery steps for “Filename too long” failures, including checking existing worktrees and branches and preserving existing checkouts or work.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The repository guidance now instructs Windows users to enable repository-local Git long-path support before creating a worktree. It also describes recovery steps after a checkout fails with a filename-length error.

Changes: Windows worktree guidance

Layer / File(s) Summary
Worktree setup and recovery
AGENTS.md, scripts/WorktreeLifecycle.md
Instructions cover enabling and verifying core.longpaths before the first Windows worktree. They also describe checking existing worktrees and branches after a failed checkout, and add a “Regression tests” heading.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other · Severity of issue fixed: Medium

Merge Risk: Minimal · up to e5689

The guidance changes are mergeable; Windows checkout validation can follow separately.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main documentation change: enabling Windows long paths before worktree checkout.
Linked Issues check Passed Issue #7320 requires documentation or automation that enables repository-local core.longpaths=true before a Windows worktree checkout. The PR adds this prerequisite to AGENTS.md and `scripts/Workt…
Out of Scope Changes check Passed The reported changes are limited to AGENTS.md and scripts/WorktreeLifecycle.md. They document the core.longpaths workaround and failed-checkout recovery required by issue #7320. No unrelated cha…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #7320 requires documentation or automation that enables repository-local core.longpaths=true before a Windows worktree checkout. The PR adds this prerequisite to AGENTS.md and scripts/WorktreeLifecycle.md. The guide also documents inspection and reuse of a branch left by a failed checkout. The reported git diff --check and temporary-repository validation support the documentation change. Windows checkout validation is absent, but the issue requires the documented workaround and does not require Windows execution evidence.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to AGENTS.md and scripts/WorktreeLifecycle.md. They document the core.longpaths workaround and failed-checkout recovery required by issue #7320. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the path before the start,
Then sets long paths with care and art.
If checkout stops and leaves a branch,
The guide says check before a fresh advance.
Safe worktrees bloom beneath the moon,
With tidy paths and a hop in tune.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0d80ef81-9a38-4709-af32-936b7cb5cc68
Commits

Reviewing files that changed from the base of the PR and between ca4437c and e568954.

Files selected for processing: 2
  • AGENTS.md
  • scripts/WorktreeLifecycle.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-03T00:46:29.873462Z e568954 Draft marked ready
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: c6e1b5a4e0

ℹ️ 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".

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The documentation changes appear safe to merge.

Summary

Documents enabling repository-local core.longpaths before creating Windows worktrees.

  • Windows worktree instructions cover long paths and failed checkout recovery.

No new actionable issues were found in the changes since the previous review.

Reviews (2) · Last reviewed commit: "docs: clarify failed checkout recovery f..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Docs-only change, and it's accurate and well placed. The core.longpaths setting is repo-local, so linked worktrees do share it. The new heading structure is fine.

Two small points:

  1. Contradiction: "Setting it after checkout fails is too late to prevent a partial checkout" sits right above "If checkout already failed… enable the setting above before retrying". I think you mean it's too late to avoid the failure, but the recovery path still works. Please reword so the two sentences don't read as opposites.
  2. Possible missing prerequisite: git's core.longpaths only helps if the Windows long-path limit is also lifted for the process (LongPathsEnabled registry key, or a manifest-enabled git). Git for Windows normally handles this itself. A one-line note saying that if the error persists after the git setting, the OS-level LongPathsEnabled should be checked would make the guide more robust.

The PR description says Windows checkout wasn't validated. That's acceptable for a docs workaround, but the second point is exactly the kind of thing that validation would reveal.

LGTM otherwise.

@thomhurst

Copy link
Copy Markdown
Owner Author

Clarified the recovery wording in e568954: enabling the setting before checkout prevents the partial checkout; the recovery steps still apply after a failure.

I have not added LongPathsEnabled as a Git checkout prerequisite. Git for Windows implements core.longpaths by expanding paths to the extended-length prefix, rather than relying on the OS opt-in for ordinary paths. See the conversion wrapper and the prefix implementation. Other Windows tools may have separate requirements, but that is outside this Git checkout workaround.

Validation: git diff --check passed. Windows checkout validation remains unrun on this macOS host. The PR stays draft pending fresh reviews of the new head.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: e5689548f0

ℹ️ 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".

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review: docs-only change, looks good.

The core.longpaths guidance is accurate and correctly placed: it's repo-local, so worktrees share it, and it's set before the first git worktree add. The recovery steps (reuse the leftover branch without -b) are also right.

Minor, non-blocking suggestions:

  • The Windows setup section says "the recovery steps below still apply", but the recovery paragraph follows directly in the same section. "Below" is vague, so consider dropping that sentence or merging the two paragraphs.
  • After a failed checkout, the target directory may exist partially populated. Say whether to delete it or let git worktree prune handle it before retrying. The existing preservation rules mean the user may want to check it first.
  • Git for Windows can also hit MAX_PATH in other tools (the .NET SDK, older MSBuild) unless the OS LongPathsEnabled registry setting is on. A one-line note would help, but it isn't required for the checkout fix.
  • The PR body says Windows validation wasn't run. That's acceptable for a docs change, and I have no objection.

No code or API impact. Approve from my side.

@thomhurst

Copy link
Copy Markdown
Owner Author

Reviewed every review surface for e568954. Claude and Codex both approve this head; there are no inline threads or blocking findings.

Disposition of Claude’s remaining non-blocking suggestions: retain the nearby recovery reference; retain the explicit instruction to inspect and preserve any existing checkout or work rather than recommend deleting a partially populated directory (pruning registrations does not remove its files); retain the scope of this section as Git checkout setup, with other Windows tool requirements outside this workaround. No further change is needed for these suggestions.

Marking ready for CI and the ready-for-review Claude run. Windows checkout validation remains unrun on this macOS host, as documented in the PR body.

@thomhurst

thomhurst commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner Author

The earlier blocker is cleared: Claude run 41552011855 passed and its latest review has no blocking findings. All review surfaces were checked; Codex also approves head e568954, with no inline threads. The remaining optional suggestions have the dispositions recorded above.

The PR had been converted back to draft at 00:42:57 UTC and its CI cancelled. Restored ready status with the head unchanged; fresh CI and promotion-triggered Claude run https://github.com/thomhurst/TUnit/actions/runs/41555107704 are queued. Auto-merge remains unarmed until that new Claude run passes and its findings are read. Next unit: read every review surface, then use Enable-AutoMerge.ps1 if eligible. No on-hold label or external prerequisite is needed.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review of #7416 (docs-only)

The change is accurate and well placed. It adds a short pointer in AGENTS.md and a Windows setup section in scripts/WorktreeLifecycle.md. Both say to run git config --local core.longpaths true before the first git worktree add. The section also covers recovery from a failed checkout by reusing the leftover branch without -b. Worktrees share the repository-local config, so one setting covers all of them.

Suggestions, none blocking:

  • core.longpaths only fixes Git's own checkout. Other tools such as dotnet, MSBuild and pwsh can still hit MAX_PATH when they build under the worktree root. Mention the OS-level LongPathsEnabled registry setting, or a shorter worktree root, as an optional second line of defence.
  • The sentence "the recovery steps below still apply" is followed immediately by a duplicate "If checkout already failed..." paragraph. Drop one of the two to reduce redundancy.
  • A short note on how to confirm the failure mode would help, for example that the error is Filename too long. It is already in the text, so this is minor.

The PR description says Windows validation was not run. That is acceptable for a docs-only workaround. Approving in spirit.

@thomhurst
thomhurst marked this pull request as draft November 3, 2026 00:42
@thomhurst
thomhurst marked this pull request as ready for review November 3, 2026 00:45
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review: docs-only change, looks good.

The core.longpaths guidance is accurate. git config --local is stored in the shared .git/config, so linked worktrees do inherit it. Pointing at it from AGENTS.md and keeping the detail in WorktreeLifecycle.md fits the repo's progressive-disclosure approach. The recovery advice is also correct: reuse the leftover branch with git worktree add <path> <branch> instead of repeating -b.

Minor suggestions (non-blocking):

  • The Windows setup section and its recovery paragraph overlap. The sentence 'If checkout has already failed... the recovery steps below still apply' is followed immediately by the recovery paragraph. Merging them into one sentence would cut the repetition.
  • The new ## Regression tests heading splits what was previously unheaded content. That is a reasonable cleanup, but check that no other doc links to the old anchors or relies on the old structure.
  • A more durable option is to have scripts/AgentLocks.ps1 or the worktree-creation helper set or check core.longpaths on Windows. That way agents can't skip the manual step. A follow-up issue would do. It isn't needed here.

The PR says Windows checkout was not validated. That's acceptable for a docs-only change.

Approving from my side.

@thomhurst

Copy link
Copy Markdown
Owner Author

Run 41555107704 completed successfully on e568954; the earlier wait is cleared. Re-read reviews, inline comments, all conversation comments and review threads: Claude and Codex approve this head, with no blocking findings or unresolved threads.

The latest optional suggestions retain the existing dispositions: keep the short recovery pointer and the Git-specific scope. The new Regression tests heading has no existing anchor references in the repository guidance searched. Automating the Windows configuration is an optional alternative to the documentation remedy accepted by #7320, rather than remaining acceptance work. No additional change is needed. Current CI is green; proceeding through Merge-Pr.ps1.

@thomhurst
thomhurst merged commit 09c95ec into main Nov 3, 2026
52 of 62 checks passed
@thomhurst
thomhurst deleted the issue-7320-windows-long-paths branch November 3, 2026 03:42
This was referenced Nov 5, 2026

This branch was previously deployed

1 inactive deployment
Pull Requests — e5689548 Deployed Nov 3, 2026 by thomhurst via modularpipeline (ubuntu-latest) #20745
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.

Windows: new worktrees fail with 'Filename too long' on TUnit.Templates.Tests snapshots

1 participant