Commit 2d92df5d authored by Tristan Gingold's avatar Tristan Gingold

gen_buildinfo.py: add comments.

parent b7b7485b
...@@ -3,11 +3,16 @@ ...@@ -3,11 +3,16 @@
with open("buildinfo_pkg.vhd", "w") as f: with open("buildinfo_pkg.vhd", "w") as f:
import subprocess import subprocess
import time import time
# Extract current commit id.
try: try:
commitid = subprocess.check_output( commitid = subprocess.check_output(
["git", "log", "-1", "--format=%H"]).decode().strip() ["git", "log", "-1", "--format=%H"]).decode().strip()
except: except:
commitid = "unknown" commitid = "unknown"
# Extract current tag + dirty indicator.
# It is not sure if the definition of dirty is stable across all git versions.
try: try:
tag = subprocess.check_output( tag = subprocess.check_output(
["git", "describe", "--dirty", "--always"]).decode().strip() ["git", "describe", "--dirty", "--always"]).decode().strip()
...@@ -18,6 +23,7 @@ with open("buildinfo_pkg.vhd", "w") as f: ...@@ -18,6 +23,7 @@ with open("buildinfo_pkg.vhd", "w") as f:
except: except:
tag = 'unknown' tag = 'unknown'
dirty = "-??" dirty = "-??"
try: try:
userid = subprocess.check_output( userid = subprocess.check_output(
["git", "config", "--get", "user.name"]).decode().strip() ["git", "config", "--get", "user.name"]).decode().strip()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment