1
0

contrib: detect builds with uncommitted changes

The `--dirty` flag causes `git describe` to append
`-dirty` to the version string it outputs. This is
useful to detect if a build was - intentionally or
not - created with uncommitted changes.

https://git-scm.com/docs/git-describe#git-describe---dirtyltmarkgt
This commit is contained in:
Filip Gospodinov
2018-04-13 08:14:39 +02:00
committed by Johann Bauer
parent ab2d38a803
commit 6cf334244a
3 changed files with 4 additions and 3 deletions

View File

@@ -186,7 +186,8 @@ class Exception_Window(QWidget, MessageBoxMixin):
@staticmethod
def get_git_version():
dir = os.path.dirname(os.path.realpath(sys.argv[0]))
version = subprocess.check_output(['git', 'describe', '--always'], cwd=dir)
version = subprocess.check_output(
['git', 'describe', '--always', '--dirty'], cwd=dir)
return str(version, "utf8").strip()