monero/contrib/shell/git-utils.bash

15 lines
285 B
Bash
Raw Normal View History

2023-07-02 15:00:24 -04:00
#!/usr/bin/env bash
git_root() {
git rev-parse --show-toplevel 2> /dev/null
}
git_head_version() {
local recent_tag
if recent_tag="$(git describe --exact-match HEAD 2> /dev/null)"; then
echo "${recent_tag}"
else
git rev-parse --short=12 HEAD
fi
}