Fix quoting of '$' for grep
Big coding style shakeup, use Titlecase and lowercase variables
Replace use of printf and echo with a safe variant

Use  cat <<EOF  etc for safe output of all data to pipes (mostly that we
don't know what the shell does with echo and printf).
Use utility functions for testing for equal and null strings

This way we do not show any sensitive data to the [ program.
Use git rev-list --stdin and cat-file --batch-check
Allow pushing into an empty repo using gitception://