From 2c30892457e76c8648d4fb40aa6497548b853b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Thu, 2 Feb 2017 04:41:06 +0100 Subject: [PATCH] More descriptive logging --- balkian_pre_commit/branchversion.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/balkian_pre_commit/branchversion.py b/balkian_pre_commit/branchversion.py index 5380050..8b0cdbe 100644 --- a/balkian_pre_commit/branchversion.py +++ b/balkian_pre_commit/branchversion.py @@ -15,11 +15,16 @@ def main(argv=None): prevcontent = check_output(['git', 'show', 'HEAD:{}'.format(fn)]).strip().decode() current = semver.parse_version_info(currentcontent) print('Checking versions: {} -> {}'.format(prevcontent, currentcontent)) - if (branch_name == 'master' and current.prerelease) or\ - (semver.compare(currentcontent, prevcontent)<1): + if branch_name == 'master' and current.prerelease: + print('Trying to push a pre-release version to a master branch') + return 1 + elif semver.compare(currentcontent, prevcontent)<1: + print('The new version should be newer than the old one') return 1 else: error = 0 + if error: + print('VERSION files should be bumped in every commit') return error if __name__ == '__main__':