aboutsummaryrefslogtreecommitdiff
path: root/brep/submit/submit-git.in
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-08-22 16:53:12 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-08-22 16:55:38 +0300
commit8b72bd7e42181fde2a02e0d1d382d17dda184199 (patch)
tree018f42a5aa2804c9dc3d7b7e59187f1e2371f6cb /brep/submit/submit-git.in
parent6dff80b189a649f64a885a553ceefe1055cdb21e (diff)
Add support for --commiter-* options in submit-git handler
Diffstat (limited to 'brep/submit/submit-git.in')
-rw-r--r--brep/submit/submit-git.in39
1 files changed, 38 insertions, 1 deletions
diff --git a/brep/submit/submit-git.in b/brep/submit/submit-git.in
index 2f90217..badc084 100644
--- a/brep/submit/submit-git.in
+++ b/brep/submit/submit-git.in
@@ -183,6 +183,35 @@ set -o errtrace # Trap ERR in functions.
@import brep/submit/submit@
@import brep/submit/submit-git@
+# Parse the command line options.
+#
+committer_name="Submission Handler"
+committer_email="noreply@example.com"
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ --committer-name)
+ shift
+ committer_name="$1"
+ shift
+ ;;
+ --committer-email)
+ shift
+ committer_email="$1"
+ shift
+ ;;
+ *)
+ break; # The end of options is encountered.
+ ;;
+ esac
+done
+
+if [ -z "$committer_name" -o -z "$committer_email" ]; then
+ error "$usage"
+fi
+
+# Parse the command line arguments.
+#
if [ "$#" -lt 2 -o "$#" -gt 3 ]; then
error "$usage"
fi
@@ -566,7 +595,15 @@ for i in {1..11}; do
git_add "$tgt_dir" "${a#$tgt_dir/}"
- run git -C "$tgt_dir" commit $gqo $gvo -F - <<EOF >&2
+ if [ -n "$email" ]; then
+ e="$email"
+ else
+ e="$committer_email"
+ fi
+
+ GIT_AUTHOR_EMAIL="$e" \
+ run git -c "user.name=$committer_name" -c "user.email=$committer_email" \
+-C "$tgt_dir" commit $gqo $gvo -F - <<EOF >&2
Add $name/$version to $s/$project
$(cat "$data_dir/request.manifest")