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 16833 invoked from network); 9 Dec 2022 00:59:57 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Dec 2022 00:59:57 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670547597; b=Sczfy0ScFF1oZ6zEyj3Rnc45YP0SfVwGQRzP6Xzf2KHcHEyqkJh1Ztt9efZYmbt52JhxFbrKsL zipXpFs66zvYmZutlaTGMfUdOeyFQZAVUqfMwrh6hTtNpcmoFxW+u7yhlZI6PXtgiGXAC2qRo7 ZRucvurd3CaMMZQ4MOa8XKanfln281OXq/bGEjp6gOyLtJFHnRG+G87moGLcJxQXhh5vM/zgkD d51mJz8LpuB2FWZwJw3m6ef1iZFPX6ZxZAY9jpVCHdxzhmrfiuK5FDIuIb4O8CHatI+4BoTjf5 xOawyXuadDQrMPYG266TTmMvzlJUpGe+iicPgL2yyZOPXQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=jpgrayson.net header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=jpgrayson.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1670547597; bh=5lrfjM+g4si+4w3F548p5aRqMluyzGtEsZha8Fbgh+Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:Cc:To:From: Date:References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=krLWrzfgCuVtnZDVwm62lD5bZNNWeQBHs2o8BuSpolhPb87l9WogHWHxQUXevwt1Da2Mjms41+ PUR2WbaBzkPmcWF3k8ZKj3SFlbq5Wzd8kFgxLrLNz43z9oimRLKIMIWclP5IZT0GKmUpDhhqC7 XZDccAyHoLyuhCEoPyU+/KKx3BdsUmDNQLgJjep+1EwONi0a5flpb3c0feGNsgjA1zS7/FxTl/ 44cUrB3iosBrWUZ3UVzjDtY+kErJlaRJLTErnzZulnRYzPLpyy+SC+CWMz5M+buR4hfkLeur4v ajVBDXTx5S2PRqQkXJLhEUB7dgGgaN83mC7UtpzjvrujiQ==; 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:Content-Transfer-Encoding: Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=V53bb8yXIVsYwhh/rv4JjpDS1/1G/J6eimTL6HDcudc=; b=BHBG5zswrY+qJ0dRrFdHbmjoUm UUnzPcR2zT2qc1hvZCfrpe2Sh4jZTKrxkZjzAGZoWfBL64vLTgbh4ClNFfvWOO7eIBK27/D5ZjttU d9k+VykVLzeyt+/TmojpDnUEfq6XI5yDxl55m9w6jYUniHWhJb4BcMD5v93SqlEqeZm0BZKiKyn7T Yee3ps5Nbk/0G5y4WVMaIY2HmY8AZ+/cGtRO14nkUtzew1+lf3FDancpke3DCZsg9p/i9oVZ3vIfJ 8t98tOcmnZuJUFArVfepra4CayV/FUt0KWbZPN22Gxm2wNWda0eVfb17b67tA4y4rTi1o0TfRu9P6 zjSJ5G0A==; Received: by zero.zsh.org with local id 1p3Rk3-0009Tv-H5; Fri, 09 Dec 2022 00:59:55 +0000 Authentication-Results: zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=jpgrayson.net header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=jpgrayson.net; arc=none Received: from out4-smtp.messagingengine.com ([66.111.4.28]:56417) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p3RjU-0009AB-ND; Fri, 09 Dec 2022 00:59:22 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4F2145C00E8; Thu, 8 Dec 2022 19:59:18 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute6.internal (MEProxy); Thu, 08 Dec 2022 19:59:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpgrayson.net; 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=1670547558; x= 1670633958; bh=V53bb8yXIVsYwhh/rv4JjpDS1/1G/J6eimTL6HDcudc=; b=F UNIZmLFkCIRDFQhWjYMncHTB+MGZZ1cQV7Y7i5/OcUzIIobYpuy2jXmbkZFuYGQV y0XnCa7B+nIB8Ns5Mrb521G+Fm0BZxv4GDXtGXIYE+5/qKuBK7IWk+ah3WoDSn2n qfeA5B1I/5MnJ4cebC1J3ic6Wg4dZ/IQLG15Xvd2GSFQjx6NP9by6h1xtzYXH2BV CUJ+iOWVfYpt0/z6vIOad31qp8Ym5QQJrZrpCkAhjN9EunaaBVISL4YsHOQMvnK+ YZLS23jK4vHNdtwXYF18a0drn3LN/icXvKsKk3j1sgcT6oeABs0W3w3Ft7ZovUit 1tW6Gk70+DAWMq/QHXu4w== 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=1670547558; x= 1670633958; bh=V53bb8yXIVsYwhh/rv4JjpDS1/1G/J6eimTL6HDcudc=; b=s 8LQX4UhxxBvBExddkHUR3cAh7Us3m5lfEgga1VFSgrqSRUoN/9DbLTjioIaW7s+U Q1PMyP/Dbm6YsZGMpgKZQWpHmyMY7GyS49FdINQ/JR/Z3XSevM4YbWbuPWxUNVFg BwBirBaQn1fWac2pVygB4pikZI23Yn8VxvMadpoFWyGin5WYSVSP7KZU619hh64I SyeT/rJU1c4I7JNbU/zG4miNXrxZ6dpts2Fb7w9jWWky7lvzJwZ7VRYkA04jHPea 2NrVrxhxzjeNEON25wob8SMD9LRvmYCyEGbYnEqqggfhcMt0dIzBHqfAmKl9CHQK zzKBzR1M2uXmfBitOUQfQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddugdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvfevufgtgfesth hqredtreerjeenucfhrhhomhepfdfrvghtvghrucfirhgrhihsohhnfdcuoehpvghtvges jhhpghhrrgihshhonhdrnhgvtheqnecuggftrfgrthhtvghrnheptefhkedutedthfdvke ejhfehleefkeevudfhvdffveefleetveehveeggfejuddunecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvsehjphhgrhgrhihsohhnrd hnvght X-ME-Proxy: Feedback-ID: iefe944c0:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0932631A0063; Thu, 8 Dec 2022 19:59:17 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <8d776235-9847-4b48-b19d-21023d5178ae@app.fastmail.com> In-Reply-To: <20221208220640.GS27622@tarpaulin.shahaf.local2> References: <20221116204501.921232-1-pete@jpgrayson.net> <20221208145241.494978-1-pete@jpgrayson.net> <20221208220640.GS27622@tarpaulin.shahaf.local2> Date: Thu, 08 Dec 2022 19:59:15 -0500 From: "Peter Grayson" To: "Daniel Shahaf" Cc: zsh-workers@zsh.org Subject: Re: [PATCH v3] Updated StGit patch detection in vcs_info Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 51144 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: On Thu, Dec 8, 2022, at 5:06 PM, Daniel Shahaf wrote: > Peter Grayson wrote on Thu, Dec 08, 2022 at 09:52:42 -0500: >> > 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. Thank you! I appreciate all the effort you've put into this little corner of zsh. > Noticed two issues while there: > > 1. (pre=C3=ABxisting) Some of the other codepaths don't check the > get-unapplied style. I'll send a patch for that in a minute. Noted. > 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. Newer versions of StGit have the same --description option for `stg series` with the same output, so the `stg` command will work across versions. For reference, running `stg series --noprefix --applied --description` as is done in the below change will give output of the form: patch1 # Subject of patch1 p2 # Subject of p2 third # Subject of third patch I tried the relevant example from vcs_info-examples along with this patch. The one problem I'm seeing is that because there is a variable amount of space between the last character of the patch name and the "#" separator, the `${${(f)"$(stg ...)"}/[#] }` substitution captures any extra spaces such that they make their way into the final prompt. This can be resolved by changing the replacement expansion to: ${${(f)"$(stg ...)"}/ *[#]} Which is a little clunky, but I don't know how to express "one or more spaces followed by a '#'" as a zsh pattern, thus the clunky ' *'. But it will work. > [[[ > diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git=20 > 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}=20 > refs/heads/${gitbranch}.stgit 2>/dev/null && > - git_patches_applied=3D(${(f)"$(stg series --noprefix --applie= d=20 > 2>/dev/null)"}) > + git_patches_applied=3D(${${(f)"$(stg series --noprefix --appl= ied=20 > --description 2>/dev/null)"}/[#] }) > then > # Testing for StGit patches is done after testing for all=20 > git-proper > # patches/states. If a StGit user's repo is in one of those=20 > states, they > @@ -408,7 +408,7 @@ then > # --no-prefix. The former is compatible with StGit versions goin= g=20 > back to > # 2008. > if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}"=20 > get-unapplied; then > - git_patches_unapplied=3D(${(f)"$(stg series --noprefix=20 > --unapplied 2>/dev/null)"}) > + git_patches_unapplied=3D(${${(f)"$(stg series --noprefix=20 > --unapplied --description 2>/dev/null)"}/[#] }) > fi > VCS_INFO_git_handle_patches > else > ]]]