Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Oct 2017 20:18:21 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r324397 - stable/11/sys/conf
Message-ID:  <201710072018.v97KILNe062479@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sat Oct  7 20:18:20 2017
New Revision: 324397
URL: https://svnweb.freebsd.org/changeset/base/324397

Log:
  MFC r323405: newvers.sh: speed up failing git-svn revision search
  
  In the case of running newvers.sh on a git tree w/o git-svn-id notes we
  previously piped the entire 'git log' to grep. Add --grep to the log
  invocation to avoid processing log entries of no interest.
  
  This saves about 2-3 seconds of newvers.sh run time on my SSD laptop.
  Later changes will bring further speedups.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/11/sys/conf/newvers.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/newvers.sh
==============================================================================
--- stable/11/sys/conf/newvers.sh	Sat Oct  7 20:17:03 2017	(r324396)
+++ stable/11/sys/conf/newvers.sh	Sat Oct  7 20:18:20 2017	(r324397)
@@ -218,8 +218,9 @@ if [ -n "$git_cmd" ] ; then
 		svn=" r${svn}"
 		git="=${git}"
 	else
-		svn=`$git_cmd log | grep '^    git-svn-id:' | head -1 | \
-		     sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'`
+		svn=`$git_cmd log --grep '^git-svn-id:' | \
+		    grep '^    git-svn-id:' | head -1 | \
+		    sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'`
 		if [ -z "$svn" ] ; then
 			svn=`$git_cmd log --format='format:%N' | \
 			     grep '^svn ' | head -1 | \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710072018.v97KILNe062479>