Monday, November 12, 2012

Clone at revision - Git and Mercurial

This is possible in both Git and Mercurial, although one seems a bit more involved.

Git - clone THEN reset or checkout:



( full clone then: git reset --hard 754bda21cbc5c9044daf7f968fb9b4ffae39e334 )

Mercurial - just do it:



( hg clone -r 34dea6ddb0b927dc223c8cdbab4314a3aac355a7 https://bitbucket.org/wrightsolutions/local-bin )

In the screenshot above, I have cloned as described, and then removed the repo and done a full clone.
By doing this I hoped to illustrate the key difference in changeset counts:
  • 'clone at revision' gave 77 changesets with 99 changes to 83 files
  • full clone gave 79 changesets with 101 changes to 84 files
That should satisfy you that the 'clone at revision' really does what it suggests.


Next I give a signature style explanation of the 'clone at revision' command

hg clone -r <sha1> source_repo

Notes and Further Reading:

But, but, but with Git you can just create an empty git and then

git remote add origin https://github.com/jquery/jquery.git
git fetch origin 754bda21cbc5c9044daf7f968fb9b4ffae39e334

Try it and you might just see the Git complaint...
  'fatal: reference is not a tree: 754bda21cbc5c9044daf7f968fb9b4ffae39e334'

Another nicety of Mercurial is that you can use shortened references (just the first 7 characters) and in most cases that will get you what you want.

Seven character abbreviation example:
  hg clone -r 34dea6d https://bitbucket.org/wrightsolutions/local-bin
( rather than the full 40 character reference used in the example above )

Note: Where you have a huge repository like say sagemath which has 100 active committers, then you might want to use the full 40 character reference to be sure of requesting the right revision



There is an excellent Mercurial Hints and Tips page at OpenOffice.org

See hg.sagemath.org for current Sagemath repository.
Most contributions are currently handled by registered lists I think, but if you have taken the time to really understand the code, then there is place for pull requests also.


Wednesday, November 2, 2011

linux is lateral - uk corridor

Linux use in UK companies, clustered on M62 and M4?


Apart from stating the obvious (Central London) where big financial is regularly advertising for Linux, the two corridors stand out.
Between Warrington and Leeds the M62. With a particular focus on Manchester.

The M4 corridor, not that it is news to see this area mentioned for startups.

Cardiff and Bristol - a nice tech cluster going on there either side of the River Severn.


Developments in 2012 and 2013:

The Silicon roundabout and other initiatives should help Linux move further east of Central London. At the moment skills are concentrated in Central London and other parts of London, but not much in East London.

( Middlesex and/or the stretch Left of Central London between M1 and M4, has always traditionally been a tech hotspot also )

The Silicon roundabout will stretch the reach of Linux a little further along that southern corridor, but what about the Midlands and North?

Tech startup success in Warrington, Manchester, and Leeds should spur on the extremes (Liverpool and Hull) to eventually play catch up.

Birmingham is underrepresented, and I will keep watching the news for any development there.


Linux and Tech Startups:

Take the map above and overlay it onto a map of startup clusters. What do you see?

Note: That map at the top is a point in time analysis, and will change month to month, however I suspect the picture will look broadly the same until those initiatives mentioned above take off.