Re: AI Textconv filter misconfiguration on Windows leads to silent corruption of diff output (ongoing investigation)
- From
Jeff King <peff@peff.net>
- Date
- Aug 11, 2026, 03:40 UTC
- Message-ID
- <20260811034001.GA15552@coredump.intra.peff.net>
- In-Reply-To
- <AM0PR02MB445096594555DAD1D9EE1505B3DD2@AM0PR02MB4450.eurprd02.prod.outlook.com>
On Tue, Aug 11, 2026 at 12:44:42AM +0000, Skybuck Flying wrote:
Show 7 quoted lines
> - compareCache appeared as compaeCache > - return appeared as eturn > - from appeared as fom > - var appeared as va > - for appeared as fo > - cacheReader appeared as cacheReade > - CompareAndSwap appeared as CompaeAndSwap
So all of your r's are gone...
> Global .gitconfig: > diff.lfclean.textconv=sed -e s/\r//
...and here you don't quote against the shell. So the shell is probably converting "\r" into just "r", and thus sed is removing them.
The same thing would be a problem on Linux as well as Windows.
I felt clever at spotting this immediately, but then this is already in your text later:
Show 5 quoted lines
> So the command does strip the literal character 'r' instead of > carriage returns. The likely reason is that the backslash before r is > not preserved through the shell argument parsing on Windows; > effectively, the expression becomes s/r//, which deletes all 'r' > characters.
So...what's the question? This is a misconfiguration on your part. Perhaps Git's documentation could be more clear that there will be a shell involved, but using a shell is normal for (almost) all user-specified commands run by Git.
-Peff