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:
committed by
Johann Bauer
parent
ab2d38a803
commit
6cf334244a
@@ -12,7 +12,7 @@ src_dir=$(dirname "$0")
|
|||||||
cd $src_dir/../..
|
cd $src_dir/../..
|
||||||
|
|
||||||
export PYTHONHASHSEED=22
|
export PYTHONHASHSEED=22
|
||||||
VERSION=`git describe --tags`
|
VERSION=`git describe --tags --dirty`
|
||||||
|
|
||||||
info "Installing Python $PYTHON_VERSION"
|
info "Installing Python $PYTHON_VERSION"
|
||||||
export PATH="~/.pyenv/bin:~/.pyenv/shims:~/Library/Python/3.6/bin:$PATH"
|
export PATH="~/.pyenv/bin:~/.pyenv/shims:~/Library/Python/3.6/bin:$PATH"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ if [ ! -z "$1" ]; then
|
|||||||
git checkout $1
|
git checkout $1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=`git describe --tags`
|
VERSION=`git describe --tags --dirty`
|
||||||
echo "Last commit: $VERSION"
|
echo "Last commit: $VERSION"
|
||||||
find -exec touch -d '2000-11-11T11:11:11+00:00' {} +
|
find -exec touch -d '2000-11-11T11:11:11+00:00' {} +
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ class Exception_Window(QWidget, MessageBoxMixin):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_git_version():
|
def get_git_version():
|
||||||
dir = os.path.dirname(os.path.realpath(sys.argv[0]))
|
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()
|
return str(version, "utf8").strip()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user