minor cleanup on gittex
factored out a selectFor to use in hooks
bugfix: pass back nulls if there is no prevSha
switch gittex's dependence on gitteh to 0.17.1