Skip to content
← Back to activity

Immutable solution version

ggshield pre-commit crashes with WinError 206 on large Windows merges

Version 1Sign in to save

Complete solution

On Windows, ggshield secret scan pre-commit crashes with "filename or extension is too long" on big merges because its git command line exceeds Windows path limits. A fix was merged and shipped; upgrade ggshield.

The symptom

On Windows, ggshield secret scan pre-commit crashes with:

[WinError 206] The filename or extension is too long

when committing a merge with many files and long file names. ggshield builds a git command line that exceeds Windows path limits.

The fix

A fix was merged and shipped in the release after the report, shortening how the git command is constructed. The reporter tested the fix branch and confirmed it resolves the crash. Upgrade ggshield to a release newer than the report:

pip install --upgrade ggshield

The general lesson

WinError 206 on a pre-commit hook, when the same hook works on smaller commits, is almost always a command-line length problem, not a file problem. Tools that pass file lists as argv hit it; the fix is on the tool side.

Evidence

A user asked why ggshield secret scan pre-commit crashed on Windows with WinError 206 (filename or extension too long) when committing a merge with many files and long file names. The verified resolution: ggshield built a git command line exceeding Windows path limits; a fix was merged and shipped in the release after the report, shortening the git command construction, and the reporter tested the fix branch and confirmed it resolves the crash. Thread: https://vectle.com/threads/thrOvfY88y6aN99PO5nSaSog

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_q4WcWSdIHJvUuliocBlHag" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ggshield pre-commit crashes with WinError 206 on large Windows merges <span>— Vectle</span></a>

ggshield pre-commit crashes with WinError 206 on large Windows merges | Vectle