Readit News logoReadit News
jordigh · 11 years ago
Let's not forget the other contender for replacing Bitkeeper, Mercurial:

http://lkml.iu.edu/hypermail/linux/kernel/0504.2/0670.html

We will also be celebrating Mercurial's 10th anniversary next week during the 3.4 Pycon sprint:

http://mercurial.selenic.com/wiki/3.4sprint

tjradcliffe · 11 years ago
I used Git for a couple of years then changed to Mercurial and have never looked back, except now and then to wonder at the size of the crowd that has gathered around Git, driven in no small part by the success of github (which is not a bad thing!)

Git is an entirely appropriate tool for managing as something as large and complex as the Linux kernel, but I'm doing much simpler stuff, and Mercurial is simpler and has a much shallower learning curve. I'd recommend it unequivocally to teams of modest size working on average applications.

The state of git documentation is much better today than it was five or six years ago, so maybe its complexity is less of a big deal, but so far I've not encountered any issues with Mercurial that make me think "If only I was using git this would be easy!"

What I found with git was I had to maintain a fairly complex mental model of the current state of affairs, and because I'm not very intelligent that took quite a bit of effort. With Mercurial the model is much simpler, so I can spend more of my very limited attention on writing code. It's quite possible that I simply never took the time to learn git properly, but with Mercurial I didn't have to.

jibsen · 11 years ago
I moved from the other way from Mercurial to Git a while back.

I started using Mercurial because the basic interface and operations appeared more natural to me. Also, at least at the time, the Windows support was better in Mercurial.

After working with some repos using Git, I fell in love with the staging area, and the ability to selectively stage parts of files. I am sure Mercurial has something similar, but it was built into Git.

