I am trying to build a set of git utilities with python.  I am using subprocess.Popen to run the git binary.  Right now I am just trying to find the best way to determine that there was an error in running a git command.
My question is whether or not git will always return a returncode of 0 on a successful git command and always return a returncode of non-zero on a unsuccessful call?  I just want to make sure that checking the returncode is a safe way to detect an error so that I can exit the script if a git command was unsuccessful.
Yes, git (and any well-behaved *nix program) will always return 0 for success and non-zero for failure.  This is the paradigm on GNU/Linux systems, and since Git was made by the same person who made Linux, you can bet it follows the convention.
Calling Git Binary From Python And Error Codes