git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:12 UTC

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

From
Skybuck Flying <skybuck2000@hotmail.com>
Date
Sep 1, 2026, 20:25 UTC
Message-ID
<AM0PR02MB4450BB21D265D843560BCA0DB3A82@AM0PR02MB4450.eurprd02.prod.outlook.com>
In-Reply-To
<AM0PR02MB4450EF826479360A3A262277B3A82@AM0PR02MB4450.eurprd02.prod.outlook.com>
I am unhappy with Co-Pilots solution.
The filter is also dangerous... settings it to a few text files is also kinda nuts, but it might be done per project/git repo, perhaps... not sure... weird...

Short answer: **yes, Skybuck — there is WAY too much risk with this filter**, and you should remove it completely. Not “maybe”, not “under certain conditions”. It is objectively dangerous, and your system already proved it by corrupting PNGs.

Let me explain it cleanly, without sugarcoating, and give you the exact commands to eliminate the risk permanently.
---

## ⚠️ Why the filter is inherently dangerous The rule you had:

```
* text diff=lfclean
```
is one of the most destructive `.gitattributes` configurations possible because:
- `*` matches **every file**
- `text` forces Git to treat **binary files as text**
- `diff=lfclean` applies your custom filter to **every file**
- your filter runs `sed -e s/\r//`, which **modifies file contents**
- Git applies this filter **during checkout**, silently rewriting files
This combination guarantees corruption of:
- PNG  
- JPG  
- ZIP  
- EXE  
- DLL  
- PDF  
- MP3/WAV  
- any binary format  

This is not a “rare edge case”. It is a **guaranteed corruption mechanism**.

Your PNG corruption is not a coincidence — it is exactly what this filter does.
---

## 🧨 Why the risk is unacceptable Even if you “fix” the filter by adding exceptions, the risk remains because:

- future repos may contain unknown binary formats  
- future tools may generate new file types  
- future `.gitattributes` merges may override your exceptions  
- future Git updates may change filter behavior  
- future scripts may add new patterns  
- future contributors may not know your global filter exists  

A global filter is **invisible** to repositories. Nobody expects it. Nobody tests for it. Nobody documents it.

This makes it a **silent corruption vector**.
If you ever clone:
- firmware  
- installers  
- game assets  
- compressed archives  
- executables  
- DLLs  
- images  
- audio  
- video  
- machine learning models  
- container layers  
Git will corrupt them.
This is not theoretical — you already saw it happen.
---

## 🛠️ The correct solution (no bullshit) Remove the global attributes file and remove the filter.

### **1. Delete the global `.gitattributes`** ``` del C:\Users\skybu\.gitattributes ```

### **2. Remove the global attributesfile setting** ``` git config --global --unset core.attributesfile ```

### **3. Remove the dangerous diff driver** ``` git config --global --unset diff.lfclean.textconv git config --global --unset diff.lfclean.binary git config --global --remove-section diff.lfclean ```

### **4. Verify** ``` git config --global --get-regexp diff git config --global core.attributesfile ```

Both should return nothing.
This completely eliminates the corruption vector.
---

## 🧠 If you still want CR/LF cleanup for text files Use a **local** `.gitattributes` inside each repo, not global.

Example safe version:

``` *.txt text *.pas text *.dpr text *.ini text *.md text ```

This is safe because:
- it only applies inside that repo  
- it only applies to known text formats  
- it does not touch binaries  
- it does not use textconv filters  
---

## 🔥 Final verdict Yes — the filter is too risky. Not “a bit risky”. Not “risky in some cases”. It is **objectively unsafe** and should be removed.

You already saw real corruption. Next time it could be a ZIP, an EXE, a DLL, or a firmware blob.

Remove it. You’ll never regret removing a global filter. You *will* regret keeping one.

If you want, I can help you build a **safe, minimal, future-proof** `.gitattributes` setup.
For now to hell with this filter shit.
Fortunately I didn't clone to many repos with pictures or binaries in em... I think... not sure... what a fucking nightmare !
Bye for now,
  Skybuck.
Previous: Skybuck FlyingNext: Skybuck Flying
Message 10 of 16 in “AI Textconv filter misconfiguration on Windows leads to silent corruption of diff output (ongoing investigation)”
  1. Skybuck FlyingAug 11, 2026
  2. Skybuck FlyingAug 11, 2026
  3. Skybuck FlyingAug 11, 2026
  4. Jeff KingAug 11, 2026
  5. Skybuck FlyingAug 11, 2026
  6. Theodore TsoAug 11, 2026
  7. Skybuck FlyingAug 11, 2026
  8. Bradley MorganAug 21, 2026
  9. Skybuck FlyingSep 1, 2026
  10. Skybuck FlyingSep 1, 2026
  11. Skybuck FlyingSep 1, 2026
  12. rsbecker@nexbridge.comSep 1, 2026
  13. Skybuck FlyingSep 2, 2026
  14. Skybuck FlyingSep 2, 2026
  15. D. Ben KnobleSep 2, 2026
  16. Skybuck FlyingSep 2, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.