From nobody Sun Apr 21 14:11:48 2024 X-Original-To: dev-commits-src-main@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 4VMr0j2BTFz5H3T1; Sun, 21 Apr 2024 14:11:49 +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 4VMr0j0Fdkz49Wk; Sun, 21 Apr 2024 14:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713708709; 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=aIY/AKDrAyGiGjGbSbvCJeIa+F5ykUls3JEoMZSqo0E=; b=LEm/S5jpdK4/vNfJAgfprJ5rSpEeR/rKL1W5BT1oXtHO2U4LkzymU3tPs6bNEDibiZrwhc THTnxBeFV5JerPm4eETc8YDzR2t439FHD3sGB6H2iHkrBbbKyuRKk+LRzp4Sii21sd+J8b jNKlncfczSILGXW7RE2gZeWJj1ggOXHL/iujyln92Qz1geZ1THwcRcWPMe73PFJXViE8wD q4rga3mDyBwNiXgIXSOvGinTsVIWgpJV9r1FzD+sOejmBYyYprJdj1Eos7eFO+q3Pvs4aN G4pykWW1hQwQ5owaAW7jA58iE+bLoVl24zwrpX9YriOYlkIz8q8Un3A8qphCrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713708709; a=rsa-sha256; cv=none; b=eBK0l0yB6HPVn2AbmtK3nu+RgJVaP7UjFRSeUmaXN91pme8Ql892gRoeDeRKXX3dZAeFrn 0Eo/HMps2Ns0DN9rglerIG1NkrHLZVOT9aO2IQcmskKk2O7zm8auldXjC+5Q8DX+cOknpV rlnJcNqIaf/SWl4uAbmAqFcol85WjkqvESBLUx9p2NL7ntlpvl7sCQMIAr8gNdztdgVrZY HUEwurObtAtDiYlHfAyOoFJ+0uFtVR3ia+fdx2e2WkGnanlZsZ92Tbz4mhEv9mOi1IFgFo GE23C5U57cFXQFNc4tro2DPy8J2yF68+GCxeNYDz1y8PjVlWNsFH0p87/XFG1g== 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=1713708709; 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=aIY/AKDrAyGiGjGbSbvCJeIa+F5ykUls3JEoMZSqo0E=; b=M29f9+6Z7lj8TSb0rrK95aourlvX4i0Rp4Oc7jqtXNhrRHUoNMm5XIEIAB1YJFOOImn1UE NrJdex2Z47RoJFo3uM1YdGuJNjy46Os87YyIpAwMecxkvM+GGSG8U2EbF4NQBM74s+iTle LZMvPYHyOAovpjBX5HVqSscdVc/FksE2VHwS/94m/RHGc0rRVt4Cpw4RGc7RwQrx5JhcW+ 328vz4VmfGUrvcs0RD3hXvCIyXT002n8SO9nwS9r7TLzKutEoTCTpMiFlRbrBPN/RAG1Sz bof6AQP8V0UHj3PhO7wKB0MI4JVN9bDr61V47SmtIX9PJ5nalbUSzWwK0udxdg== 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 4VMr0h6xMqz1N5y; Sun, 21 Apr 2024 14:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43LEBmqO033877; Sun, 21 Apr 2024 14:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43LEBm7U033874; Sun, 21 Apr 2024 14:11:48 GMT (envelope-from git) Date: Sun, 21 Apr 2024 14:11:48 GMT Message-Id: <202404211411.43LEBm7U033874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 793745fad866 - main - mfc-candidates: move pretty printing into lua List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 793745fad866f65863ab3b16a17bdf18dc779efd Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=793745fad866f65863ab3b16a17bdf18dc779efd commit 793745fad866f65863ab3b16a17bdf18dc779efd Author: Ed Maste AuthorDate: 2024-04-16 16:49:05 +0000 Commit: Ed Maste CommitDate: 2024-04-21 14:10:57 +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 --- 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 0787e1278991..cf71c314cb95 100644 --- a/tools/tools/git/mfc-candidates.sh +++ b/tools/tools/git/mfc-candidates.sh @@ -152,7 +152,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 @@ -163,10 +162,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"