From 93e1c40c074955421146a6d2b7a03da91f637e3d Mon Sep 17 00:00:00 2001 From: Victor Irzak Date: Thu, 27 Aug 2026 01:49:42 -0400 Subject: [PATCH] Say that Windows needs core.longpaths to clone The snapshot file names reach 199 characters, so a checkout on Windows fails partway through unless the clone root is unusually shallow. What makes it worth documenting rather than merely knowing is the shape of the failure: git reports the limit per file and then aborts, leaving a repository which looks cloned and is missing most of its files. Shortening the names was the alternative. It is not worth it. The generator caps its own file names at 100 characters and Verify prefixes each snapshot with the test class and method, which puts the floor near 155 - renaming tests buys tens of characters and leaves the same failure standing, rarer and harder to recognise. The names which are worst are also the ones doing the most work, FileNameTests using absurd namespaces precisely because absurd namespaces are what it tests. Generated with Claude Code --- AGENTS.md | 29 +++++++++++++++++++++++++++++ README.md | 6 ++++++ 2 files changed, 35 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 8bc83bd..c7e8aea 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,6 +2,35 @@ See README.md for project overview and consumer API. +## Cloning on Windows + +The snapshot file names under `tests/Generator.Tests/Snapshots` run to 199 +characters, which carries a checkout past the 260 character Windows path limit +unless the clone root is unusually shallow. Git reports `Filename too long` for +each one, then `fatal: unable to checkout working tree`, and leaves a +repository with most of its files missing rather than an obvious failure. + +```sh +git clone -c core.longpaths=true https://github.com/zompinc/sync-method-generator.git +``` + +`-c` applies the setting to this clone alone. Setting it globally is worth +doing on any Windows machine which builds .NET repositories, snapshot testing +being common enough that this is not the last repository to hit it: + +```sh +git config --global core.longpaths true +``` + +The length is mostly intrinsic rather than careless. The generator caps its own +generated file names at 100 characters, and Verify prefixes each snapshot with +the test class and method names, which puts the floor near 155 before any +particular test is named. Renaming tests buys tens of characters; it does not +remove the limit. + +Consumers installing the Claude Code plugin are unaffected, the documented +install command using a sparse checkout which never touches the snapshots. + ## Build & Test ```bash diff --git a/README.md b/README.md index 7b85164..cecb67f 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,12 @@ The plugin ships a single skill covering setup, the attribute options, the trans ## Development +Clone with `core.longpaths` enabled on Windows - the snapshot file names are long enough that a checkout otherwise fails partway through: + +```sh +git clone -c core.longpaths=true https://github.com/zompinc/sync-method-generator.git +``` + ### Related projects - [SyncToAsyncExtension](https://marketplace.visualstudio.com/items?itemName=lsoft.SyncToAsyncExtension) - Allows switching between sync and async versions of a method. Very useful in development of this library.