summaryrefslogtreecommitdiff
path: root/csv-revision
diff options
context:
space:
mode:
Diffstat (limited to 'csv-revision')
-rwxr-xr-xcsv-revision10
1 files changed, 10 insertions, 0 deletions
diff --git a/csv-revision b/csv-revision
new file mode 100755
index 0000000..289c133
--- /dev/null
+++ b/csv-revision
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+git describe --first-parent --tags 2>/dev/null | (
+ IFS=- read tag rev hash
+ if [ $? ] && [ -n "$rev" ]; then
+ echo .$rev.$hash
+ elif [ -d .git ]; then
+ echo .0.gsnapshot
+ fi
+)