Torvalds on Git
Posted Oct 13, 2009 8:38 UTC (Tue) by ldo
Parent article: Watch the 2009 Linux Plumbers Conference (Linux.com)
If you want to understand some of the philosophy of Git, you cant do much better than this extract from Linuss presentation (0:41:38 .. 0:44:28):
So we could make Git really smart, and do all of these things that are easy to do for humans, but ... the humans shouldn't need to have to do? The problem is, the things that are easy to do for humans are usually very, very hard to do for machines. So for example the fact that I noticed the trivial pattern that the thing that was conflicting was just this one single rename of a function, and I should just take all the other changes
but I should do the rename by hand--that's something that is very simple for a programmer to do.
To actually automate that kind of logic into Git--I wouldn't trust the end result. One of the things that makes Git a pleasure to use for me is that I actually trust what Git does, because what Git does in the end is very, very stupid. There's a lot of logic to it, but none of it is subtle. When Git does a merge, it uses very simple algorithms to say when the merge is trivially correct, and if any of those fail, it will give you a nice, or not so nice, conflict. And I'd much rather have a tool I can really trust, and that then gives me help to do the things that it should be able to do on its own, but if it did, I would no longer trust the tool. So that's why Git works this way.
Part of what I started off with when I started Git was, there's a lot of people who have worked on source-control management for a long time. And most of them are morons. Because they care about really smart merging algorithms. And they care about getting all the really subtle cases right. And they have all these fancy names for different ways of doing things.
And Git takes absolutely the opposite approach, where merges are really really simple, what Git does automatically for you ... it has a really simple name, it's called a 3-way merge with some rename detection, which is kind of cool, but in the end, it's actually technically very simple. And 3-way merges have been around forever. 3-way merges were what SCCS did.
3-way merges are what CVS does. The difference between Git and CVS is, Git actually helped you complete the merge. While CVS will say hey, here's the messy end-result, you fix it up. And then CVS will do nothing to actually help you. So what Git does is the stuff I showed you, but it won't do the merge automatically for you.
to post comments)