github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/scripts/generate-git-info.sh (about)

     1  #!/bin/sh
     2  
     3  set -e
     4  
     5  echo "GIT_TAG=\"$(git describe --tags --abbrev=0 --match 'v*' 2> /dev/null || echo v0.0.0)\""
     6  echo "GIT_SHA=\"$( (git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1)\""
     7  echo "GIT_DIRTY=\"$(echo $(git diff --no-ext-diff 2> /dev/null | wc -l))\""
     8  
     9  echo "PHPSPY_GIT_SHA=\"$(cat Makefile | grep ^PHPSPY_VERSION | cut -d ' ' -f 3)\""