summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.sh2
-rw-r--r--repo-mutate.sh17
2 files changed, 19 insertions, 0 deletions
diff --git a/main.sh b/main.sh
index cfec2f5..d34f962 100644
--- a/main.sh
+++ b/main.sh
@@ -34,6 +34,8 @@ function main
systr_status "$@"
elif [[ "$cmd" == "commit" ]]; then
systr_commit "$@"
+ elif [[ "$cmd" == "tag" ]]; then
+ systr_repo_tag "$@"
else
echo "Fatal: $1 not recognized"
fi
diff --git a/repo-mutate.sh b/repo-mutate.sh
index e35424f..f2f90dd 100644
--- a/repo-mutate.sh
+++ b/repo-mutate.sh
@@ -123,3 +123,20 @@ function systr_repo_set_reference
ssh "$remote" "systrunk set-ref \"$symref\" \"$commit\""
fi
}
+
+##
+# systr_repo_tag <name>
+#
+# Tag the current commit. This creates a new branch which references
+# BASE.
+##
+function systr_repo_tag
+{
+ if [ $# -lt 1 ]; then
+ echo "Fatal: too few arguments to systr_repo_tag"
+ exit 1
+ fi
+
+ name="$1"
+ systr_repo_set_reference "$name" "$BASE"
+}