From nobody Thu Aug 01 16:07:18 2024 X-Original-To: dev-commits-src-all@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 4WZYkt4cTWz5T074; Thu, 01 Aug 2024 16:07:18 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYkt3pJFz4bPY; Thu, 1 Aug 2024 16:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528438; 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=KQvoWa++mP4pxho0lsth7x2SuiLmdrlo1or05j2qTmw=; b=YBCURWTJj8MF54m01cjq6bWbERpvV91t+2qTu5qYI+gtKHuVbGYZxsxYbt8tH193/PUBLj 1WFLzfVuOuE1jge1eMxBuJEh9aQ+mde0UhXUOKNu3ZFnbyJNqQINxGe156QGG7ezOF0FDz ZDY+OSbmsszYMJ/l6wBhB0E51jvFQvUQOqAu2mMybZCGx5h+7gIgna0TGCpEFCr1mBV0F9 2k7VyOrqlT89JVPU4FdZoCcFQOdMw05rxCXHvfz01KHBda2aNmgkuS2mLeOIGaJbb76rcF HOVSP0mqKSgV1osOSigD05Hdl7wK0PkFd3mnsOR3+dD1Xm2h/IwODpnPr0Zw0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528438; a=rsa-sha256; cv=none; b=O05cnquS4Eb2AG9CfhqyWv2BY+Ld606yYOgZiquwhI7Cx5UixMeHt5Kx5FiGsjv9TCEwLG OXoiR9IyhqWw26XDCupzm0a2bYS4ZPnpimCkwfvwW+Ygxnmn8JMNtkwd61aekcYej9hZBW c///bn+3ApCNci5slpjCiVc/Hplk0RlG6Ji9Hsc9m7cIqMjvhj3Dyg5LnQA0BzlNRIBj9t dl3x9Ddl4ajNDKl+xgTopVVyNWyd0JilyfqNd0QITJny2fcAFWE2dfG3B9SqUD7Uc8Vas+ AGmNUCS5nMvYrG7vMQnCU4Vm/UAw8WvtDN70/Ur1EjgOOkbjA3N1kRnPXHv7Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528438; 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=KQvoWa++mP4pxho0lsth7x2SuiLmdrlo1or05j2qTmw=; b=HZQCq+Kv1HN25cjDmPC/pe6E+1Zgvhmj6qm27obpXaLQhUbvCtuCB+jhPvORXIgvcf1JuH ChON1mR/atdiG1NrQnRof5gIF+Cf+RPMWzIrtzoTSMgQdSv1RWlPibA6VW7iqazMlmwFqI SutgtRxEhRFD3jYIN+npuwSVh+N6OdUW6ToHEDbKXRrf08DIR2So7E3znidjLzsGvkwee2 UrBQPeqeZ+AbI7FRNZkxpIs2K94zH+1J8gY3DGe/Y2H5fxqxeQSZ843z5PEsHsJ0vOATkA zgxw6jrhPzfQQfcoJmjjBuyTqYus3U5U8LvmqRtSOCPRpcpKKJ83eeeOemTlKw== 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 4WZYkt3Pb3zrm5; Thu, 1 Aug 2024 16:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471G7IdS078929; Thu, 1 Aug 2024 16:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471G7Ina078926; Thu, 1 Aug 2024 16:07:18 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:07:18 GMT Message-Id: <202408011607.471G7Ina078926@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: 311f95ce3d41 - stable/14 - mfc-candidates: move pretty printing into lua List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: 311f95ce3d4111eff1a6242be55adf52283b3e5e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=311f95ce3d4111eff1a6242be55adf52283b3e5e commit 311f95ce3d4111eff1a6242be55adf52283b3e5e Author: Ed Maste AuthorDate: 2024-04-16 16:49:05 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 mfc-candidates: move pretty printing into lua d51c59002367 moved the MFC hash matching logic into a lua utility script but left the output formatting in the shell script. Simplify this slightly by just printing the formatted output from lua. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44836 (cherry picked from commit 793745fad866f65863ab3b16a17bdf18dc779efd) --- tools/tools/git/candidatematch.lua | 10 +++++++++- tools/tools/git/mfc-candidates.sh | 7 +------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/tools/git/candidatematch.lua b/tools/tools/git/candidatematch.lua index 98c247fca339..481c1f38fea1 100755 --- a/tools/tools/git/candidatematch.lua +++ b/tools/tools/git/candidatematch.lua @@ -36,6 +36,14 @@ local function set_difference(set1, set2) return result end +-- Execute a command and print to stdout +local function exec_command(command) + local handle = io.popen(command) + local output = handle:read("a") + handle:close() + io.write(output) +end + -- Main function local function main() local from_file = arg[1] @@ -59,7 +67,7 @@ local function main() -- Print the result for _, hash in ipairs(result_hashes) do - print(hash) + exec_command("git show --pretty='%h %s' --no-patch " .. hash) end end diff --git a/tools/tools/git/mfc-candidates.sh b/tools/tools/git/mfc-candidates.sh index dd88710a4a4a..bc1ad602cb1c 100644 --- a/tools/tools/git/mfc-candidates.sh +++ b/tools/tools/git/mfc-candidates.sh @@ -149,7 +149,6 @@ canonicalize_hashes() workdir=$(mktemp -d /tmp/find-mfc.XXXXXXXXXX) from_list=$workdir/commits-from to_list=$workdir/commits-to -candidate_list=$workdir/candidates if [ -n "$exclude_file" ]; then exclude_list=$workdir/commits-exclude @@ -160,10 +159,6 @@ commits_from "$@" > $from_list commits_to "$@" > $to_list /usr/libexec/flua $(dirname $0)/candidatematch.lua \ - $from_list $to_list $exclude_list > $candidate_list - -while read hash; do - git show --pretty='%h %s' --no-patch $hash -done < $candidate_list + $from_list $to_list $exclude_list rm -rf "$workdir"