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 21777 invoked from network); 9 Dec 2022 01:38:21 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Dec 2022 01:38:21 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670549901; b=e6D6vyYPrMjVkl4xdduL4VnF8+VZpnvldnhGcGgYIAifMiN6gPexd1agQ8FBzEcK+7zlgfDjLB tRq8sCKnjBwPNjpboe3GkmY1/BabXpfoK2j31vbAUdchdt1R6Cwxs47IPsKDUGvBQGw28PXqg0 c6xN7Wwk7QAW2BN9bnvsnGPgoRXA43NP1R5zVWyoBYlaJB74m19nyjwCQ3IEE00EcEPrqHTs94 eAs8xGWabI5+XdqTXNT7+g3wgM+Lvrbjn1ED2ZD8CnX2zNV0a90C9vG4pAMoAYNiXYw4QmpYCH YYrR3y5sKBjduWx8S+3khTHNT7LuQE1B8G+sjcOef0hxug==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; 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=1670549901; bh=fGwBj5xo1k9BY2msblEDkkYEhtfunXlhRGvHM4he6sI=; 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=l9M5RuPiu9uXpcIu6LjHLPqhxTKH3SIpo4Ol4v9ap1Q0dz5NfHWNHN9FPD76nF7Xj8HYoEHGG7 iB3mq/1NvUpocUclEoVRKJMbfDKwBAepcmCKb1kLTta2Dd4Gb416vlom9nrSWTVhoy5jrfaAff 1def1bjwzb8MUNQ8Gmny81pVELJ6NmH4ThjU+n7kJip73+cKZpltbeg9cprzIzIaIFBMnc76mN frP2aSe4D3V79qThoBwS4pW5CGY4I/aw3dvj5Z0/tG18Zm4FPNJGc6Pmx1iLNu7TSd0OMDdohz FZnnBo0zXb9XARZ2cmCWBVvaUEX4zauXuQfXkjJ6BQRL8g==; 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=zXZbUG5MdltkZncB8hWLq3lPealrQu2OOKsuC6t1Qn8=; b=H9u2vQEZ6cV1U9EGjOCk1Btteq w5xaI0CeMsZcQYk/QnTVLqA59O5rf/H/6w9hwQp2Lf345/2byOUqnz94dNkDNpbCnFomKZo9Tspdz BKh0N3zdhea+iyjC8Af3zDL357WuMMBThKvEiagi4I5/ZxIWco7zGyroI1bBaO59oL0rf+mQM6kX5 2DyAt8tUYoxMXtVwSANE2+EfpxJOu2/IX2gkyDPRXT8wOBumIMAi2/1kTmz+HXjzeUI7p2XwKlARo PZ8kMevugQB6mmYj59Tm7stDNzBCVw7isF5Gg4xEE5siQXSLid+VdaJ5KpPltQDVl/CqU//I8wgpq ETIRdo7Q==; Received: by zero.zsh.org with local id 1p3SLE-000BXp-CV; Fri, 09 Dec 2022 01:38:20 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; 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 out2-smtp.messagingengine.com ([66.111.4.26]:50439) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p3SKt-000BFV-Cu; Fri, 09 Dec 2022 01:38:01 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0FB895C00D9; Thu, 8 Dec 2022 20:37:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 08 Dec 2022 20:37:58 -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=1670549878; x=1670636278; bh=zXZbUG5Mdl tkZncB8hWLq3lPealrQu2OOKsuC6t1Qn8=; b=D7jtTCNaTeGoj99EnUV7bMomP/ iAr4XrtKiY4zbTYaZgei1GL0s81gPgU2R7qW62ZEFqc08YIDG5XoGUNH/idp57UU 6BQH8nIN23tGh+sUkTm1kGklRUboDnbiW3CbSMpU/CTGd+i5ukNwe2tlLMrrlNII EZqBmMlDf9qt6/KGJKGUTjWDmwUEP9hkIm9GNQsf1eJsrj0wyPIk+W2CjTn2Z1W4 g49q6v65N41UytnoaDOcYPLeAZR7u6Ywq99Gm0Cva4Feo1whCTHmRt+fMGmRpcej SAjFHkF0RxXG9PLxvQPifwRnnMZ3YNg+aZpxsYJQfBcY+7T4iu/21qSyWlPQ== 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=1670549878; x= 1670636278; bh=zXZbUG5MdltkZncB8hWLq3lPealrQu2OOKsuC6t1Qn8=; b=f WavSC5JHRS6mfQGXVcNm897TMKEPICG970A5xYUHGADaWpWZfGWBsVOJ4wiB2yQ1 sC7VT0tLhsfZ0RlB7W6+IJoW8kI3/yQA7qaRnIQSTnpRLgh02Pp/dATX3HOqr8rW XvwAP7epzHqvG2AjFZnmhOo/+814r+61k9Y18suPXPbUPrG/IwoTKUEKzjySiErj cWR3oMHzQqshA3VTrYiT0G5NEn0wc3HqwUeaHFwlSueYLMLSzhSwp6kszOtHt/rQ aATiJPoJjbnD85vYvdsnuY7d3sj3ec18G4nSd3Wj0nLS3R445QAw4NJLbqC5xOVm pUEeOLVOAJAuSRQhN3kIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddugdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjggfsehtkedttddtredunecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeefhfeiuedthefgtedufeeviedtgedtjeekgfdvudfggfdt udehgefgjeduteefueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Dec 2022 20:37:57 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4NStv631cFz4G9; Fri, 9 Dec 2022 01:37:54 +0000 (UTC) Date: Fri, 9 Dec 2022 01:37:54 +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: <20221209013754.GU27622@tarpaulin.shahaf.local2> References: <20221116204501.921232-1-pete@jpgrayson.net> <20221208145241.494978-1-pete@jpgrayson.net> <20221208220640.GS27622@tarpaulin.shahaf.local2> <8d776235-9847-4b48-b19d-21023d5178ae@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8d776235-9847-4b48-b19d-21023d5178ae@app.fastmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 51146 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 19:59:15 -0500: > On Thu, Dec 8, 2022, at 5:06 PM, Daniel Shahaf wrote: > > 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. That'd be a «#» with EXTENDED_GLOB set, which is the case in this context. (Docs are at «man zshall | less -p 'x#'».) Thus: [[[ 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 ]]] I'll go ahead and push that shortly (I just need this message to go through so I have its X-Seq number). Cheers, Daniel