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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7897 invoked from network); 27 Jan 2022 17:59:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Jan 2022 17:59:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1643306389; b=ELbPdHpt7qeAJYiXqOBVORbjnvA4zAfW0JxEDujBy/PlvMnqD1j0wWW7o2EN6TkVwLPrrmLKDo kr2DN5jdkqBurX7pUKboyGuk7pflb4O69ZJPYn4OY+q189fEU+hLv70vHl9ox4INEzTWxlOm/6 aqE/FyI4eDWGmcPuR95eoMM8LqXQ+W9jdr8XNVptRaW/rrb5UM1+DWo8Nn676CjQyT/lD2pJ8n EFl+TtKb/LdyiQPn5XJeHC9NrVE8AunNL6LJ76i9AyNm63HFDKGPbWfLW4f+9WWdVpl1nfnxo1 WNU6PcBe8p7Q13qa9VF07mITGtV7aHa1gCwwxFQvKd97mA==; 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=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 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=1643306389; bh=752OH2hfqn3uI0UoTXoouC0LzovK6w/PGpHa46b+riU=; 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=Slqo2HcRYci+CDDPjwV4C31bCCy/3QaacwuUr6hRD8+SYC9rjzGyrhB5lv3luXCMnA28W8Z3NV 4hJHN9byF9R2HKJ8wnRBO6w/4Qaj6vPWEVIO2jzWT00h3wjSzcKGgyO4CM6WcspaaEwd4IfPqn 9oXuM7O9ab8Ighv3oTtkD3LgzKY+wZDU2f2YPCsB8JcdMAHxYkA1LYN8nwBPT4CHSHl7neznYj kCYzFNnSzrGIwmouBrNl2PriLJXIF7FiBkwk+Tkz0fKpfdQcLYD+Kl0VblAtQevCJ78I7ZzCdt DXhQwLMLYYXkdtfXGSJJzr4OqfiCVQ4VpW5Jw4cqjNT0mg==; 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=MZFDBFNQJ1Jw10zZUQU7gujK58gys8vwnKNcLkCAqWs=; b=HivQhbBmUoNluRR9Uw5rvnY5HW s/88uaq9nPYAT4uS6vBo5QFxCBU4I3mZ4SP9It4hsgGEoUlB5OuTM2ylHFWxcuPNP90uO1v6bw4Rl YGZ/5R4rlEbdlxwj0IPMNKKgjv9zz/RPCFvWmdBF+OlgCmR4OdKMIOHpW8k8JTnkEuuyaST2ifHEE lm6KKOjaKDPhYZWhmqZejgVbkZD0ioS8w24hocspjLUNKY1ScDxoaTZDS5gBaY7oBgvBMu14GPQMU TuJH8MGB+TB4PHzya34QvInsPx0Bx43lrkLx6M22pT9uZY4xfbBYom7/MZ51QuUHQ9Nv7OPq+fjGN ippFLJqA==; Received: from authenticated user by zero.zsh.org with local id 1nD93k-000C2s-Sw; Thu, 27 Jan 2022 17:59:48 +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=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:32793) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nD92L-000AlB-7r; Thu, 27 Jan 2022 17:58:22 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AFEB35C025F; Thu, 27 Jan 2022 12:58:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 27 Jan 2022 12:58:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; 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; bh=MZF DBFNQJ1Jw10zZUQU7gujK58gys8vwnKNcLkCAqWs=; b=M61Xp9Go7LeuviOhCQD uyI36qQE9qHHu0frKD3nmKJrG5CJM0qVRp5XjV2cBsM0QBSBViuHMSBDgSjFxxKP Q/W0nWxFsPBVlIboLdl9QXmEXZaMQzE3PQZRpuTKYprqwId7dx10HL7hiwkSb0rr 6TKqN0DyuW4fsHdXyUF2OJpim7r00VwgmO/KQQhrryVkE/5W3wuhe3nCCG0DS2xX g22BXZadp8i02Me22trovCse8QEAiQ9h0FO7eEJ4IvmSwfR3+Frw9DdxkNgoBXzl nX9+eb+um+rUXQIbEeVKphAalWYRnlSzfbLENUFR9IKgxLoxQKFtAfYJqkr3FcRm hrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=MZFDBF NQJ1Jw10zZUQU7gujK58gys8vwnKNcLkCAqWs=; b=fjr0RkFMKEbv90QK4KJnZT GdG2OXP6F62fwkCVyHOoPBd4JVLBWpGJCmtWSFTFRyqLrCr529O0W3lAnIjVPclL UJ1BLFEVq1Kus3LQPyneAtVQhzLWQ1qIYbe4JnaANCSR2Njbfo1XlXSa/lbvyy/X uI/gIRT2nKCKcMowv5hdO+HHsDBTlY8U7JThZr27l+/rWXXTWQfeckWIM70pmUSL YepG3e9TVsv4j8uStMzPUXs4iZG/YGW12+/njWfzrPIjpyCpcuOFrT7DX4Ydhv29 rjrsXzAZSTb5Fp0Hldp6ekT8S7dxndpmSKpRbLxrOJUfDhhK4y+uckAi/gnfXZVw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrfeefgddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdektd dtredttdenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgv lhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnheptefggffgfeeujefggf ejjeejleeujeevhfevgeelvdegieegveeugfffjeefleetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhh grfhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Jan 2022 12:58:19 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4Jl7c80PWXz3mQ; Thu, 27 Jan 2022 17:58:16 +0000 (UTC) From: Daniel Shahaf To: zsh-workers@zsh.org Cc: Marc Finet Subject: [PATCH 2/2] vcs_info quilt: Use quilt-patch-dir and ${QUILT_PATCHES} even when get-unapplied hasn't been set Date: Thu, 27 Jan 2022 17:58:14 +0000 Message-Id: <20220127175814.10179-2-danielsh@tarpaulin.shahaf.local2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220127175814.10179-1-danielsh@tarpaulin.shahaf.local2> References: <20220127175814.10179-1-danielsh@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Seq: 49723 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: This affects the post-quilt hook. Before this patch, if no patches have been applied and get-unapplied hasn't been set, the second argument to that hook would undergo null elision. The generation of patch subjects for the gen-applied-string, gen-unapplied-string, and set-patch-format hooks was unaffected since it was guarded by [[ -n $patches ]]. --- Functions/VCS_Info/VCS_INFO_quilt | 45 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt index 22212171a..ee242f552 100644 --- a/Functions/VCS_Info/VCS_INFO_quilt +++ b/Functions/VCS_Info/VCS_INFO_quilt @@ -113,9 +113,12 @@ function VCS_INFO_quilt-patch2subject() { ;; esac - VCS_INFO_quilt-dirfind .pc .version - ret=$? pc=$REPLY - if (( ret == 0 )); then + # Look for the patches directory. + # + # 1. Check if there's a .pc/.version file in a parent dir. If so, use the + # patches dir from the corresponding .pc/.quilt_patches. + if VCS_INFO_quilt-dirfind .pc .version; then + pc=$REPLY [[ ${quiltmode} == 'standalone' ]] && root=${pc} pc=${pc}/.pc if [[ -e ${pc}/applied-patches ]]; then @@ -128,25 +131,27 @@ function VCS_INFO_quilt-patch2subject() { fi patches=$(<$pc/.quilt_patches) patches=`builtin cd -q "${pc:h}" && print -r - ${patches:P}` + # 2. Else, locate a patches dir using the style settings. + else + zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}" + : ${patches:="patches"} + if [[ "${patches}" != /* ]]; then + if VCS_INFO_quilt-dirfind "${patches}"; then + patches=$REPLY/$patches + else + return $? + fi + else + [[ -d ${patches} ]] || return 1 + fi + quilt_env+=(QUILT_PATCHES="$patches") fi + # At this point, $patches is set and points to an existing directory. + if zstyle -t "${context}" get-unapplied; then # This zstyle call needs to be moved further up if `quilt' needs # to be run in more places than this one. zstyle -s "${context}" quiltcommand quiltcommand || quiltcommand='quilt' - if [ -z "$patches" ]; then - zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}" - : ${patches:="patches"} - if [[ "${patches}" != /* ]]; then - if VCS_INFO_quilt-dirfind "${patches}"; then - patches="$REPLY/${patches}" - else - return $? - fi - else - [[ -d ${patches} ]] || return 1 - fi - quilt_env+=(QUILT_PATCHES="$patches") - fi unapplied=( ${(f)"$(if (( $+quilt_env[1] )); then export ${quilt_env[@]}; fi $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} ) unapplied=( ${unapplied:#} ) @@ -154,8 +159,7 @@ function VCS_INFO_quilt-patch2subject() { unapplied=() fi - if [[ -n $patches ]]; then - () { + { local i for ((i=1; i<=$#applied; i++)); do if VCS_INFO_quilt-patch2subject "$patches/$applied[$i]" && (( $+REPLY )) @@ -173,8 +177,7 @@ function VCS_INFO_quilt-patch2subject() { unapplied[$i]+=" ?" fi done - } - fi + } VCS_INFO_set-patch-format 'applied' 'applied_string' \ 'unapplied' 'unapplied_string' \