aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/usrp3/utils/git-hash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usrp3/utils/git-hash.sh')
-rwxr-xr-xfirmware/usrp3/utils/git-hash.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/usrp3/utils/git-hash.sh b/firmware/usrp3/utils/git-hash.sh
new file mode 100755
index 000000000..ff7ae5ecb
--- /dev/null
+++ b/firmware/usrp3/utils/git-hash.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [[ $(command -v git) = "" ]]; then
+ short_hash="FFFFFFFF"
+else
+ if (git diff --quiet); then
+ #Clean
+ short_hash="0$(git rev-parse --verify HEAD --short)"
+ else
+ #Dirty
+ short_hash="F$(git rev-parse --verify HEAD --short)"
+ fi
+fi
+echo ${short_hash^^} \ No newline at end of file