Re: AI Textconv filter misconfiguration on Windows leads to silent corruption of diff output (ongoing investigation)

Jeff King <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Tue, Aug 11, 2026 at 12:44:42AM +0000, Skybuck Flying wrote:

> - 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:

> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.