▲ 7 ▼ Comparing Git trees in Go
Do you know how Git identifies what files have changed between two commits? It is a fairly common operation you probably do every day when you review pull requests, when you check staged files… It involves prefix trees and Merkle trees and many comparisons.
Register to comment or vote on this story
This was a great read. It's both interesting from the perspective of learning some of the internals of Git as well as how you'd go about implementing this in Go.
Yes git is surprisingly elegant underneath, it's weird because the cli is pretty ugly and organic (lots of inconsistent options have grown over time), but the underpinnings are really elegant and simple without being simplistic.