From owner-svn-src-head@freebsd.org Thu Dec 17 00:00:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA0524CA025; Thu, 17 Dec 2020 00:00:21 +0000 (UTC) (envelope-from brooks@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4CxBvn4Tdmz4YRQ; Thu, 17 Dec 2020 00:00:21 +0000 (UTC) (envelope-from brooks@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 8C4E96CF6; Thu, 17 Dec 2020 00:00:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0BH00LkA027588; Thu, 17 Dec 2020 00:00:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0BH00L3v027587; Thu, 17 Dec 2020 00:00:21 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202012170000.0BH00L3v027587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 17 Dec 2020 00:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368709 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 368709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2020 00:00:21 -0000 Author: brooks Date: Thu Dec 17 00:00:21 2020 New Revision: 368709 URL: https://svnweb.freebsd.org/changeset/base/368709 Log: newvers.sh: Speed up git_tree_modified We're looking for file content differences, so ask the question of git more directly. This helps a lot, saving tens of thousands of fork()s, when the builder and editor see different stat() results (e.g., UIDs), as they might with containers. Submitted by: Nathaniel Wesley Filardo Reviewed by: bdrewery, emaste, imp Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27646 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Wed Dec 16 22:25:40 2020 (r368708) +++ head/sys/conf/newvers.sh Thu Dec 17 00:00:21 2020 (r368709) @@ -162,29 +162,7 @@ findvcs() git_tree_modified() { - # git diff-index lists both files that are known to have changes as - # well as those with metadata that does not match what is recorded in - # git's internal state. The latter case is indicated by an all-zero - # destination file hash. - - local fifo - - fifo=$(mktemp -u) - mkfifo -m 600 $fifo || exit 1 - $git_cmd --work-tree=${VCSTOP} diff-index HEAD > $fifo & - while read smode dmode ssha dsha status file; do - if ! expr $dsha : '^00*$' >/dev/null; then - rm $fifo - return 0 - fi - if ! $git_cmd --work-tree=${VCSTOP} diff --quiet -- "${file}"; then - rm $fifo - return 0 - fi - done < $fifo - # No files with content differences. - rm $fifo - return 1 + $git_cmd "--work-tree=${VCSTOP}" -c core.checkStat=minimal -c core.fileMode=off diff --quiet } LC_ALL=C; export LC_ALL