diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2024-03-14 08:26:58 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2024-03-14 08:26:58 +0100 |
commit | 6b377719c10d5ab3343fd5221f99a4a21008e25a (patch) | |
tree | a7c1e9a820d339a2f161af3e09cf9e3161286796 /lib/tools/git_head.sh |
Initial commitmain
Diffstat (limited to 'lib/tools/git_head.sh')
-rwxr-xr-x | lib/tools/git_head.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/tools/git_head.sh b/lib/tools/git_head.sh new file mode 100755 index 0000000..bfa738a --- /dev/null +++ b/lib/tools/git_head.sh @@ -0,0 +1,11 @@ +#! /bin/sh +# Include the git hash in an OCaml file. + +git diff-index --quiet HEAD -- +if [ $? -ne 0 ]; then + revision=": untracked" +else + revision=$(git rev-parse --short HEAD) +fi +compile_date=$(date +%Y/%m/%d) +echo "let revision = \"${revision} - compiled on ${compile_date}\"" |