From nobody Tue Sep 06 19:08:28 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MMZfh6QKYz4bT5Q; Tue, 6 Sep 2022 19:08:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MMZfh5zqQz3cZP; Tue, 6 Sep 2022 19:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662491308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SNqxq+iLGMmciTiwfNWbuSJvUD/ZiEk+LcI0In9hJto=; b=MxhD3Q98+yDQIfMDVidHdyf83JImi8FiHOiGwzJhD7M2sYdf9WzOD/sZAi2GDr8lfflnLJ bKXhR1dlARHSgVQhvbsCYWJC56ATNhFHf9afiA/OPICUWlffRQwie4H1n1cVOtECMR7M06 nVz0EMoXA8Co+9lofkFUW0hlV0RHQ18+X89yu5f7bJHRwe+hsfTodl9KnE9SkWcVzCM6OB Wc4klqbO7emRDGR70COQc9rhvv1XjEYvbIRw3UD+wNGQI73O/7R+AGJcDRqE/qWAez2YoP O0AEWz74NbSBkYDXuDjhI1Cs5NJO5b9I8cNin56ctIE+QYVyEdgl7/DLyonyRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MMZfh52qSzGvl; Tue, 6 Sep 2022 19:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 286J8SDx009687; Tue, 6 Sep 2022 19:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 286J8SUo009686; Tue, 6 Sep 2022 19:08:28 GMT (envelope-from git) Date: Tue, 6 Sep 2022 19:08:28 GMT Message-Id: <202209061908.286J8SUo009686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 50a6ae407596 - stable/12 - newvers.sh: Speed up git_tree_modified List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 50a6ae40759607424052ca70ad0bf246c3ed6087 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662491308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SNqxq+iLGMmciTiwfNWbuSJvUD/ZiEk+LcI0In9hJto=; b=te6u9wBodtQtQJQcfJ2PXejdjY6GRJLCmsGXILI7J4MigRT2XbePDB8zGVKsS1iMysQc4f KhLyiTO0JAnW4kgzuRnI5+FfIFpSmNb2V0TNeAfi6hEIj0xJxRjZu6erzoeAwLq0jFyU+d 4I7FpkeOrQS+5iHAKMOWTriLI9ZJPUOUOes1bI+sd68sG7o+Kg7UsPFhc41XbiOgG+WzuI jEIt9JRvdWLofzKhGcSzKpM2BBIX8DApvLmAL9A6qANbLPsQ8qs1cI2TtKqTPYYLAKNihJ AnGINBVV8Q04VsQao9PI4RttOemXT4FNZYRsQ1VHC4ykDt7CM9oEN0zFaOWSpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662491308; a=rsa-sha256; cv=none; b=ZdWaja24Imoy1fmOrUwVi1plKWv8sSP/CbYOM+IHyfIvmKK+WqT0bO7IKPDN5NNKDTW2+S R4ZIZidfLUlg72KulduiPehx4PavgPvtvauYYFSq01yDb5JOfGDNxHwiH/4ehEaSmmADQE dG77c99jbIrgj7ZlUtKXWH/EKxMEjudVNmv2pIlfI54Aj1b8CMIBYGzKlGJP2pyXeh5BUg PWYf5UKgE8FKhKtmKHMEWxyEp5gnS8zOyTpoHw/PZfoQydcgCEjMXOKC4oGURZ3rah0rQR BLCqsp9AFf0kJfljhEW6AoaG+TB6z40M85LbOqMnjliBeG0Q7Yve4rcrwqL/5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=50a6ae40759607424052ca70ad0bf246c3ed6087 commit 50a6ae40759607424052ca70ad0bf246c3ed6087 Author: Brooks Davis AuthorDate: 2020-12-17 00:00:21 +0000 Commit: Ed Maste CommitDate: 2022-09-06 17:25:49 +0000 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 PR: 252028 (cherry picked from commit 17eba5e32a2cf7a217bb9f1e5dcca351f2b71cfc) --- sys/conf/newvers.sh | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e1aa29f8d98d..18ada43e0cbc 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -81,29 +81,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 - $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 }