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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31651 invoked from network); 4 Nov 2020 06:39:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Nov 2020 06:39:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1604471960; b=mFjFyMs+bS9TeudfobK21YlK0BTwuNDkA+TJDE3R5+7BKJ60SJ5AzP5bx9gtNJG4f0NRtCEg9C xPk+ca0W7rnMDHLEmt0MDbURFnkZS1qh6mxHYxhXYd59XiLi2PLU42en/dnKBFx0KDnoBIZsKk l0V11hc4dsMmNtTOX0rg6f7VJ2sddcJ/xs0uMkBqGxLk5FDtaPhKbhVm/jwW8dXi05VnIxjynf bMLJ6Y5v5sGdMENEjRXjaZo289qibf2uxYw+bTMlcCwsVZIluLcj3spepKoIp2XpURSFgzSb1N qeypikVyQ/SIFiRhQTt1I38yCDGIXDvOMllESOMbbujoBQ==; 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=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-20200801; t=1604471960; bh=Z+XnjR8JH4gVr9t8J3iHXABX9KuUaRFUC4gBooxFv+w=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=lSISHu2FSyQ5cV0aA4VvhKO9ciDaF/z+XPsITbLGjbaQVLFwwOja6axQRaKJ0fCbtu5MsnxTYg Lb8RHkO9M3PJF7tGOoDre2BMKzOLImpLmTnrhK87yKb2haZZTEgEhTKv4/J9jQrT5nTph7zX6C tTzFBMIw+ec5u0YoXHhJMxfJ3LWsXxNDCvWzJXCUB1TKrPNpByMPI6oQsrmfzMqFg/L+M0099o 9AqbNZl+ldNYxCF9HXSWlNAIV24V7JJs/iOW3OtnY8saAIr9Zb67F9FDknpmTzPps6He8Axv6T tQ1ADQwi+2hgwnLKLy0u042NIxJ0TWnSpMqHoqTkVdnxeA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To: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=Kp7ghO0I+4GH4o6oo50VhA/AJpUvo4O822OGjtKML1c=; b=kDsd+hAUg03RPu1pz3oWcONn6G pE2vSpVoY/PNsidLGCiDtUIJjXTCjXeFpddqf/WELYgYj7Rx+SpZOyVkfnqbiXKET4fv+mSU9z9Ez ZmxUnCaTu46Bncat2An/ULqOmtoWJsejvxz0J+6PfLrv0CPqngggS6qe1Rko33D2ygwVbqs8czy/u 6EeqXxm9YcudnEqKK0MT93ZKUXcCnLL+uMJv8Pn2wb746zmV/E9aw4mVI1ExYYkBFA4Fp4gqg9MXe QwbcGaqT6vpaXYr5VOQZ+mZD83cA1HtkFVnTpiwQ9AlWxuxBShaefNk2p/LQZMMD0cUVmH6d0Zfxj T/BQMPiw==; Received: from authenticated user by zero.zsh.org with local id 1kaCRr-000Bhc-K5; Wed, 04 Nov 2020 06:39:11 +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=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:56735) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kaCRT-000BXs-Fg; Wed, 04 Nov 2020 06:38:49 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E90A15C00CC; Wed, 4 Nov 2020 01:38:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 04 Nov 2020 01:38:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=Kp7ghO0I+4GH4o6oo50VhA/AJp Uvo4O822OGjtKML1c=; b=EiF4h6ACibYpoIgN6Q79pCRKrLN65HeegLkYfHKvRC 4f0mJL7SpgK+zPJX0kfNQOx5lT3Te86FDJD3GDUthEJ/xITYhepQ+f2DsPSxq7jL vy+WKoVOdwrT1iEN0VRvk8BXp/rXcTAJ39lpuS/wjq7w0Un141EOGt4YYW3vJF2D eM+HtrmJC11Jy/FJv4D7qS0+aGDRyUc9zxykYOcuqu4p/eUlGhIbWpM+Le20hHVz OyDRrmzDICV/4xF+zostyyj/IOL8p5T+NtC8ZBy103LthP/O1buZBJN/3+ow0YGn 6GKM9++9BlXH65767b3w0xyVrRLULKYjlbW2ZKzHTNpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Kp7ghO0I+4GH4o6oo50VhA/AJpUvo4O822OGjtKML 1c=; b=eMisS3TOpBfEyUFVKBI/Jumr+L6IvPt9nek119OJaiBjpTotITCPJicCB f8kddjzr6xeT/dt3KUiaXr8OLFu46UbqAmu3vU5YO/OpWip54ZDIOTgsxUAqW68r Mqz/Co2t7SUlY6xLK2Hs6RwR5bkTJPjfm2tOpgPlwlx+r2WoSDofZiKNHIAZhyoR FKqU/fCVB0rG0T4G88pwoZvYwCTBk4eVF3Wny2XnaRA58Qr8nPdHCvTxyeNa4yXX /zKf6HYnCwZY36BEQnycq/364zzWll9ogskPbPktilyqJHOrAqn5ifPlUhvrPKPp lzi4RNvdBScioWql35VAmc4kvBFmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtgedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfgjfhfogggtgfesthhqtddtredtjeenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfdtteefheevuedthedutdeifeegteettdejtdffheduieei jeelteetkeduteehnecukfhppedutdelrdeigedrkeeirddugeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Received: from tarpaulin.shahaf.local2 (bzq-109-64-86-14.red.bezeqint.net [109.64.86.14]) by mail.messagingengine.com (Postfix) with ESMTPA id 7BFD73280392; Wed, 4 Nov 2020 01:38:28 -0500 (EST) Received: from tarpaulin.shahaf.local2 (localhost [IPv6:::1]) by tarpaulin.shahaf.local2 (Postfix) with ESMTP id 4CQxmx6wmNzKR; Wed, 4 Nov 2020 06:38:25 +0000 (UTC) Date: Wed, 4 Nov 2020 06:38:24 +0000 From: Daniel Shahaf To: Aleksandr Mezin Cc: zsh-workers@zsh.org Subject: Re: [RFC PATCH v3] vcs_info: choose backend by basedir Message-ID: <20201104063824.74110106@tarpaulin.shahaf.local2> In-Reply-To: References: <20201029012755.253085-1-mezin.alexander@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Seq: 47518 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: Archived-At: Sorry for the delayed replies; I've been offline. More below. Aleksandr Mezin wrote on Mon, 02 Nov 2020 05:09 +0600: > On Thu, Oct 29, 2020 at 7:28 AM Aleksandr Mezin > wrote: > > It's possible to revert to the old behavior of vcs_info, by setting: > > > > zstyle ':vcs_info:*' backend-choice enablement-order > > =20 >=20 > Now I'm not sure if an "enum-like" zstyle is a good idea. >=20 Fair question. > 1) Should I check somewhere that the string value is valid (i.e. it's > either empty, or one of the predefined strings)? (This question presumes we'll be keeping the enum-like design, so I'll presume the same in my answer.) If possible, please write the code so as to be forward compatible with any new enum values we may add in the future. That is, when reviewing, we'll consider several cases: - Style isn't set - Style is set to one of the predefined strings - Style is set to a string that will be predefined in a future version or to an invalid string (the code can't tell the difference) Less likely cases include: - The style is set to the empty array (=C2=ABzstyle $pattern $style=C2=BB w= ith no further arguments) - The style is set to the empty string (=C2=ABzstyle $pattern $style ''=C2= =BB) - The style is set to one of the predefined strings, plus some additional words > 2) Extensibility: I don't think there will be another different mode > that should be controlled by this zstyle. More likely, there will be > parameters like "prefer non-ancestor vcs directories or not". And IMO > they should have their own boolean zstyles, and not something like > `backend-choice closest-vcs-dir-prefer-ancestors`. And even more > likely, nobody will add anything there About extensibility, needs for extensibility aren't always foreseen. As to their own boolean styles, I'm not sure I agree. zstyle values are arrays, so we could let parameters be provided in additional words, as in: . zstyle $pattern $style enablement-order foo=3Dbar zstyle $pattern $style closest-.vcs-dir lorem=3Dipsum Hmm. Perhaps it would make more sense to name the style "disk-layout", and then the extra parameters could be used to choose whether to select the closest or farthest .${vcs} dir. Or perhaps an enum really is overkill, as you say. Frank? Cheers, Daniel