Log dirty files

old-commit-hash: d64025cca4
commatwo_master
Nigel Armstrong 6 years ago
parent 0469c872ec
commit 241d542eba
  1. 11
      selfdrive/version.py

@ -1,5 +1,7 @@
import os
import subprocess
from selfdrive.swaglog import cloudlog
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "common", "version.h")) as _versionf:
version = _versionf.read().split('"')[1]
@ -12,9 +14,18 @@ try:
branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip()
branch = 'origin/' + branch
dirty = subprocess.call(["git", "diff-index", "--quiet", branch, "--"]) != 0
if dirty:
dirty_files = subprocess.check_output(["git", "diff-index", "--name-only", branch, "--"])
commit = subprocess.check_output(["git", "rev-parse", "--verify", "HEAD"]).rstrip()
origin_commit = subprocess.check_output(["git", "rev-parse", "--verify", branch]).rstrip()
cloudlog.event("dirty comma branch", vesion=version, dirty=dirty, origin=origin, branch=branch, dirty_files=dirty_files, commit=commit, origin_commit=origin_commit)
else:
dirty = True
except subprocess.CalledProcessError:
try:
cloudlog.exception("git subprocess failed while finding version")
except:
pass
dirty = True
# put this here

Loading…
Cancel
Save