diff options
author | Ed Maste <emaste@FreeBSD.org> | 2017-09-11 00:14:04 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2017-09-11 00:14:04 +0000 |
commit | 3ac77a91511c195b42d7449625fafb1943870cf1 (patch) | |
tree | f8528b3884c272980cface44bf2b316fc5f2c4b7 /sys/conf | |
parent | 42439531c87576d46230331bfb717818ba7c9aa8 (diff) | |
download | src-3ac77a91511c195b42d7449625fafb1943870cf1.tar.gz src-3ac77a91511c195b42d7449625fafb1943870cf1.zip |
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
Notes
Notes:
svn path=/head/; revision=323405
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/newvers.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 4cd2b7f86030..d23c88162705 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -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 | \ |