Track Code History With Qi

Last updated:
Message of the Day

I designed this website with no ads or invasive tracking so that you find useful content quickly, easily, and with due respect for your privacy.

However, this makes me dependent on readers for funding. Ads and tracking are everywhere because most people do not pay for content and ignore messages like this one. Please support this website, and the products it brings you.

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 suspect your team is not working as efficiently as they could be.