File: get-the-git-commit.sh

package info (click to toggle)
coot 1.1.18%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 219,964 kB
  • sloc: cpp: 495,934; python: 35,043; ansic: 26,143; lisp: 22,768; sh: 13,186; makefile: 2,746; awk: 441; xml: 245; csh: 14
file content (10 lines) | stat: -rwxr-xr-x 199 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10

if command -v git > /dev/null ; then
    if git status > /dev/null 2>&1 ; then
        git rev-parse HEAD
    else
        echo git-commit-unavailable
    fi
else
    echo git-commit-unavailable
fi