diff --git a/build_tools/make_version b/build_tools/make_version
index ad9fb3f92427e0e192fb0db2a881b985c834ee14..83c42d1fba3b6bc2a2c78d301b39136b535bbb9f 100755
--- a/build_tools/make_version
+++ b/build_tools/make_version
@@ -98,7 +98,7 @@ elif [ -d ${1}/.git ]; then
     # If the first log commit messages indicates that this is checked into
     # subversion, we'll just use the SVN- form of the revision.
     MODIFIED=""
-    SVN_REV=`${GIT} log --pretty=full -1 | ${GREP} -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
+    SVN_REV=`${GIT} log --pretty=full -1 | sed -n '/git-svn-id:/ s/.*\@\([^ ]*\) .*/\1/p'`
     if [ -z "$SVN_REV" ]; then
         MAINLINE_BRANCH=$(git config -f .gitreview --get gerrit.defaultbranch)
         VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`