summaryrefslogtreecommitdiff
path: root/util/board_status/getrevision.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/board_status/getrevision.sh')
-rwxr-xr-xutil/board_status/getrevision.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/board_status/getrevision.sh b/util/board_status/getrevision.sh
index c8c126a5ee..0a6b6c6923 100755
--- a/util/board_status/getrevision.sh
+++ b/util/board_status/getrevision.sh
@@ -121,6 +121,20 @@ local_revision() {
echo "${r}"
}
+# Similar to local_revision but uses "git describe" instead of "git log" which
+# includes number of commits since most recent tag.
+tagged_revision() {
+ local r
+
+ if git_is_file_tracked "$1" ; then
+ r=$(git describe --tags --dirty)
+ else
+ return ${EXIT_FAILURE}
+ fi
+
+ echo "${r}"
+}
+
upstream_revision() {
local r=
@@ -143,6 +157,8 @@ Commands
local revision information including an indicator for uncommitted changes
-u or --upstream
upstream revision
+ -T or --tags
+ similar to -l, but uses \"git describe\" to obtain revision info with tags
-U or --url
URL associated with the latest commit
-d or --date
@@ -175,6 +191,10 @@ main() {
check_action $1
action=local_revision
shift;;
+ -T|--tags)
+ check_action $1
+ action=tagged_revision
+ shift;;
-u|--upstream)
check_action $1
action=upstream_revision