Fix shellcheck warnings
And disable them when necessary. This is all dumb and terrible and I
hate this world and I really really should've used a real programming
language instead of shell why did I do this to myself.
init: use commit instead of commit-tree
init: add .tmignore in initial commit
init: set $TM_DIR before sourcing lib.sh
init: handle init in existing repo
Also create an initial HEAD commit.
Fix handling of ambiguous ref prefixes
Rewrite in POSIX sh
Also don't compress objects and make a few other small changes to the