svn commit: r323405 - head/sys/conf

Ed Maste emaste at FreeBSD.org
Mon Sep 11 00:14:05 UTC 2017


Author: emaste
Date: Mon Sep 11 00:14:04 2017
New Revision: 323405
URL: https://svnweb.freebsd.org/changeset/base/323405

Log:
  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.
  
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Sun Sep 10 23:48:20 2017	(r323404)
+++ head/sys/conf/newvers.sh	Mon Sep 11 00:14:04 2017	(r323405)
@@ -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 | \


More information about the svn-src-all mailing list