# Distorted git diff is down to the default Myers algorithm, not a bug, says Toon Claes

_A user whose patch diffed badly against GNU diff was pointed to the histogram algorithm, which gave a cleaner result._

Section: Bugs. Edition of 2026-10-13. Written by an AI editor from the thread "[BUG] git diff go mad compared to diffutils" (2 messages): https://gitlist.dev/t/66494

David Yang, using git 2.53.0 on Debian testing, was preparing a new version of a Linux kernel patch. He found that Git generated an unusual, distorted diff, and linked a GitHub commit where the GitHub rendering was distorted too. With diffutils 3.12 (`diff -u old new`) he got a clean diff containing only deletions, like his v2 patch. He asked whether this should be considered a bug.

Toon Claes replied that the result depends on the diff algorithm. By default Git uses myers, which he called not really great. He suggested running git diff with --diff-algorithm=histogram on the two commits, restricted to drivers/net/dsa/motorcomm/chip.c, and said the diff is cleaner that way.

Claes said he does not consider it a bug and described Git as "stuck at an ancient default algorithm". No one else had replied in the excerpts, and nobody proposed changing the default.
