Better HN
topnewbestaskshowjobs
Log inSign up

siawyoung

2 karma · joined Mar 25, 2015 (11y ago) · 2 submissions

Submissions

comment 5y ago · link · parent

Commits are conceptually snapshots, and everything else Git does is just an optimization over the naive “keep all versions of all files ever” (imagine implementing a version of Git that is just zipping the entire folder). Diffs are isomorphic to commits and are generated as needed.

I wrote about it (albeit imprecisely) here: https://siawyoung.com/git-intuition

comment 5y ago · link · parent

This makes sure that none of the quantities being calculated will overflow while still returning the same answer.

Where x is min and y is max, the midpoint is:

(x+y)/2 = x+(y-x)/2 x+y = 2x+y-x x+y=x+y