summaryrefslogtreecommitdiffstats
path: root/repo-mutate.sh
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-08-27 23:51:18 -0400
committerMalf Furious <m@lfurio.us>2017-08-27 23:51:18 -0400
commit51ab1973315de06d71064b9fe6e2cc97ee4d3768 (patch)
treec3eb8e37cc01c7791f23ec2186bef33fcf371af4 /repo-mutate.sh
parent6eb5c49964d0c5d4bbaa4391112db1ee0e5a15c2 (diff)
downloadsystrunk-51ab1973315de06d71064b9fe6e2cc97ee4d3768.tar.gz
systrunk-51ab1973315de06d71064b9fe6e2cc97ee4d3768.zip
Update function systr_repo_finish_commit
Moved logic for reading author information into this function
Diffstat (limited to 'repo-mutate.sh')
-rw-r--r--repo-mutate.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/repo-mutate.sh b/repo-mutate.sh
index d88452e..0f76316 100644
--- a/repo-mutate.sh
+++ b/repo-mutate.sh
@@ -23,7 +23,7 @@ function systr_repo_create_commit
}
##
-# systr_repo_finish_commit <commit> <parent> <author> <email> [<merge>]
+# systr_repo_finish_commit <commit> <parent> [<merge>]
#
# Finish writing a commit by adding meta-data to the commit directory.
# The commit mesasge is taken from the file <commit>.mesg at the root
@@ -33,22 +33,32 @@ function systr_repo_create_commit
##
function systr_repo_finish_commit
{
- if [ $# -lt 4 ]; then
+ if [ $# -lt 2 ]; then
echo "Fatal: too few arguments to systr_repo_finish_commit"
exit 1
fi
commit="$1"
parent="$2"
- author="$3"
- email="$4"
- if [ $# -gt 4 ]; then
- merge="$5"
+ if [ $# -gt 2 ]; then
+ merge="$3"
else
merge=""
fi
+ if [ -f ".systr/author" ]; then
+ read author <.systr/author
+ else
+ author="Anonymous"
+ fi
+
+ if [ -f ".systr/email" ]; then
+ read email <.systr/email
+ else
+ email="<anon>"
+ fi
+
if [[ "$remote" == "" ]]; then
(
cd "$path"