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 20267 invoked from network); 1 Nov 2022 03:06:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Nov 2022 03:06:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1667271980; b=GX43yHSw6uaZ8253IrokP5OtEhWlHtd1m2bfjdKxBfcctab/Z7z5VeyO6Ku0qFF7vFYNefcpF0 ajGlGL6TfqDj2doulVlFKcElhojKLBc8hoZP5cJZLz9Eh4LfgnPFTr294EEkIYnC1YhOUCeUcN 79DUaKCm9WNniXIk1e5QZsvj5vXmbqq3a00KfblYCzmZoQGLGSNBSwCelCmiwcXJWCDmI0UU6z tWI7hSBiwKLrF3k2SZBDkKF/gap7fUdJaiJTKKY9xjneTn/F+AWrIVleRTTOvZTby7/dXozoul vrLfHWg6lPs4MAOzCMH4/6WXIWL1fcyRMtKUs2T8v9v9UQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=jpgrayson.net header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 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=1667271980; bh=iI5a+QCOnOnxHKfk6ehkZZ4982fu6R0K1D/jWX8lF3g=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=O34fC+CsLI0iaGNZfBVehB6dabMKCaKBwp+LCwxNjWwxqBxtcbnL7U/bJuXvm7HM/TTDb/+DCr Sfrg3txYNlZuEzaNoscigDyZlI79RkQ4OIUkDnTAT6YNAbGbFgHolrPGN9G8zVgPWNglb04Sab Ql2/A56SpeXaQOAHdXavQHF0zIZw8sgYR8icIRdeAHIOeopJNcBik/AmvsjOIkEogbouvxQMjI gFU5zP51igNxwHGBWSIFmCeK9Qq9KDIAG0DH7XIRCtYYQ/ZuQwu4/njBP5agoF+asYxkzkyres oT8tOWCR6/me25kkYmH9CAdz0toVR5+Gf4pNvtMlNxG8TA==; 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: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=EK2MErPwsvkQH7cxh4tCuoHPoQAa649Nzflemzki/dI=; b=NhlRh5r3hGmXSSXj9KjjsMj8H6 WfBOYkRwVr9BfHUdeNAsBKPVnqpZsDelCyv1Dl2dXJfYQmzNt/JMyT6LJRdJJjydy2dLAFakySh3A U+zVmg/sk/I/32hikZx2N9NbrERKkOBEobb0yHIYnwhiAXMYKuuUTC4UTn5+4kh8pZVk13Rcd88ad OWo9wRFXMEoQGECTSp/xBGnOJ3u37bdmECHu28jv03v6qh7VrBYBqzSKe5Lh7Pv+nhEJVXy+tKIdy kIZhL/xTbVwHw3QkY+yOdUiSWigJyxqhf/NhDXARlsu5d7OMBgmNwT5TOlHq0KEkVHS7A5+zGsUU3 VRbbn2tQ==; Received: by zero.zsh.org with local id 1ophbX-000AbA-TL; Tue, 01 Nov 2022 03:06:19 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=jpgrayson.net header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=jpgrayson.net; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59421) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ophb1-000AHt-9a; Tue, 01 Nov 2022 03:05:47 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 661505C01B1; Mon, 31 Oct 2022 23:05:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 31 Oct 2022 23:05:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpgrayson.net; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1667271946; x= 1667358346; bh=EK2MErPwsvkQH7cxh4tCuoHPoQAa649Nzflemzki/dI=; b=L 3MOuDQYQ4DJg7A5kxGH7YwZXzpY0OCXybMU0q8hzsOC2tFUPehzE8yYF2tzCayhv ZGMiKIoPEAU6aZ0pI5VAbeYQCJmRSxIq8RMSV86Mdins/xzvWhgh+R+ZxhSuA/CP 9GENJEDSR7ia5Fza5PjTSzwVL5ocoAtkkmojMIYBGVtzjEJ9I2mNMlrv9ZYocEuJ rtMdyyt4Yn51c7x2trPi2zWaS1Z4/vx1Cpkmu52pi+XrNrQkWNqwTKuOVp+acpUA vKC5pJgYlLp2tfLDz9TKZZvLxQcKF8iyiu1nBTgiBBNltO+cG0y8kTeZXUIqv3cz tnoKOmkJb7gw09ae0sRkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding: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=fm3; t=1667271946; x=1667358346; bh=EK2MErPwsvkQH 7cxh4tCuoHPoQAa649Nzflemzki/dI=; b=QbbP4/tanz6K79fZMf/UNdCXYP7nq XExuBlxZ3piF+LcC3FSEwP6gsacz36rNoc8ONJX+A2vrEMlEbuUKxQr4qTESXz/h Qu8sSghnFIWg6jXglX20Rv8AZdZGgqNOvjlD4lnLQ7jbXDPjAckYfvT06YlW9nre HpV76QdxFz2K3Gtl9bUWBkof8TWhyREPr1fjjqTSz4AtQyjfJSrIjEU2iKSlBZO9 lFzK7zuTMSXRgyhgEhiQj4z0gx4zsIuQyzVI+jZfLNEhNk77vSylh+ppkaN91AsI 9yjv4nHLFCshP1dFE618qH/5gT2AI4YB6dBsEJqRO4sCyrqflWJV1mtuw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudeggdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheprfgvthgvrhcuifhrrgihshhonhcuoehpvghtvgesjhhpghhr rgihshhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepgeetudeggfejvdehkedugfeuge evvddvfefhjeetfeegveeiheevuddugefhfedvnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvsehjphhgrhgrhihsohhnrdhnvght X-ME-Proxy: Feedback-ID: iefe944c0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Oct 2022 23:05:45 -0400 (EDT) From: Peter Grayson To: zsh-workers@zsh.org, Daniel Shahaf Cc: Peter Grayson Subject: [PATCH] Remove StGit patch detection from vcs_info Date: Mon, 31 Oct 2022 23:04:30 -0400 Message-Id: <20221101030429.38029-1-pete@jpgrayson.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Seq: 50857 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: The vcs_info patch detection code attempted to interrogate StGit patch stack state by inspecting .git/patches/applied and .git/patches/unapplied. As of StGit 1.0, StGit stack and patch state is no longer maintained via files in the .git/ directory, but is instead captured in the repo's object database, accessible via the refs/stacks/ reference. Thus zsh's approach for interrogating StGit patch state is long obsoleted. This patch excises the code that attempts to interrogate StGit stack state. It would alternatively be possible to repair this code to interrogate the StGit stack state in a different manner, but: - It is not clear that StGit is a sufficiently popular tool to warrant direct inclusion in zsh. - Interrogating the StGit stack needs to be done using StGit's proscribed interface, the stg executable, and not by interrogating either the .git filesystem nor by inspecting the git object database with the git executable. - StGit versions prior to 2.0 are implemented in Python and thus have an unacceptable runtime overhead to be included in vcs_info (on the order of hundreds of milliseconds). - StGit 2.0 is implemented in Rust is considerably faster (a few tens of milliseconds to interrogate stack state), but any non-zero overhead to vcs_info still seems like too much given the value of this patch information and the relative non-popularity of StGit. - Just removing the code is the lowest-risk approach for the zsh code base. Signed-off-by: Peter Grayson --- Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index e45eebc8e..a3f4dbdf0 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -184,15 +184,8 @@ fi VCS_INFO_adjust VCS_INFO_git_getaction ${gitdir} -local patchdir=${gitdir}/patches/${gitbranch} -if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \ - && [[ -f $patchdir/unapplied ]] -then - # stgit - git_patches_applied=(${(f)"$(< "${patchdir}/applied")"}) - git_patches_unapplied=(${(f)"$(< "${patchdir}/unapplied")"}) - VCS_INFO_git_handle_patches -elif [[ -d "${gitdir}/rebase-merge" ]]; then +local patchdir +if [[ -d "${gitdir}/rebase-merge" ]]; then # 'git rebase -i' patchdir="${gitdir}/rebase-merge" local p -- 2.38.1