litex/misoclib/identifier/git.py

6 lines
141 B
Python

import subprocess
def get_id():
output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii")
return int(output[:8], 16)