diff --git a/git_review/cmd.py b/git_review/cmd.py index 15b04700..aeeecca3 100644 --- a/git_review/cmd.py +++ b/git_review/cmd.py @@ -75,7 +75,7 @@ class colors(object): class GitReviewException(Exception): - EXIT_CODE = 127 + EXIT_CODE = 1 class CommandFailed(GitReviewException): @@ -1704,7 +1704,7 @@ def main(): _main() except GitReviewException as e: print(e) - sys.exit(getattr(e, 'EXIT_CODE', -1)) + sys.exit(e.EXIT_CODE) if __name__ == "__main__": diff --git a/releasenotes/notes/fix-exit-code-5ab7f6314976319f.yaml b/releasenotes/notes/fix-exit-code-5ab7f6314976319f.yaml new file mode 100644 index 00000000..73657d65 --- /dev/null +++ b/releasenotes/notes/fix-exit-code-5ab7f6314976319f.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes ``gitreview`` process exit code to align with general + UNIX process exit code conventions. Specifically, default exit + code changed to ``1`` which stands for "general error".