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 17816 invoked from network); 1 Sep 2021 14:03:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2021 14:03:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630505029; b=jlYv75JEfuVcpAYe72iRPgoPBgn5JGzH5L7HNvJHBP39cgrdyydjld2LpgUBMWXBDBakQ8k4iF iax4Sq1hO7d4BS6NtNpkD2QYVb9nhDjzv4qF8m/Ebh68vuT2zfRMwFMGR4GtR4h6tsHa0tC1Sf MHTuFlfUHGs+vtlZsI/9hr737xqfsfK9d4ZApcZHebYXrw4ZqfbaGQ8rPdHs1W5L1uUZsABzcj g9xz3b2ey2nZotkGa3HaRS9hb0sBT/xLy4lXFtJOtUPQeaT8v3hdWJXbsqxI4pondJOFtceEoX nO8MXXBTvNvVuvoPUBtl4fmB165kLlpSlXGYbkNFTBwPWA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 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=1630505029; bh=7CzioSRQ4rKIbj0hWhTxMFaqXdXTzDFPdU8Muh/zzUw=; 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=cKJRZpgXw5oENKLukKPOEiFrEo1u1O+J1nyACnPdDeQjyv+j83+azYZSoWYq8j2i8culktIUmu tdYT9c+XdmRRUFA1D13wGIwiq0F7BXkxWTvaBDG/NKT69uYFOYV4l8RlKBCf5A0Y7dZMd/Gj0I /6F3YW5WPbbe3NZ8zvV8peW+KFbC/pZRgrTwHzNEF+5sNUGTnh+s/mzfJgdT1WRx17T6neTGvf yPq1A3baWw87wQfPkawPKUalGZE6Bw3WsQNKic2/g1BAt3CWzcnlLo1yq7bA7DjWn053POpb8q gBWD3OcqfGA8oOmR32gb4rPKMy162I4NevT6Nyjx+VEkjg==; 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=+c6w+Xd/qXYNVJrpWqx/JH4BEZ0rJmBzLDQuJL2WqJA=; b=rQdmDcwKWXahdzXXfdc4H9SiLG JI2L6idGJsP3xO5kufId7p2QIgKAYwIXRDGLg1hauLNOqPsgYr0afE8w8bk5I7RAGcn5tbWX1vIQB EpmPhl3Qjl4Qg2D7IigJ7h3pRMpU1W74/U9uuxZqhxmuW2r29TqpACrGxBRQklKwJOaBDaTuQGOv2 cCNjaVSrkDeoS1zPDm26zsts8IdXy2wf+MeSJjJA3Y4X9MSDPptkZDgLR7YwGKZppkHpwdrS7Nd2p eAHtxH59lo1/lGwk73iJzGi7v/RWgmBXt5EWnHDMNnxcJa4mG84t3T69Xh1UrxMdP5FiXGBs7uNif pHElhVBw==; Received: from authenticated user by zero.zsh.org with local id 1mLQqC-000ISM-SL; Wed, 01 Sep 2021 14:03:48 +0000 Authentication-Results: zsh.org; iprev=pass (wout4-smtp.messagingengine.com) smtp.remote-ip=64.147.123.20; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:60119) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mLQpu-000IBe-Qk; Wed, 01 Sep 2021 14:03:32 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id F200E32009A5; Wed, 1 Sep 2021 10:03:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 01 Sep 2021 10:03:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=+c6w+Xd/qXYNVJrpWqx/JH4BEZ0rJmBzLDQuJL2W qJA=; b=Q0z9LfxPeQuXxowqMyvC/jtc0IMCtT33gKbke8vDpgdMIZlOYsHGs//0 bBI92oi5x08pTTrG+P+dX33mbf+wjAE6VHB8qsitxwAEGKTgDNUjKk5E/At/gyQ4 O66Jpyj5Klwz+wqZSP30nzp3B11Qq8Eebx62B8ZebuX1nJGmCQJ+CcWwmRU+MJK3 kriyVwhg5Tw8CO5qX1mmwhW2nGwEplypBtgfiH6x8hob5ORvONeMBXLD4YSI+OqP 3SLSZYMTP6h7wIqdxTinNnL+Hgo+JGwd8RPxv8Ieu44RzohZQSVufF3cq4G/jozl /r1Lt17ioPKNnX1Gyw3Sv+qjJTLF/w== 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=fm3; bh=+c6w+Xd/qXYNVJrpWqx/JH4BEZ0rJmBzLDQuJL2Wq JA=; b=gQ8cuMOmWciwxQLl8LamWQLxxNlPsIPx57AyhjWWxCWiGljheiwvYlf5O 5muWQsDXIiKYhlCYBpfYaohJVPcnIQwx2QJrNdR1+ibc7u/GniSZKcW1ThapDCKl NDIsLySIM+d1myhm/NSkdRyyYEJZS+AWROhl0sFq2964IKVKAtBU2i4ptEgiZoGr RoZiYo6WNkpM+WNOPDVRPwgVwhMTGCnk9yFtkHeKcQ9R0J5tgUNNSQiVRvtz6WoI Ur5qFCSnN1HIS2xtEp+UZ9GPcInpA+0u4NCZQQZDhRpZ2vYTbeXJrI+wLKcec5tW /9DirsvYjgnK8ebHr+In340XtrLMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvfedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjggfsehtkedttddtreejnecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpefgkefgfeejgfdvvdfguddtleelkedvfeetiedtudfhveev veduhfdvveeffedvueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Sep 2021 10:03:28 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 4H05PW3pKbz4hR; Wed, 1 Sep 2021 14:03:27 +0000 (UTC) Date: Wed, 1 Sep 2021 14:03:27 +0000 From: Daniel Shahaf To: Marlon Richert Cc: Mikael Magnusson , Zsh hackers list Subject: Re: [PATCH] Remove redundancies from `git` completion Message-ID: <20210901140327.GB27958@tarpaulin.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 49348 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: Marlon Richert wrote on Tue, Aug 31, 2021 at 08:52:02 +0300: > On Mon, Aug 30, 2021 at 3:42 PM Mikael Magnusson wrote: > > > > On 8/30/21, Marlon Richert wrote: > > > On Mon, Aug 30, 2021 at 2:41 PM Mikael Magnusson wrote: > > >> > > >> On 8/30/21, Marlon Richert wrote: > > >> > By the way: Why is there a `(( $+functions[_git-XXX] )) ||` statement > > >> > in front of each function inside Completion/Unix/Command/_git ? Can > > >> > those be removed? > > >> > > >> They are there so that you can override their implementation easily. > > > > > > Is that documented somewhere? > > > > Not explicitly, afaik. > > I see this pattern is used in several completer functions.Should it be > documented? Maybe. If we document it, that means we'll have to also document compatibility promises for those functions, because people can't be expected to upgrade their dotfiles and fpath's in lockstep (e.g., on shared machines). I don't think we generally treat those functions as stable API's. Therefore, it might be better to deprecate the practice of making them overridable in this way. Anyone who wants to override them will still be able to do «autoload +X _git && _git && _git-foo() { … }» (or a better solution which someone will probably post in reply to this one). > > > > > And for purposes of overriding, wouldn't it be cleaner to simply > > > supply all sub-functions as separate #autoload files? > > > > I don't think anyone is interested in maintaining 285 separate > > completer files for git :). > > If you count the #autoload line, We don't count lines.