From nobody Mon Jan 15 02:24:28 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 4TCwvK0NWtz57Lms; Mon, 15 Jan 2024 02:24:29 +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 4TCwvJ5sv2z3x2D; Mon, 15 Jan 2024 02:24:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285468; 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=w6Gj5ZuPWrjrTIGgBPusMnMF79Vzi0kyOME3HP1ZAbs=; b=yZTN03Yayv6bqs/AJxdtLoJuYY6BS4NW22B7Ey7GWsjh2dt1UGVZXDL3nVULJAmLBcDn97 S+5PCewZBZ+TdkQFsyIYYC4PiaNua3tp78OpCdQtPAAto4K0R7ukCkyO93DWZSbCu1V0fl 5RN42DfI0U4v+V6oupnTDNtjABG/5qir7NlEC5eFW7vZWqb7ztKZUp4YsY/CknqKZUeK3/ Kd789zFFaspzPrkaw70RefaJwJYZvCgE1TCC4Xg0wy//+6TNyu/zhTgNxOTFBaQKZA3/TW UB3i2uWYUS98KCDArDls/mSsU/vt3DMEl8pJP+WXWrElcZCVL2Ir0qZxtBLxNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285468; 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=w6Gj5ZuPWrjrTIGgBPusMnMF79Vzi0kyOME3HP1ZAbs=; b=ZGxQYM9R7o+UPGenRjH3SWCqZ2MOWbXOQLLF+MAiuwqpklsgrR2/cSaZ6LYtjaL+iArYJh 0DyFRXSmP9mVS9StmY6L+T27YRlbZrKVZ2pwXPzHt5km1kJrV+YN2RJ1klRnKH9y+zJ94E VnMYbgOUBHWxSptDOTEIkLEiEPs/dZ9tuI1xWumPfthgPPaoFsdeOwXLp3OgbGrnls28co XG7dg+roHiFfkX/cNDXvnwG09zZEsVLU+f822DX/sG9T3nvSc1U2Z7PZW7C5Io5p6bPUVy e4T5Ik8oX+xsUksJ6LgfGWbJnTScnhiUjntSfEhHClBPSWNSUHr34VCvpenPwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705285468; a=rsa-sha256; cv=none; b=Jl6Qejp9oUlHnczAH6G0qEb9IivEfyvh5w+WpP3cSke9DjNiwk3a14dODc/34NYhQw9PS6 M0Q7HRS0HVe+A2BGs/eHG5y6oLltBHb6YQMWZAQ8FBKbFTZp3WuYKfOF03W3TqSqgxyR3D c3m6VO4gKO2SD+os+AHQ4od3j5QjnUhEfGt0bC5ZAXwbg/G5rFKVwjS187FO8Y5yWiUWUg uSkqlXmsYzD5/ONelCLET2x3hkMdeISxF/jrMykwSynRhMfLtoTlMVi0ncHPwu8jViDakt ROXPI2Tx5+vkGXgzbChKpJGhtp/KZ4QDn5p01rQVfs9ImxhFdm9MWGtpi0EVFQ== 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 4TCwvJ4q25zfNq; Mon, 15 Jan 2024 02:24:28 +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 40F2OSZu093540; Mon, 15 Jan 2024 02:24:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40F2OSBS093537; Mon, 15 Jan 2024 02:24:28 GMT (envelope-from git) Date: Mon, 15 Jan 2024 02:24:28 GMT Message-Id: <202401150224.40F2OSBS093537@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: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log 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: df834e06bbc78c03cb6b35f074ae43673c9ce463 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=df834e06bbc78c03cb6b35f074ae43673c9ce463 commit df834e06bbc78c03cb6b35f074ae43673c9ce463 Author: Warner Losh AuthorDate: 2024-01-15 02:22:04 +0000 Commit: Warner Losh CommitDate: 2024-01-15 02:23:45 +0000 git-arc: Just strip escape sequences form arc log Just strip escape sequences and Warning: lines from 'arc list' output. I upgraded and they changed and git arc list broke. This restores its functionality. Note: jhb didn't like this, so if others object, I'll fix... Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D36553 --- tools/tools/git/git-arc.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index d06d6be3d41e..a207899d5fbe 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -142,6 +142,15 @@ __EOF__ exit 1 } +# +# 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) +# +arc_list() +{ + arc list "$@" | sed 's/\x1b\[[0-9;]*m//g' | grep -v '^Warning: ' +} + diff2phid() { local diff @@ -194,8 +203,7 @@ title2diff() local title title=$(echo $1 | sed 's/"/\\"/g') - # arc list output always includes ANSI escape sequences, strip them. - arc list | sed 's/\x1b\[[0-9;]*m//g' | \ + arc_list | awk -F': ' '{ if (substr($0, index($0, FS) + length(FS)) == "'"$title"'") { print substr($1, match($1, "D[1-9][0-9]*")) @@ -406,7 +414,7 @@ gitarc__list() local chash commit commits diff openrevs title commits=$(build_commit_list "$@") - openrevs=$(arc list) + openrevs=$(arc_list) for commit in $commits; do chash=$(git show -s --format='%C(auto)%h' "$commit") @@ -422,7 +430,7 @@ gitarc__list() # differently and keep the entire status. title=$(git show -s --format=%s "$commit") diff=$(echo "$openrevs" | \ - awk -F'D[1-9][0-9]*:\.\\[m ' \ + awk -F'D[1-9][0-9]*: ' \ '{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}') if [ -z "$diff" ]; then echo "No Review : $title"