From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25717 invoked from network); 8 Dec 2022 22:07:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Dec 2022 22:07:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670537231; b=Zgp95AI7lNHsspW//D1+vfekCRQLz7MA88XNm2mKu7H/t0649kIiB/fBOdKpE+b7S4pTou8eS/ LUlI7KH7OCfTp0Gl5y3k2TZ9REorc+yiNILNUvSxs86hx0KIbz9ljiL8A22bSel4CVyAwUfPMg ovzlOF4QGNNMPdJydUbyK12KGH5ZVNRiIWCan1wTM6CwO5nHoRzULYHA+80tca1sS22yH5IRnR 6JAEidaZ4UkXRYUyXWfAXdg6zeeYsPG0As5gfAdnJ/29wfpEqctT0wDPLbtLro9K4StIbBYmz+ tNM6ewq/+gOs19SkZmbTbQNrCoYPh9XfS9wuIGg03BXwWQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1670537231; bh=UVen/gWyIoKJiD4t8qOzhUb5gDIekkwx4EFMM5NbTNs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=oINhO3St6bw3D5NRZ7hS5f+Cv/jye9NndAK7a0+et9D7Rtu57jYGQRg0TsW2uGJYgyAwfDJXax 82nne/XiyvYDo3Bsv9JyoQipvoUyQjSGVXHnYt5L//4CSGP2TScAN96se9qjR94AZH+DjPme63 MlVmBzVYU/1DQ8IpHcF4lna3RNGuUxEFSafbwzGNk3iM5yY6/22+o0dKAYWqryeuy37uurOc0+ PUGWdL6dcrZxNDiGJ3809T96JRl1tZL3eW7KbgXeRdrs1uvDzV2WzeokhBCCzoMWt+fJ+XaWoq R0tkSRCkE7W2wHSwrcvIh4Fb02PvWxJxwz5NVcgO/YVS6w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=YTpq+oVD4/reQ6152+Y3fMhWT7a+3e6j7WXOagQlZIw=; b=mSgDIkHN1ZPtulY6/yPFFVB8OU 79bJ07VNRx0Qi9b/BdpSrLNa2XxZDkp02w+HIBBn98rMFn+KvYP4bAgdLjt8w1F55XpgUF4Fbm9TD ywV+9DXiNRSkKFjC/TqayeaE6kCCeOgUbGyRfSEPIqzktHus/SeUoeFeD+SOi2ZzZSi3TxXvP5yLa 49ybi5sb8RtN16i1Jd1dxLsaDODpqMcymf/CwLEQi3+PJdQglGIayRAZIODFz63K5osOwTbH1KhPv gMltfepMMlsXdf8LxB72WgfJ79rdVOdAagT4SOsBdCPXegApmzNNrJWuVyYrGaboFZr1L2Hts5dl+ vkRq2wYw==; Received: by zero.zsh.org with local id 1p3P2s-0003ux-1U; Thu, 08 Dec 2022 22:07:10 +0000 Authentication-Results: zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:34207) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p3P2b-0003YE-Ml; Thu, 08 Dec 2022 22:06:55 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 3161A3200922; Thu, 8 Dec 2022 17:06:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 08 Dec 2022 17:06:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1670537209; x=1670623609; bh=YTpq+oVD4/ reQ6152+Y3fMhWT7a+3e6j7WXOagQlZIw=; b=RpmCSlls4lO/gD93TrF7oINzS9 Jo5+F6A6/3KOXf1li7VYwaD24BVo9MdRcY/PH2T+1WGJSVwRo4AKiW8mSPa+cqgK JsA+tfpUWzo0vL8Kd27/nJAsirqktzqEdIQxmJr08JsRw8ErgtnLB+JUiNkJ3CX0 /5KBkdHUWNtsC3dMUaabkHYaDAUzot3VmZyJUvTLug0j/aQEKL76sOMLmQHQ4Cy1 2rbXlSqHTC67AYm98GaW+fPP4vtdrL1ENmAmuRTKUXJY5hc5szhW8O3irn2nhsbE VChr0DnysDCuNqGbpgzciYftGc1N3ffF5n1ngo3d22jbyRyR9ACEXWW6zjkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1670537209; x= 1670623609; bh=YTpq+oVD4/reQ6152+Y3fMhWT7a+3e6j7WXOagQlZIw=; b=p RACAqQdLhZXAB6/Cv80vnu7LJteN3jcb2XfvI5m1BnqDNGMo/qPfCttcZ/MILgA6 rry/0eUUDELWkaFE2NwRrB+IQuSPz7zJb6b3G0axhlCyeGjxTaPWcdaAa8DMX2Qf HTytdcn9YcOR0k2P3zM1ejc7tXlIDCfZDpnEZ4d+sPI0vrNQrwDrBKsMk2X81vht 6ljPWZexVx1kMuD6BQKxraksb+eCClNKmAjQXUy1hJJb5CnQ/FFFB2rtL5o7fbME y/kDyLKDtB4sCNdgX+u6IZqSe45JhcRqQkIh3uQlEU3yxbK8rTPfJCG7WZ5RtQCC lZDEV0hNYxxOYGTRpzz0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtgdduheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjfgesthektddttderudenucfhrhhomhepffgr nhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg eqnecuggftrfgrthhtvghrnhepfefhieeutdehgfetudefveeitdegtdejkefgvddugffg tdduheeggfejudetfeeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Dec 2022 17:06:49 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4NSpCN2pxtz45W; Thu, 8 Dec 2022 22:06:40 +0000 (UTC) Date: Thu, 8 Dec 2022 22:06:40 +0000 From: Daniel Shahaf To: Peter Grayson Cc: zsh-workers@zsh.org Subject: Re: [PATCH v3] Updated StGit patch detection in vcs_info Message-ID: <20221208220640.GS27622@tarpaulin.shahaf.local2> References: <20221116204501.921232-1-pete@jpgrayson.net> <20221208145241.494978-1-pete@jpgrayson.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221208145241.494978-1-pete@jpgrayson.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 51141 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Peter Grayson wrote on Thu, Dec 08, 2022 at 09:52:42 -0500: > This is a slight improvement over the v2 patch. Only a single `git > show-ref` is used to determine whether a StGit stack is present on the > current branch instead of one or tow `git rev-parse` calls. > > I recommend applying this patch. It solves the StGit compatibility > problems in vcs_info: > > - Works for all versions of StGit going back to 2009. > - Does not impose runtime overhead when `stg` is not installed. > - Only imposes the small cost of `git show-ref` (<0.5ms) otherwise. > - Small patch. Low risk. Thanks a lot for the patch and for all the constructive back-and-forth, and many apologies for not getting around to pushing v2 sooner. I hadn't forgotten about it; I was simply swamped, and wanted to proofread and test it once more before pushing. (And I had planned to review and push v2 today anyway, regardless of v3.) Pushed the patch to master. Noticed two issues while there: 1. (preëxisting) Some of the other codepaths don't check the get-unapplied style. I'll send a patch for that in a minute. 2. The stg codepath doesn't extract patch subjects. The following addresses that for the old stgit version I have packaged in my distro, but I don't know whether it would DTRT for newer versions too. [[[ diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 37cd048db..c21c3c8d1 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -388,7 +388,7 @@ elif [[ -f "${gitdir}/CHERRY_PICK_HEAD" ]]; then VCS_INFO_git_handle_patches elif command -v stg >/dev/null && ${vcs_comm[cmd]} show-ref --quiet refs/stacks/${gitbranch} refs/heads/${gitbranch}.stgit 2>/dev/null && - git_patches_applied=(${(f)"$(stg series --noprefix --applied 2>/dev/null)"}) + git_patches_applied=(${${(f)"$(stg series --noprefix --applied --description 2>/dev/null)"}/[#] }) then # Testing for StGit patches is done after testing for all git-proper # patches/states. If a StGit user's repo is in one of those states, they @@ -408,7 +408,7 @@ then # --no-prefix. The former is compatible with StGit versions going back to # 2008. if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-unapplied; then - git_patches_unapplied=(${(f)"$(stg series --noprefix --unapplied 2>/dev/null)"}) + git_patches_unapplied=(${${(f)"$(stg series --noprefix --unapplied --description 2>/dev/null)"}/[#] }) fi VCS_INFO_git_handle_patches else ]]] The "Show information about patch series" snippet in Misc/vcs_info-examples can be used to test this change. Best, Daniel