summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-08-29 03:03:59 -0400
committerMalf Furious <m@lfurio.us>2017-08-29 03:03:59 -0400
commit52cf1a3c3e8a0830816ed3d8b3648e112d0d97c2 (patch)
tree1ce83b55ab155516798f1a3849f259637bc41905
parent43648695c2448edb926bedce59b7b5a37bc5802e (diff)
downloadsystrunk-52cf1a3c3e8a0830816ed3d8b3648e112d0d97c2.tar.gz
systrunk-52cf1a3c3e8a0830816ed3d8b3648e112d0d97c2.zip
Add tag op
-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"
+}