From nobody Mon Jan 15 02:24:29 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 4TCwvL13t2z57Ldy; Mon, 15 Jan 2024 02:24:30 +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 4TCwvK6pX4z3xG5; Mon, 15 Jan 2024 02:24:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285470; 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=Hjy0uhVrUh1wagB5XSK0UE1s7g8RkLbTY85xDTlCfg4=; b=WYuT/L4A9pBoxmAHdkG8Izny8TpfqdPfiS/2HxFylpcMiyBNgWVPNfN56+9usSInSFY/iQ Kzu8IhDLjqLWxdYBDpto3eaaHr3evdSrtq8Lstc1RXnYu0YALAr+vNc2n2QAJuO82jF0E7 7RBTyzZK4OAWF6cWAWvf9NxuslGqwO8IvAdZfVDD8x42+8znKIcxTqC3pys5dijLY6/xFX n/06HUUeIJEWy5OxInJyfPrDPfe7cx3k2IgQmqhlvQ4tB6rcV9ujCUtJk/BjZyA+6+AXVg OGPNXUvZSnzyu/z5qN5y3R7w1/gXRSI13bB7gCU/PNmQxY/2wFcATz2VzYLxBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285470; 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=Hjy0uhVrUh1wagB5XSK0UE1s7g8RkLbTY85xDTlCfg4=; b=Y3yXmW/cOCRlWzSVOQzie0XCt06p5Jv+eDMfE04E09SlyeAJ343tOZ+4JV4opXnTBNboyz M6kKbLRLE/bBktwaqh51Aaw7JflyWubJH6+LkEHnJ1pddytNneWjyFTw+rPWuC2YtBnnxL GenjFmSk3Jkohh4BOny4Q1X+1KqBkAxPsaktmUr2q7SJiqlH67jn/dbl1u8jo3+9K2CRtd xYw3dYm0W1kkGv4Lo4HHdECh670dlegyVpJq1yuH9oSE+hYthyx16imjIXd0Vp0rQ24zIw 6ANrgcqndQ7tsOtM9iMyeQOHGtLepXDD+FI2r/COh8QkRqrfqODhcSrAXsOsIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705285470; a=rsa-sha256; cv=none; b=SmpdaNyB4MrKtWzDNET3iRWfF1r6QOaiGDHE5PDtzZdzhOxJFRQqi8lUi3qQfU8vZoJlwo sZBPCAKdGVpiP+THF7JESxZjpOCpHnmImgldOoRJTO2sUJTsSOTgz5FUiiCalCoIqf5KMm TpPEhM0nQ+V5o3fl3hMsoN5JW3klAC+KXVJdsj+e17iSly2aKEUTSATTNnlKKyIHl9Juxv 2l9zd9WUgf8Vcjr9fSUAFFNiAy/Tq6w62qZSA+RUWbLWLjv7XutLmua6ELhBDF411VfM3h V/9+RqTvhX4/n1krkk3HiCaj4tPK+FHwCQi2Qd9CgGzfFiwTVTGCaCPdPvALUg== 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 4TCwvK5pt3zdk3; Mon, 15 Jan 2024 02:24:29 +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 40F2OT3Q093582; Mon, 15 Jan 2024 02:24:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40F2OT8A093579; Mon, 15 Jan 2024 02:24:29 GMT (envelope-from git) Date: Mon, 15 Jan 2024 02:24:29 GMT Message-Id: <202401150224.40F2OT8A093579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9f48ef1fcae5 - main - git-arc: Cope with extra output 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f48ef1fcae58fe8aa41da4cc59cc93136fe70dd Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f48ef1fcae58fe8aa41da4cc59cc93136fe70dd commit 9f48ef1fcae58fe8aa41da4cc59cc93136fe70dd Author: Warner Losh AuthorDate: 2024-01-15 02:22:49 +0000 Commit: Warner Losh CommitDate: 2024-01-15 02:23:45 +0000 git-arc: Cope with extra output On my machine, for reasons beyond my understanding, I get this warning two times when running arc: Warning: Module "openssl" is already loaded in Unknown on line 0 so grep -v ^Warning: on all the arc call-conduit calls to filter them out so we can properly parse the JSON with jq. Sponsored by: Netflix Reviewed by: markj, jhb Differential Revision: https://reviews.freebsd.org/D36583 --- tools/tools/git/git-arc.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index a207899d5fbe..f88cf4b01102 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -142,6 +142,17 @@ __EOF__ exit 1 } +# +# Filter the output of call-conduit to remove the warnings that are generated +# for some installations where openssl module is mysteriously installed twice so +# a warning is generated. It's likely a local config error, but we should work +# in the face of that. +# +arc_call_conduit() +{ + arc call-conduit "$@" | grep -v '^Warning: ' +} + # # Filter the output of arc list to remove the warnings as above, as well as any # stray escape sequences that are in the list (it interferes with the parsing) @@ -161,7 +172,7 @@ diff2phid() fi echo '{"names":["'"$diff"'"]}' | - arc call-conduit -- phid.lookup | + arc_call_conduit -- phid.lookup | jq -r "select(.response != []) | .response.${diff}.phid" } @@ -176,7 +187,7 @@ diff2status() tmp=$(mktemp) echo '{"names":["'"$diff"'"]}' | - arc call-conduit -- phid.lookup > "$tmp" + arc_call_conduit -- phid.lookup > "$tmp" status=$(jq -r "select(.response != []) | .response.${diff}.status" < "$tmp") summary=$(jq -r "select(.response != []) | .response.${diff}.fullName" < "$tmp") @@ -280,7 +291,7 @@ create_one_review() "value": ["'"${parentphid}"'"] } ]}' | - arc call-conduit -- differential.revision.edit >&3 + arc_call_conduit -- differential.revision.edit >&3 fi rm -f "$msg" return 0 @@ -298,13 +309,13 @@ diff2reviewers() "constraints": {"phids": ["'"$reviewid"'"]}, "attachments": {"reviewers": true} }' | - arc call-conduit -- differential.revision.search | + arc_call_conduit -- differential.revision.search | jq '.response.data[0].attachments.reviewers.reviewers[] | select(.status == "accepted").reviewerPHID') if [ -n "$userids" ]; then echo '{ "constraints": {"phids": ['"$(echo -n "$userids" | tr '[:space:]' ',')"']} }' | - arc call-conduit -- user.search | + arc_call_conduit -- user.search | jq -r '.response.data[].fields.username' fi }