Archive for the ‘Code’ Category

Code Hosting quick-start guide

Friday, August 7th, 2009

If you want to host code on Launchpad, and you need some help, you can turn to IRC, the launchpad-users mailing list or the Code Hosting section on the help wiki.

If all you want, though, is to get up and running with hosting your project’s code on Launchpad, there’s now a quick-start guide. It leaves out any detail that might distract from simply getting you started.

So, here’s the question: does it do the job? If not, what should be put in or left out?

Git imports

Wednesday, July 8th, 2009

As you might have heard already, Launchpad can now import code from Git repositories. You can then create Bazaar branches of those Git repos.

For example:

bzr branch lp:git

Thanks to Jelmer for bzr-git and Michael & Paul for tying it into our rock-solid import system.

Sparklines!

Thursday, May 28th, 2009

Sparkline showing commit activity to bzr trunkI like neat little tricks that make it easier to take in a wedge of information. Martin Albisetti‘s addition to a project branch overview pages is just one of those.

Now, the trunk branch of a project has a visual representation of its activity over the past 90 days. You’ve probably seen similar mini-graphs elsewhere, particularly if you’re a fan of the work of Edward Tufte who names them “sparklines”.

At a glance you get a feel for how many commits the branch has been getting, the distribution of its commits and when its busiest day was during that period.

Take a look at the Bazaar project’s code page for an example, or watch this short video.

Ogg Theora version

Git branch imports now in public beta

Tuesday, May 26th, 2009

Launchpad is all about bringing free software activity together in one place: it gives you one page to view the same bug as it is tracked in multiple places, you can hold discussions with other people using mailing lists and you can import code from around the web ready to use in a Bazaar branch.

Kiko calls it the great source code supermarket. Using Launchpad and Bazaar, you can access the code and version control history of projects who host their Bazaar branches or Subversion and CVS repositories pretty much anywhere on the net.

This month, we’ve added Git branches.

Try it out, tell us how you get on

Now Launchpad can import a project’s Git branch, using Bazaar’s bzr-git plugin, into a Bazaar branch hosted on Launchpad. We’re considering this as a public beta so we really want to know how you get on. Either post here or join us on the launchpad-users list.

There’s one significant limitation in this public beta: it won’t yet import Linux kernel branches. Jelmer, who has done much of the work on bzr-git, explains:

“As part of the Git network protocol Bazaar has to inform the Git server of the checksums of the Git revisions it already has, so the server doesn’t send it the full repository each time. To calculate these SHA1s Bazaar
has to bit-for-bit reconstruct the original Git revisions from the revisions that have been imported into Bazaar earlier.

The first versions of git did not normalize file modes, and this in some situations led to file modes that can not be represented in Bazaar. This makes it impossible to recalculate the checksum of the original revision from the data in Bazaar.”

You get the Git branch’s version history and it works just like any other Bazaar branch. Launchpad then regularly pulls the latest version of the Git branch into the Bazaar branch.

For now, Launchpad will import master Git branches only. We’re looking at ways of importing non-master branches.

Request an import and let us know how you get on.

Faster branch pushing

Thursday, October 16th, 2008

You can now push your branches to Launchpad much more quickly. That’s because Launchpad now supports stacked branches: Bazaar branches that have only a little bit of their history.

By pushing up a stacked branch to Launchpad, you push up only that little bit, rather than the full history of your project. For the code that we Launchpad developers work on – i.e. Launchpad itself – it now takes less than two minutes to push up a branch. It used to take an hour and a half.

Upgrade to Bazaar 1.7 or better

To start using stacked branches, you need to upgrade everything to Bazaar format 1.6. Upgrade your trunk, all of your branches, your local shared repositories — everything. To do this you’ll need Bazaar 1.7 or better. You can get this from the Bazaar website or from the Bazaar PPA.

Set your development focus

You’ll also need to set a development focus for your project. The development focus is the mainline branch, often called “trunk” or “devel”. You want to set it to a branch that people want to branch from a lot. If your project doesn’t have a development focus yet, there’ll be a prominent link to set it on the Code tab for that project.

Push your branch just like before and whooosh!

OK. You’ve got a dev focus and all your branches are in the new Bazaar format. All you need to do now to make a stacked branch is:

bzr push lp:~foo/bar/baz

That is, you just push the way you always do and then watch the speed.

What happens is that Launchpad hints to Bazaar that new branches should be stacked on the development focus. Bazaar follows that hint and stacks the new branch appropriately. It then only sends up the revisions that are in the new branch but not in trunk.

This is why you want to set your development focus to a branch that’s going to be branched from and merged to a lot: the time it takes to push up a new branch is proportional to how different that branch is from your development focus.

A lot of work has gone into this feature (particular thanks to Michael Hudson and basically all of the Bazaar core devs), I hope you enjoy it!

Karma for code reviews

Wednesday, September 17th, 2008

The guys in the Launchpad-Bazaar integration team added code review to Launchpad earlier this year.

Now, when you take part in a code review it’ll count towards your Launchpad karma!

If you’re new to code review, take a look at my previous post.

Karma for commits!

Wednesday, August 20th, 2008

While in some parts they take their pay in Warcraft gold, round here we’re karma fiends!

To feed the habit, Tim in Launchpad’s Code Hosting team has provided another way of earning karma: making commits to any Bazaar branch that’s registered to a project in Launchpad.

We’re backdating the karma for commits but, as with all karma the older the action is the less it’ll count towards your karma score; really old actions don’t count at all. Also, +junk branches don’t count towards karma at all.