12 lines
254 B
Bash
12 lines
254 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
tag="$(git describe --tags --exact-match 2>/dev/null)"
|
||
|
if [ "$?" -eq 0 ] ; then
|
||
|
echo -n "$tag-"
|
||
|
fi
|
||
|
echo -n "$(git rev-parse --short HEAD)"
|
||
|
if [ -n "$(git status --porcelain --untracked-files=no)" ] ; then
|
||
|
echo -n "-dirty"
|
||
|
fi
|
||
|
echo ""
|