summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/git.py')
-rw-r--r--lib/python/qmk/git.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/python/qmk/git.py b/lib/python/qmk/git.py
index 7fa0306f5c..b6c11edbfe 100644
--- a/lib/python/qmk/git.py
+++ b/lib/python/qmk/git.py
@@ -136,3 +136,11 @@ def git_get_ignored_files(check_dir='.'):
if invalid.returncode != 0:
return []
return invalid.stdout.strip().splitlines()
+
+
+def git_get_qmk_hash():
+ output = cli.run(['git', 'rev-parse', '--short', 'HEAD'])
+ if output.returncode != 0:
+ return None
+
+ return output.stdout.strip()