From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 19CB2BE8E for ; Fri, 11 Aug 2023 10:38:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F05FEAC52 for ; Fri, 11 Aug 2023 10:38:55 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 11 Aug 2023 10:38:55 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2877945F19 for ; Fri, 11 Aug 2023 10:38:55 +0200 (CEST) Date: Fri, 11 Aug 2023 10:38:54 +0200 From: Wolfgang Bumiller To: Gabriel Goller Cc: pbs-devel@lists.proxmox.com Message-ID: <7j2h3w2xnbduu5272wqderz2s7mbco32pvum5iwags6kgohrfm@prv3qcmazj4o> References: <20230809101913.81818-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.106 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH pathpatterns] match_list: added `matches_path()` function, which matches only the path X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2023 08:38:56 -0000 On Fri, Aug 11, 2023 at 10:32:59AM +0200, Wolfgang Bumiller wrote: > On Fri, Aug 11, 2023 at 10:26:22AM +0200, Wolfgang Bumiller wrote: > > On Wed, Aug 09, 2023 at 12:19:12PM +0200, Gabriel Goller wrote: (...) > > > > Given the amount of tiny match helpers we run through with those 2 > > traits already I wonder if we should just make a breaking change here > > instead and only have the versions with the `Result` while users (or > > defaulted helpers in the trait) just pass `file_mode.unwrap_or(!0)` > > (since a mode of 0 should match anything ;-) ). > > (of s/of 0/of !0/` of course) In fact, I'm technically wrong, since the value here just gets masked and isn't actually a bit field, (similarly wrong will be my comment further down in my original reply), However! Since this won't be a valid value, we could still use it and just special-case this in the `matches_mode()` function. If, however, we go with an API-breaking route, this is definitely better implemented as either `enum Mode { Match(u32), Ignore, Fail }` or an additional "required: bool" parameter... but we need to hand that through all the layers of helpers...