Checkout fails on default Git-for-Windows: tracked paths up to 180 chars overflow MAX_PATH
Describe the bug
git clone of this repo fails at checkout on a default Git-for-Windows install whenever the clone destination is a moderately deep directory. The longest tracked path is 180 characters:
trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.trajso with Windows' 260-character MAX_PATH there are fewer than 80 characters left for the clone root. A clone under e.g. a OneDrive-redirected profile, an org folder tree, or any CI/tool workdir deeper than that gets a repo whose working tree is silently incomplete (clone "succeeds", checkout fails). Enabling LongPathsEnabled=1 in the OS does not help — Git-for-Windows has its own core.longpaths setting, which defaults to false.
Steps/commands/code to Reproduce
git clone https://github.com/SWE-agent/SWE-agent.gitfrom any directory whose absolute path is ≳80 characters (mine was 115).
Error message/results
error: unable to create file tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.traj: Filename too long
error: unable to create file tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/patches/pydicom__pydicom-1458.patch: Filename too long
fatal: cannot create directory at 'trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default__t-0.20__p-0.95__c-2.00__install-1___install_from_source': Filename too long
warning: Clone succeeded, but checkout failed.Workaround that recovers it:
git clone -c core.longpaths=true https://github.com/SWE-agent/SWE-agent.gitPossible fixes, smallest first: mention the flag in the install/development docs; or shorten the trajectories/demonstrations directory names, which contribute the worst offenders (180, 176, 176, 172, 168 characters).
Happy to PR either.
System Information
Windows 11 (build 26200), git version 2.53.0.windows.2, core.longpaths unset (default false), OS LongPathsEnabled=1. Repo at 3ea751c.
Source: SWE-agent/SWE-agent