Readit News logoReadit News
Posted by u/jannesblobel 3 days ago
Stop squashing your commits. You're squashing your AI too
Everyone keeps saying “keep your Git history clean.” Squash, rebase, linearize. It looks neat in the git log.

But here’s the thing: in 2025 our biggest collaborators aren’t just humans, they’re AI tools. And those tools need the messy history: the failed attempts, the typos, the bad refactors. That’s the context they learn from.

When we squash everything into a perfect history, we’re deleting the very breadcrumbs that could help an agent explain a bug, trace a regression, or warn us we’re about to repeat an old mistake.

“Clean history” makes reviewers happy today. But it’s technical debt for tomorrow’s AI-assisted development

Hackbraten · 3 days ago
I’m finding it difficult to agree with you without a concrete example.

How exactly would it help to have a commit that introduces a problem and then another one that fixes it? How does leaving in a bad refactor, failed attempt, or typo help the AI tool with anything?

jannesblobel · 3 days ago
Think of a refactor where you tried one approach, rolled it back, then found the right fix. If you squash, all those failures vanish. With full history, an AI (or future you) can see the dead ends and spot patterns. I think that’s what Augment Code is doing with their Context Lineage idea: indexing the messy history so tools can explain how code evolved.

https://www.augmentcode.com/blog/announcing-context-lineage

skydhash · 3 days ago
Today I downloaded the source code of a small utility to check its internals. You know what I was not interested in? The git history. Instead I just download the tarball from Debian.

Version history is only interesting if you’re doing archeology. And I would prefer seeing a squashed commit that introduce a complete change instead of going back and forth to get the complete picture (anyone with such messy history will introduce unrelated changes too).

As for failure, put that in some tracker, with an “abandoned” status.

raw_anon_1111 · 3 days ago
The issue is that once you pollute your context window with the “wrong” information even after you have guided the LLM to the right path, it is still more likely to go off the rails.

https://research.trychroma.com/context-rot

bjourne · a day ago
I don't think the AI argument has merit, but I agree with your general sentiment. Squashing commits destroys part of the signal and makes software archaeology more difficult. There is huge value in a commit history that reflects how the software actually was made.
ManlyBread · 2 days ago
It's as easy to say that this will poison the context and produce worse results. Do you have any actual examples? Without any sort of an example this sounds like some software voodoo.
raw_anon_1111 · 3 days ago
LLMs are so bad with going off the rails when it comes to coding, I purposefully arrange my sessions so it doesn’t have to digest too much at once.

I recently had it go off the rails on some greenfield work where I was clearly using MySQL with Python and in the middle of the session it started generating Postgres code using the Postgres driver and doing Postgres style upserts.