Saturday, March 07, 2009

Where'd you git that?

(Some names have been changed to suggest subversion)

I use at least 5 distinct logins on the LAN at work
  • a.murphy (one laptop and many servers)
  • builder (a few (virtual) servers)
  • tracker (one server)
  • root (on build and tracker servers, where I am root)
  • root (on many test servers, where I'm just visiting)
And on the home LAN there are three more
  • a.murphy (one laptop)
  • development (a few servers)
  • IT guy (including expensive OSs)
I would dearly love that ll worked the same way on all of them. And that it worked my way on all of them, namely
alias ll='ls -laht --color'
Of course "--color" might not be available on some machines, so some variations are allowed.

I would especially like to take my ll with me into guest accounts, such as the roots on the corporate test servers, being careful not to interfere with other users' definitions and aliases.

I'd also like to propogate changes across machines, so that, if builder wants to re-define ll then builder's ll is available no matter what machine he is logged in to. And there should be an easy way for another user to adapt builder's new definition of ll, and have that propogate across all machines too.

There are various solutions available for this problem, but they tend to miss the sweet spot on scale - they cater for a user on two machines, or billions of users on trillions of machines (I exaggerate slightly for exmphasis), whereas I want to make my like easy with a few users on a few servers.

A propos of nothing in particular
The greatest missed opportunity in Computer Science is the introduction of the Troll numeric system for programming languages. The Troll system uses
  • one
  • two
  • many
  • lots
and it'd be interesting to adapt current alogorithms to that, But I'm mumbling again't I ?

Oh - and it should work on any system using bash (including on OS X, where they live just far enough over the edge to make one careful. "/User" instead of "/home" - little gotchas like that.)

I have been using a system for this over the last month.
  1. Subversion server, on the corporate LAN
  2. Holds file each for aliases, functions, environment, prompt and bashrc
  3. Subdirectories for vim, my/python/site, and like that
Works better in this incarnation because I have not tried to version ~/.bashrc. Rather I just source my stuff thence. Even with a group of accounts as close as mine are - there are still reasons why there's more than one, and each account needs it own private time too.

The four files (aliases, functions, prompt and environment) have stayed remarkably clean. There is some
if [[ $HOST == "..." ]]
left, but mostly because I checked out the same devlopment sources to different directories on different servers.

Since I started using this system the number of aliases and functions I write has exploded. Because they are more carefully written to work in different contexts, and because it is now so easy to transfer them between terminals ("scj" in one, "upj" in another, done), I write more of them.

I chose a centralised, Subversion, repository because
  • I maintain such repositories, so it was set up in 5 minutes
  • Who's to notice one more repository on the company's server ?
  • Their server is backed up to Aero-Industry standards (mine isn't)
But a central repository is not right for this system, it's too restrictive. When making changes at home having to commit changes to the company's server in order to send it from upstairs to the kitchen adds a brake, clutch, change, clutch, accelerate, when I thought I was driving automatic.

It's not network speed - a commit is tens of bytes - it's more the teenage rebel in me
  • What's so special about that account?
  • How come he gets to sit on the server?
  • He'll go and resign, then we're fucked

And, yes, it is immature, but I only indulge my Id when I'm right.
It's an inherently distributed system, and git or Mercurial would be better.

git is scary. I could not get it working on enough machines
  • OSX - easy
  • CentOS - peasy
  • Mandriva - poisson
but the scary thing is the ability to rewrite your history. Which is just not any kind of repository I recognize.

Mercurial is Python from the ground up - I shall follow the shiny path.

Labels: , , , , , , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home