Permalink
Browse files

tools: Cosmetic changes to pull-upstream.

  • Loading branch information...
littleguy77 committed May 31, 2015
1 parent 767afcf commit 6ff8c0ee4f8478bf44e62063572aabf9910b0406
Showing with 7 additions and 7 deletions.
  1. +7 −7 tools/pull-upstream.sh
View
@@ -43,23 +43,23 @@ echo
echo "Type the name of the upstream organization/user you wish to pull from."
echo "[${DEFAULT_ORG}]"
read ORG
if [ "$ORG" = "" ];then
if [ "$ORG" = "" ]; then
ORG=$DEFAULT_ORG
fi
echo
echo "Type the name of the upstream branch you wish you pull from."
echo "[${DEFAULT_BRANCH}]"
read BRANCH
if [ "$BRANCH" = "" ];then
if [ "$BRANCH" = "" ]; then
BRANCH=$DEFAULT_BRANCH
fi
echo
echo "Type the name of the upstream revision you wish you pull from."
echo "[${DEFAULT_REV}]"
read REV
if [ "$REV" = "" ];then
if [ "$REV" = "" ]; then
REV=$DEFAULT_REV
fi
@@ -72,15 +72,15 @@ for i in $COMPONENTS; do
MSG_PREFIX="${i}: Update to commit "
DIFF=`git diff ${DEST_DIR}`
if [ "$DIFF" != "" ];then
if [ "$DIFF" != "" ]; then
echo
echo "Working directory is not clean. Please commit, stash, or reset your changes."
echo "Aborted"
exit
fi
OLD_SYNC_HASH=`git log -1 --grep="${MSG_PREFIX}[0-9a-fA-F]\{7\}" --pretty=format:"%s" | sed -e 's/.*\([0-9a-fA-F]\{7\}\).*/\1/'`
if [ "$OLD_SYNC_HASH" = "" ];then
if [ "$OLD_SYNC_HASH" = "" ]; then
echo
echo "This script has not yet been used to pull from ${BASE_URL}."
echo "Please enter the hash of the last upstream commit that was pulled."
@@ -123,13 +123,13 @@ for i in $COMPONENTS; do
DIFF=`git diff ${DEST_DIR}`
DO_COMMIT="y"
if [ "$NEW_MSG_BODY" = "" -a "$DIFF" = "" ];then
if [ "$NEW_MSG_BODY" = "" -a "$DIFF" = "" ]; then
echo
echo "No upstream changes to pull. Continue? [N/y]"
read DO_COMMIT
fi
if [ "$DO_COMMIT" = "y" -o "$DO_COMMIT" = "Y" ];then
if [ "$DO_COMMIT" = "y" -o "$DO_COMMIT" = "Y" ]; then
git commit "${DEST_DIR}/." --allow-empty --message="${NEW_MSG_SUBJECT}" --message="" --message="${NEW_MSG_LINK}" --message="" --message="${NEW_MSG_BODY}"
fi
done

0 comments on commit 6ff8c0e

Please sign in to comment.