From ffd7f52a4010924779b14ab494bbdcaa1b844a8a Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Mon, 19 Aug 2024 16:23:44 -0500 Subject: [PATCH] hdl: added git information to build output --- hdl/quartus/build_bladerf.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hdl/quartus/build_bladerf.sh b/hdl/quartus/build_bladerf.sh index 583900a4..a1e9e742 100755 --- a/hdl/quartus/build_bladerf.sh +++ b/hdl/quartus/build_bladerf.sh @@ -462,6 +462,18 @@ if [[ ${flow} == "full" ]]; then sha256sum $RBF > $RBF.sha256sum MD5SUM=$(cat $RBF.md5sum | awk '{ print $1 }') SHA256SUM=$(cat $RBF.sha256sum | awk '{ print $1 }') + + GIT_HASH=$(git rev-parse --short HEAD) + GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + GIT_DIRTY=$(git diff --quiet && echo "clean" || echo "dirty") + + cat << EOF > git_info.txt +Git Information: +Commit Hash: $GIT_HASH +Branch: $GIT_BRANCH +Working Directory: $GIT_DIRTY +EOF + popd echo "" @@ -473,6 +485,10 @@ if [[ ${flow} == "full" ]]; then echo " MD5: $MD5SUM" echo " SHA256: $SHA256SUM" echo "" + echo " Git Information:" + echo " Commit: $GIT_HASH ($GIT_DIRTY)" + echo " Branch: $GIT_BRANCH" + echo "" cat "$BUILD_OUTPUT_DIR/$BUILD_NAME.fit.summary" | sed -e 's/^\(.\)/ \1/g' echo "##########################################################################" fi