Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/108180
Change subject: Add updateSubmodule.sh script ...................................................................... Add updateSubmodule.sh script Generates a commit that updates the VE core submodule to master (or a specified version) Change-Id: I54c5fa18e9f9d7bb65a490415c5c139fd6072925 --- A bin/updateSubmodule.sh 1 file changed, 58 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/80/108180/1 diff --git a/bin/updateSubmodule.sh b/bin/updateSubmodule.sh new file mode 100755 index 0000000..550dcb7 --- /dev/null +++ b/bin/updateSubmodule.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# This script generates a commit that updates the lib/ve submodule +# ./bin/updateSubmodule.sh updates to master +# ./bin/updateSubmodule.sh hash updates to specified hash + +# cd to the VisualEditor directory +cd $(cd $(dirname $0)/..; pwd) + +# Check that both working directories are clean +if git status -uno --ignore-submodules | grep -i changes > /dev/null +then + echo >&2 "Working directory must be clean" + exit 1 +fi +cd lib/ve +if git status -uno --ignore-submodules | grep -i changes > /dev/null +then + echo >&2 "lib/ve working directory must be clean" + exit 1 +fi +cd ../.. + +# Figure out what to set the submodule to +if [ "x$1" != "x" ] +then + TARGET="$1" + TARGETDESC="$1" +else + TARGET=origin/master + TARGETDESC=master +fi + +git fetch +# Create sync-repos branch if needed and reset it to master +git checkout -B sync-repos origin/master +git submodule update +cd lib/ve +git fetch +# Generate commit summary +NEWCHANGES=$(git log ..$TARGET --oneline --no-merges | tac) +COMMITMSG=$(cat <<END +Update VE core submodule to $TARGETDESC + +New changes: +$NEWCHANGES +END +) +# Check out master of VE core +git checkout $TARGET + +# Commit +cd ../.. +git commit lib/ve -m "$COMMITMSG" +cat >&2 <<END +Created commit with changes: +$NEWCHANGES +END \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/108180 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54c5fa18e9f9d7bb65a490415c5c139fd6072925 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Catrope <roan.katt...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits