Hacker News new | ask | show | jobs
by cyphar 3482 days ago
Patches in git are generated on-the-fly. This is actually one of the critical things that made git so much better than conventional version control systems at the time -- it doesn't need to track diffs (which means it doesn't have to handle the infinite fractal of problems that spiral out of rebasing diffs). It can just compute them when it needs them.

Think of git like a snapshotting filesystem that has a VC interface added on top.

1 comments

Where does that leave rebasing, then? That's explicitly an operation on diffs: take these diffs and apply them to that.
Rebasing is implemented by generating diffs, yes. But git doesn't actually store these diffs -- they're all generated on the fly from tree snapshots. If your VC stores diffs rather than the actual contents of files then you can't be sure that you'll get out exactly the same data as you put into it. There are also a bunch of other problems that happen as a result.