summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-04-18 19:11:52 -0700
committerMichael Forney <mforney@mforney.org>2016-04-23 16:51:19 -0700
commitb63a2d5a69837da3ea59cbc451b4e152582ef2b5 (patch)
treeca9aebce80bc950255000fe0955497393875f832 /scripts
parent32df789b099a8d6c34b423cd7b3ff892aaaddd4f (diff)
Add commit script to generate commit history
This will make it easier for users to merge changes into their trees.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/commit.rc18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/commit.rc b/scripts/commit.rc
new file mode 100644
index 00000000..21789d72
--- /dev/null
+++ b/scripts/commit.rc
@@ -0,0 +1,18 @@
+#!/bin/rc
+
+flag e +
+
+repo=$1
+branch=$2
+tag=$3
+
+fn checkstatus {}
+
+cd $repo
+
+if([ -f refs/heads/$branch ]) parent=(-p $branch)
+if not parent=()
+
+ifs=() { message='oasis built by '`{id -un | head -c -1} }
+commit=`{echo $message | git commit-tree $tag $parent} ; checkstatus
+git update-ref refs/heads/$branch $commit