From: Skybuck Flying Date: Tue, 11 Aug 2026 02:13:25 GMT Subject: Re: AI Textconv filter misconfiguration on Windows leads to silent corruption of diff output (ongoing investigation) Message-ID: In-Reply-To: I confronted Co-Pilot with it, according to Co-Pilot you will like this shorter report better, more to the point: Hi, I encountered an issue on Windows where a textconv filter intended to strip carriage returns ends up corrupting diff output by removing literal 'r' characters. Configuration: [diff "lfclean"] textconv = sed -e s/\r// *.go diff=lfclean Environment: - Windows 10 - Git for Windows (2.x) - sed from Git for Windows: usr/bin/sed.exe Problem: Running `git diff` on Go source files shows corrupted identifiers: compareCache → compaeCache return → eturn for → fo cacheReader → cacheReade etc. The repository content is correct: - `git diff --no-textconv` shows correct diffs. - `git show :` shows correct content. Reproduction outside Git: echo compareCache | C:\Tools\Git\usr\bin\sed.exe -e s/\r// Output: compaeCache So sed removes literal 'r' instead of carriage returns. It appears that on Windows, the backslash in `\r` is not preserved through MSYS argument parsing, effectively turning the expression into `s/r//`. Impact: - Diff output becomes misleading/corrupted. - No warning is emitted. - The issue is silent and difficult to diagnose. Suggestion: - Consider documenting that sed-based textconv filters using backslash escapes are unsafe on Windows. - Possibly warn when textconv commands contain `\r` on Windows. - A built-in CR-stripping textconv filter would avoid these pitfalls. Thanks, Skybuck Flying