Volans has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322362

Change subject: Puppet merge: molly-guard multiple commits
......................................................................

Puppet merge: molly-guard multiple commits

Change-Id: I9dff5a172b62c20dca85d8a59a03cbc890996343
---
M modules/puppetmaster/templates/puppet-merge.erb
1 file changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/62/322362/1

diff --git a/modules/puppetmaster/templates/puppet-merge.erb 
b/modules/puppetmaster/templates/puppet-merge.erb
index 0a853f7..303c378 100755
--- a/modules/puppetmaster/templates/puppet-merge.erb
+++ b/modules/puppetmaster/templates/puppet-merge.erb
@@ -126,18 +126,27 @@
     git log HEAD..${fetch_head_sha1} --format="${MAGENTA}%cn${RESET}: %s (%h)"
 fi
 ncommiters=$(git log HEAD..${fetch_head_sha1} --format=%ce | sort -u | grep -v 
'[email protected]' | wc -l)
+
+expect="yes"
 if [ $ncommiters -ne 1 ]; then
     echo "${RED}WARNING${RESET}: Revision range includes commits from multiple 
committers!"
+    expect="multiple"
 fi
 
+confirmed=0
 if [ $FORCE -eq 1 ]; then
-    answer="yes"
+    confirmed=1
 else
-    echo -n "Merge these changes? (yes/no)? "
+    echo -n "Merge these changes? (${expect}/no)? "
     read answer
+    if [ "x${answer}" = "x${expect}" ]; then
+        confirmed=1
+    elif [ "x${expect}" = "xyes" ] && [ "x${answer}" = "xy" ]; then
+        confirmed=1
+    fi
 fi
 
-if [ "x${answer}" = "xyes" ] || [ "x${answer}" = "xy" ]; then
+if [ "${confirmed}" -eq "1" ]; then
     echo "Merging ${fetch_head_sha1}..."
     cmd="git merge --ff-only ${fetch_head_sha1}"
     echo "${cmd}"

-- 
To view, visit https://gerrit.wikimedia.org/r/322362
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9dff5a172b62c20dca85d8a59a03cbc890996343
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Volans <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to