How many lines of code have survived to the current day from the original Linux kernel

Here is a excellent Quora question: how many lines of code, if any, from Linux 1.0 are still in the modern Linux kernel, and what is it?  And an evenly excellent answer:

According to git diff, 21228 of the 176250 lines from Linux 1.0 (1994-03-14) are still present in Linux 3.12 (2013-11-03):

$ empty_tree="$(git mktree < /dev/null)"
$ git diff --shortstat "$empty_tree" 1.0
561 files changed, 176250 insertions(+)
$ git diff --shortstat -M -l99999 1.0 v3.12
44905 files changed, 17702349 insertions(+), 155022 deletions(-)

Over half of these lines are blank or consist entirely of punctuation; only 10419 of them have at least one letter or number.

We can go back even farther to the very first public release, Linux 0.01 (1991-09-17). Of the 10239 lines in Linux 0.01, 954 survive in Linux 3.12, of which just 242 have at least one letter or number. 123 of them were structs and constants in include/a.out.h (now include/uapi/linux/a.out.h), and 26 of them were the S_* macros in include/sys/stat.h (now include/uapi/linux/stat.h). The rest were scattered through 24 other files with at most 9 lines each.

It might appear that not much.   But it is in fact impressive.  How much code have you written that survived for over 20 years in a project that has changed so much – from a hobby experiment to a dominant operating system across servers, mobiles, and embedded devices?

Global .gitignore

gitignore is a very handy tool for ignoring unnecessary files in the project.   Most large projects have .gitignore file included.  Most small projects would benefit from one too.  However, working as a developer on a variety of projects, it’s often difficult to add your own rules to all .gitignore files around.  And that’s exactly what I wanted.

I’m using Vim editor for all my coding needs, and I wanted to add Vim swap file and backup file to all .gitignore files.  That sounded like annoying, so instead I looked around for a global gitignore solution.  As always, StackOverflow has an answer for everything.  There is a way to disable extra files in Vim, but there is an even better way to have your own global .gitignore.  Here is how to do it:

  1. Edit .gitconfig file in your home folder, and add excludesfile=~/.gitignore line to the core section.
  2. Create .gitignore file in your home folder with whatever rules you desire.

Once that is done, all your projects will ignore the files matching the rules.  If you are not sure which rules to start with, borrow one of the gitignore files from this GitHub project.

GitHub adds Releases

By now you know that I can’t praise GitHub enough.  It is one of the best tools for developers ever.  Seriously.  It’s up there with git itself, and even Vim.  If you aren’t using it yet, stop whatever it is you are doing and rush there.  Now. I’m not kidding.

So, anyways.  Today GitHub added another awesome feature – Releases.  These are basically git tags on steroids.

GitHub releases

 

I’ve been already playing around with the idea of releases for our work projects. See, for example, phing-version branch of my sandbox repository.  It worked, but it’s not perfect.  With GitHub Releases however I’ll have pretty much everything I need – release notes, easy full diff reviews, binary attachments, etc.

A little side note for binary attachments: I mostly work with PHP, which doesn’t really need binary attachments.  But I am a part of other, “heavier” projects, developed in C++ for example.  This feature will come in handy.  Also, as far as PHP goes, I was playing with the idea of using RPM and YUM as a mechanism for managing installation, upgrade, and downgrade process.

Back to GitHub Releases now.  This is an excellent example of why you should use GitHub instead of setting up your own environment.  You’ll waste more time and money.  It will be ugly.  And you’ll have to maintain it.  With GitHub you’ll focus on your actual development work and will get excited every now and then when they add a new feature.

Phabricator – code review, browser, bug tracker, and wiki

Phabricator – code review, browser, bug tracker, and wiki

Phabricator is an open source collection of web applications which makes it easier to scale software companies.

For those people who can’t afford GitHub, this should be a pretty good alternative.  Developed at Facebook.  All you’ll need to do is setup your git repositories.

P.S.: The best product descriptions ever (for parts of the Phabricator).

GitHub : new look

GitHub blog announced a new look and navigation for the programmers’ best friend.  Have a look at some of the screenshots, say “WOW!” and rush back to your repositories, looking for the magic “Enable Repository Next” button.

GitHub : new look

 

This being a big change and GitHub being such a crucial daily tool for so many people, the changes will be rolled out slowly.  So you might need a bit of luck or time to see it right now.  Gladly, my repositories do have the feature, and once switched to, they do look better.  Navigation is simpler indeed, but will need a little getting used to, as I have it in the muscle memory by now.  I also like a tiny bit of more color added, as the white and lightly not white were slightly disorienting after long coding and merging hours.

To the GitHub team: thank you guys, you are awesome! Please keep doing what you are doing – it’s obviously working.