The logic for re.match() , sys.exit(1) does not make sense, plus why can't i use return True if the re.match regex matches
You seem confused about sys.exit is doing. It exits your program. You function verify_commit_text never exits. Your code after calling verify_commit_text is never executed. The program always hits a sys.exit in verify_commit_text and terminates. The first thing you need to do is eliminate all the sys.exit() except in the __main__ section. You should really only have sys.exit in there.