From owner-svn-src-all@freebsd.org Fri Jan 4 18:38:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A066F143513E; Fri, 4 Jan 2019 18:38:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4589B75DB0; Fri, 4 Jan 2019 18:38:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 336D14B44; Fri, 4 Jan 2019 18:38:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04IcSni074419; Fri, 4 Jan 2019 18:38:28 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IcSXf074418; Fri, 4 Jan 2019 18:38:28 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201901041838.x04IcSXf074418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 4 Jan 2019 18:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342774 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4589B75DB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 18:38:29 -0000 Author: gallatin Date: Fri Jan 4 18:38:27 2019 New Revision: 342774 URL: https://svnweb.freebsd.org/changeset/base/342774 Log: Limit git history searches in newvers.sh newvers.sh takes upwards of 4-5 seconds to complete on trees checked out from github, due to searching the entire history for non-existent git-svn metadata. Similarly, if one does not check out notes, we again search the entire history for notes. That makes newvers.sh very slow for many github users. To fix this in a fair way, limit the history search to the last 10K commits: if you're more than 10K commits out of sync, then you've forked the project, and our SVN rev is no longer very important to you. Due to how git implements --grep in conjunction with -n, --grep has been removed for performance reasons (git does not seem to limit its search to the -n limit in this case, and takes just as long as it did with no limit). Reviewed by: emaste, imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18745 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 18:35:25 2019 (r342773) +++ head/sys/conf/newvers.sh Fri Jan 4 18:38:27 2019 (r342774) @@ -243,11 +243,15 @@ if [ -n "$git_cmd" ] ; then svn=" r${gitsvn}" git="=${git}" else - gitsvn=`$git_cmd log --grep '^git-svn-id:' | \ +# Log searches are limited to 10k commits to speed up failures. +# We assume that if a tree is more than 10k commits out-of-sync +# with FreeBSD, it has forked the the OS and the SVN rev no +# longer matters. + gitsvn=`$git_cmd log -n 10000 | grep '^ git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` if [ -z "$gitsvn" ] ; then - gitsvn=`$git_cmd log --format='format:%N' | \ + gitsvn=`$git_cmd log -n 10000 --format='format:%N' | \ grep '^svn ' | head -1 | \ sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` fi