add --print-git-output, bash cleanup
clean up variable declaration, scope, and handling
clean up GIT_TRACE output handling