Bolsters Code-Related Rants (An ongoing collection)

Logging functions being called with just a variable and no comment as to what the hell it is logging has functions more than logging.info, use them! Debug = useful information if something breaks but isn’t interesting during normal operation info = useful and generally interesting information warn = something went wrong, indicating something should probably be refactored / fixed,_ but the system could recover from it._ error = oh dear jesus fuck the entire site evaporated into a swarm of zombie locusts, I better put something in the error log. ...

February 12, 2011 · Andrew Bolster

Mercurial Quick Start Cheatsheet

I hadn’t used Mercurial before so I thought it might be a good idea to leave a reminder for me and anyone else who comes across it… For tidyness, I do all of my dev-stuff (Subversion, Mercurial, CVS, Git etc) under ~/src and only take root privileges when its needed; any good makefile should relocate the necessary files for you at the ‘make install’ or equivalent point. **Update:**This article was picked up by the guys at DevCheatSheet.com and I’m really honoured to be included in a site that I’ve been dipping into over the years, so if you need any kind of cheat sheet or quick reference, I highly recommend checking them out. Anyway… ...

March 13, 2010 · Andrew Bolster

Staggering Unproductivity

I must apologise for my lack of activity on the blog, but more is coming. I’ve begun working towards working with Ian Clarke on his Swarm project, that is if i can bring my Java and Scala chops up to scratch enough to give meaningful impact. Beyond that I’m heading to NJ this week to be with my partner for her graduation and have my 21st birthday while im over there (21 means absolutly squat in Ireland, so I’m expecting a repeat of my 18th…) ...

May 13, 2009 · Andrew Bolster

Git Split Repository With Commit History

Thesis submitted, Viva cleared (with minor corrections) but this post isn’t about all that… Simple one; how do you go from one monolithic project repository to multiple respositories without losing all that tasty tasty commit history? #! /bin/zsh # # git_split.sh Current_Repo username new_repo {list of files/folders you want to keep} # Copyright (C) 2016 bolster <[email protected]> # # Distributed under terms of the MIT license. # BASEDIR=$1 INITDIR=`pwd` NEWREPO="[email protected]:$2/$3.git" shift 3 FILTER_ARGS=$@ TMPDIR=`mktemp -d -t ${BASEDIR}_XXXXXXXXX` echo $BASEDIR $TMPDIR $FILTER_ARGS cp -ra $BASEDIR/. $TMPDIR cd $TMPDIR git filter-branch --index-filter "git rm --cached -qr --ignore-unmatch -- . && git reset -q \$GIT_COMMIT -- $FILTER_ARGS" --prune-empty -- --all && git repack -a -d -f --depth=250 --window=250 && git remote set-url origin $NEWREPO && git gc && git push -u origin master ls -latrh cd $INITDIR rm -rf $TMPDIR YMMV, IANAGG, No refunds, Safety not guaranteed ...

Andrew Bolster