cd ~

Track Code History With Qi

qi uses git to tell you how your code is evolving.

For a toy example, here’s the disk usage growth of the Linux source starting from the time on HEAD.

[sage linux]$ qi --every year --past "12 years" -c "du -sh ."
2.8G . # 2017 (time of writing)
2.7G . # 2016
2.6G . # 2015
2.6G . # 2014
2.5G . # 2013
2.5G . # 2012
2.4G . # 2011
2.4G . # 2010
2.4G . # 2009
2.3G . # 2008
2.2G . # 2007
2.2G . # 2006
2.2G . # 2005

Here’s a monthly complexity report of the React source.

qi --every month --past "3 years" --command "./analyze.sh"
#!/bin/bash

# analyze.sh

TIME=$(git show -s --format=%ct HEAD)

# Using https://www.npmjs.com/package/complexity-report
cr -e -f json ./src > $(git show -s --format=%ct HEAD).json

qi is handy for evidence-gathering when you know an engineering strategy isn’t working well for a team.