Hacker News new | ask | show | jobs
by phillco 858 days ago
Julia Evans wrote a nice blog post about this recently, in that sometimes it's helpful to think commits as snapshots and sometimes as diffs.

https://jvns.ca/blog/2024/01/05/do-we-think-of-git-commits-a...

I guess while it's true the storage layer is snapshot based, as you say, that only gets you so far conceptually, and it's probably best to focus on the _operation_ you're doing, as rebase, cherry-pick, apply-patch, etc are easier to think in terms of diffs.

When I used to use Phabricator, the fact that I could always fall back to handing it a raw patch file to submit changes also made it easier to reason about (regardless of what the server and client were actually doing).

1 comments

Commits have a dual snapshot-like and diff-like nature, depending on how you observe them.