The only thing that bugs me is that the Windows port appears to be stuck at 1.9.5 (yes, I know it's open-source so I should go fix it instead of complaining).

imakesnowflakes · 11 years ago
Mercurial is not only simpler, but also has got really powerful features like revsets.

http://www.selenic.com/hg/help/revsets

I have tried to switch to git multiple times. Every time, I keep coming back to Mercurial. The most difficulty I have with git is the non nonsensical naming of concepts. For eg, A branch is a pointer to a commit. Because of this, I experience a big mental block when I try to reason about something. With Mercurial this is very much easier. And if you are using a DVCS to any capacity you ll have to do this often.

Another great thing about Mercurial is how easy to get help about stuff. You can head to the IRC chat room and can have a very good chance of catching one of the developers who, in my experience, were very helpful...

Someone1234 · 11 years ago
I won't comment on Mercurial because I don't know anything about it.

I really do feel like Git is appropriate for small projects. The .git store is incredibly small (because it only stores changes) and quite simple when you get used to it. You will only only need to use a tiny subset of Git's functionality (or, heck, just the Github web-UI if you wish).

I think the hardest thing about Git for big and small teams is getting used to the mental model of Git (branching, merging, master, etc). Once you get it down you realise that Git is less complex, not more...

PS - This comment is mostly in reply to the implication that Git is a better tool for large and complex projects like the Linux Kernel.

PPS - Mercurial might be a better tool yet still for small projects, I don't know enough about Mercurial to have a qualified opinion either way.

rqebmm · 11 years ago
Where I land is that mercurial is a better tool, but git is a better platform. As a result, better tools have been built on top of git than mercurial (like github). As a result, git at some point became the standard.
jebblue · 11 years ago
I'd use Mercurial but its name has too many syllables.
henrik_w · 11 years ago
"The trick wasn't really so much the coding but coming up with how it organizes the data."

I think this really is the key to understanding git as well. When you understand the git data structures, git makes sense. Otherwise, it can be quite difficult to grasp (http://ftp.newartisans.com/pub/git.from.bottom.up.pdf was really useful for me).

krylon · 11 years ago
Not only git. There is a nice quote from Fred Brooks Jr. (I think), that if you show me your flow charts and algorithms, I remain as clueless as before, but show me your data structures, and everything else will follow. (I am paraphrasing this from memory, Brooks put it more eloquently.)
henrik_w · 11 years ago
Yes! I love that quote - so true. Linus has the same opinion:

"Bad programmers worry about the code. Good programmers worry about data structures and their relationships." [1]

I actually refered to this when discussing switching from Java to Python. One of the biggest problems for me was not easily being able to see the types of the arguments to a function in Python. [2]

[1] http://programmers.stackexchange.com/questions/163185/torval...

[2] http://henrikwarne.com/2014/06/22/switching-from-java-to-pyt...

mayoff · 11 years ago
I think the Git Parable is an excellent explanation of the underlying git model.

http://tom.preston-werner.com/2009/05/19/the-git-parable.htm...

drakenot · 11 years ago
That link didn't work for me (Page not found) but I found a mirror: https://github.com/umd-byob/presentations/raw/master/2014/03...
agumonkey · 11 years ago
This tutorial did help me getting git basic data and operations a lot. https://codewords.recurse.com/issues/two/git-from-the-inside...

Deleted Comment

kbart · 11 years ago
Great read! Now some git commands make much more sense.
thomasfl · 11 years ago
I wonder if BitKeeper owner Larry McVoy has ever regretted not open sourcing his software? Git tools is a whole industry now. The most promiment one, github, recently become one of the 100 most popular websites on the planet.
luckydude · 11 years ago
Regret it? Sure. I'd do it in a heartbeat if I could figure out how to make it work. Still would and there is plenty in BK that Git doesn't have. Like submodules that actually work exactly like a monolithic tree, just lets you clone what you need.

But we've never figured out how to make it work financially. If anyone has any ideas I'm all ears (though pointing at github and saying "do that" isn't an idea that I can execute).

BTW, BK used to be pretty darned close to open source, you got the source code under a funky license that said "don't take out the part that lets us make money". We stopped shipping the source when we learned that the very first thing that someone committed to the repo was taking out the part that let us make money.

qzw · 11 years ago
Very cool of you to share your thoughts. I sympathize with your dilemma. It seems that the people who end up making money out of free/open source software are often not the ones who write the code. And I remember reading back in the day that Linus would talk with you extensively about the nuts and bolts of DVCSs, so I'm sure all git users owe you some gratitude for inspiring him to create git and getting the fundamentals right from the get go.

Out of curiosity, and please feel free not to answer, is BK still a viable commercial product bringing in significant revenue? And what obstacle do you see with going the platform/service route like github? I assume that's something you've seriously considered, even without open sourcing BK.

anonbanker · 11 years ago

  > Sure. I'd do it in a heartbeat if I could figure out how to make it work. 
just upload it to github. :)

thomasfl · 11 years ago
It's really great to see you answer my question yourself! It seems to be much easier to create a business by using open source software, than writing open source software. Especially for small companies like yours that create complex software like BitKeeper.
ploxiln · 11 years ago
BitKeeper is still around, selling to a few large corporations. It's a very different business model.

Git has a large industry of value-add / support companies now. But no one commercial company can own or control the core. And that's one key reason why it's so popular and has such a large ecosystem around it. So to be like git, bitkeeper would have had to really give up central ownership and control. Commercial companies never do that unless they're going out of business anyway, they just can't.

darkmagnus · 11 years ago
Here is the first Git commit he talks about in the article:

https://github.com/git/git/tree/e83c5163316f89bfbde7d9ab23ca...

AceJohnny2 · 11 years ago
Having read "Git from the Bottom Up" [1], it's interesting and refreshing how concise Torvald's explanation is.

Of course, he also didn't have as much to explain at that stage :)

[1] https://jwiegley.github.io/git-from-the-bottom-up/

ffn · 11 years ago
Jesus, so Torvalds built the MVP for git in 1 day and pretty much scaled it up for kernel usage in 10 days. Now, as a humble average developer, how do I achieve Torvaldian levels of productivity?
vinceguidry · 11 years ago
Well, he'd been collecting ideas and requirements for a long time in his head before he finally made a system out of it. The vast majority of the time, what you're building isn't all that clear to you before you have to start. So there's a lot of time wasted just figuring that out. Cut that wasted time out and you become a powerhouse.
divs1210 · 11 years ago
As someone pointed out, locking yourself in could definitely be a catalyst. How to develop his sensibilities has a very different answer, though - Have High Standards.

    * He aches for the very best tool that will suit all his major  needs. 
    * He mentions getting the data structures right first, which is of prime importance. And no, it doesn't mean you start building TreeFactoryAdapter's.
    * He codes at the lowest level, in C (please don't whine about assembly), to maintain complete control over memory usage.
I shudder to think what he would come up with if he ever decides to take Common Lisp on a test ride.

tikhonj · 11 years ago
It was something at the top of his head, enough that he had a coherent mental model of what he wanted to build. The actual coding was less designing git as much as putting an existing design down in executable notation. Couple this with decades of programming experience—enough, crucially, to express his thoughts comfortably, without getting distracted by the incidental minutia of actual programming—and you get feats that seem almost super-human.

To borrow an overused cliché, the code was just the tip of the iceberg. The hidden body of the MVP was the design he had been thinking about for a while. But we, as external observers, can't really see or appreciate what was going on in his head as he planned this out. It doesn't feel like "real" work, which makes the small remaining part that does seem all that much more impressive. This is actually a real source of tension between certain programmers and managers: it's hard for managers to tell actual thinking apart from day-dreaming, so programmers just look lazy in their eyes.

Torvalds wrote about this himself in the interview:

> So I'd like to stress that while it really came together in just about ten days or so (at which point I did my first kernel commit using git), it wasn't like it was some kind of mad dash of coding. The actual amount of that early code is actually fairly small, it all depended on getting the basic ideas right. And that I had been mulling over for a while before the whole project started. I'd seen the problems others had. I'd seen what I wanted to avoid doing.

How do you achieve this level of productivity yourself?

Personally, I think the main quality you want, as I alluded earlier, is comfort. Get yourself to the point where you trust your tools (and yourself) enough to execute your ideas without apprehension. You want to build yourself up to the point where your tools—everything from your programming language to your editor to your libraries—don't get in the way. They should almost feel like extensions of you. Think about it like riding a bicycle or skiing where you start thinking exclusively about where you're going without being distracted by how. Ideally, you want to think about the problem you're solving and the abstraction you're building rather than the mundane details of how you convey this to the computer.

Crito · 11 years ago
Work smarter, not harder. The reason he was able to get git up and running so fast is because it is fundamentally a very simple system. If you check out the first commit of git in its own git repo, you can see just how simple it is yourself. In that first commit it is barely anything, yet it was sufficient to write a commit for itself.
cms07 · 11 years ago
Spend your better years inside during the 9 months of Finnish Winter.
msvan · 11 years ago
I think there's a lot of value in that period of time before the first commit. Rich Hickey supposedly spent two years thinking about Clojure before even writing a single line of code, and I'm sure Torvalds spent an equivalent amount of time seeing pain points with BitKeeper before writing git.
serve_yay · 11 years ago
Try working on pretty much only one thing for 20 years and see what that gets you.
worklogin · 11 years ago
Linus says of the Github platform -

That's partly because of how the kernel is developed, but part of it was that the GitHub interfaces were actively encouraging bad behavior. Commits done on GitHub had bad commit messages etc, because the web interfaces at GitHub were actively encouraging bad behavior. They did fix some of that, so it probably works better, but it will never be appropriate for something like the Linux kernel.

I haven't ever looked at the kernel workflow, nor have I ever heard systematic criticism of Github's methodology. Does anyone else have input on what Linus may mean by his opinion?

teamhappy · 11 years ago

    > [...] nor have I ever heard systematic criticism of Github's methodology.
He's not only criticizing Github:

    > (a) make a real pull request, not the braindamaged crap that github
    >     does when you ask it to request a pull: real explanation, proper email
    >     addresses, proper shortlog, and proper diffstat.
    >
    > (b) since github identities are random, I expect the pull request to
    >     be a signed tag, so that I can verify the identity of the person in
    >     question.
Real explanation, proper shortlog, signed commit, etc. (Note that he didn't mention emojis.)

All he seems to be asking for is that we take our time and do it properly. Makes all the sense in the world for a large, long-lived open source project like Linux. Imagine 20-year-old commit messages from FreeBSD would look like the ones we write today for, say, a npm module.

--- edit ---

Yeah ... nevermind. He explains it himself further down:

    > Btw, Joseph, you're a quality example of why I detest the github
    > interface. For some reason, github has attracted people who have zero
    > taste, don't care about commit logs, and can't be bothered.
    >
    > The fact that I have higher standards then makes people like you make
    > snarky comments, thinking that you are cool.
    >
    > You're a moron.
    >
    >                 Linus

GFK_of_xmaspast · 11 years ago
Also who's the "Joseph" he's addressing? Unless there are deleted comments, the only snark is coming from a dude named Jaseem.
GFK_of_xmaspast · 11 years ago
"You're a moron."

That's our Linus-kun.

gregkh · 11 years ago
The kernel development model is documented here: http://lxr.free-electrons.com/source/Documentation/developme...

Github doesn't scale at all for large projects. The kernel is averaging over 8 changes an hour, 24 hours a day. That rate of change can never be handled by doing pull requests and web site review. It only can work with email and review and scriptable processes.

steveklabnik · 11 years ago
We merged 473 PRs in Rust last month: https://github.com/rust-lang/rust/pulse/monthly

That's roughly one every other hour, so still not quite on the same level. And we do use tooling _in addition_ to GitHub, but reviews are done in PR and not over email.

(FWIW I personally wish more projects worked like the kernel's, but such is life)

quantumet · 11 years ago
Eh, I mildly disagree on web site review. Perhaps not GitHub's pull request/review model, but big projects like Android and Chromium do all their review on web interfaces.
hamstergene · 11 years ago
Just because one big project relies on emails does not mean they scale better. They work for the kernel because with that strong organization pretty much anything could work for the kernel.

Criticisms in the interview were essentially about low discipline that Github interface allows, and how they were not willing to adapt to the kernel needs, not about fundamental deficiencies of pull request based model.

So far nothing has been said about why pull requests via a website might handle less load than pull requests over email.

wyldfire · 11 years ago
But don't "trusted lieutenants" (yourself included?) mitigate a lot of the challenge posed by that high rate of change?
Touche · 11 years ago
Can you explain what you mean? Why is email more "scalable" than a web interface?
rentnorove · 11 years ago
davexunit · 11 years ago
I was so happy to read this. I completely agree with Linus' criticisms of the pull request system that GitHub has popularized. They've deeply embedded really bad habits into programmers. I used to wonder "Why do some projects still do patch review on a mailing list?" and then I realized it was for the reasons that Linus gave here.
mushly · 11 years ago
So what's the best way to do it instead? And why is the current model so bad?
jammycakes · 11 years ago
One thing worth saying here is that Git is now the dominant player in the source control market. According to almost every survey I've seen, it's overtaken Subversion (according to some reports by a fairly large margin) not only for open source and hobbyists but in the enterprise as well. It's more or less become a lingua franca for communicating source code between teams these days, as well as being the preferred deployment option for many cloud hosting providers and even some package managers. No other source control system has ever managed that.

As such, you simply can't afford not to know it these days. In fact, I can't help thinking that not using Git should now be a major red flag for job candidates and prospective employers alike. Sure, not using your favourite tool may not be that big a deal, but not using what is to all intents and purposes the lingua franca of source code communication is a serious omission.

minusSeven · 11 years ago
Can't agree with this assertion. Your source control of choice should not be in any way a red flag. It just a choice and because of learning curve I choose to learn Mercurial instead. I don't see how source control matters to that extent.

If I need to use it I will learn it then. I don't think most people care as such.

blakeyrat · 11 years ago
As long as you don't expect people to like it.
restalis · 11 years ago
"Why do you think it's been so widely adopted?

Torvalds: I think that many others had been frustrated by all the same issues that made me hate SCM's"

Actually, the adoption was caused by the network effect. It took off with a core group of Linux-involved developers promoting it religiously, then it went on like a fashion (we are git-wielders, we are cool), and ended up being the default choice for a lot of other projects that either depended on some degree on 3rd party git-managed modules, or wanted to benefit from the existing disciplined git-trained developers, or just... because (for all things being equal). Having this presumption that the adopters actually thought for themselves and Torvalds's brain-child got where it is now thanks to its own technical merits is a pleasant thought though.