From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 10279 invoked from network); 28 Apr 2020 18:02:02 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 28 Apr 2020 18:02:02 -0000 Received: (qmail 21427 invoked by alias); 28 Apr 2020 18:01:56 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45736 Received: (qmail 25206 invoked by uid 1010); 28 Apr 2020 18:01:56 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25793. spamassassin: 3.4.4. Clear:RC:0(66.111.4.25):SA:0(-2.6/5.0):. Processed in 0.762136 secs); 28 Apr 2020 18:01:56 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedriedugdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfgjfhfogggtgfesthhqtddtredtjeenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cukfhppeejledrudektddrudeftddrudegjeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrg hmvg X-ME-Proxy: Date: Tue, 28 Apr 2020 18:01:18 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: dana , Amyn Bennamane , "zsh-workers@zsh.org" Subject: Re: Git-add completion should show full file paths Message-ID: <20200428180118.26e97826@tarpaulin.shahaf.local2> In-Reply-To: References: <585FABCB-9B6A-47F8-886E-B24E359F8F51@dana.is> 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 Bart Schaefer wrote on Mon, 27 Apr 2020 21:35 -0700: > On Mon, Apr 27, 2020 at 12:24 PM dana wrote: > > > > I guess what Daniel is suggesting is basically an on/off switch for > > _multi_parts's intended function, and you can turn it off for git if yo= u want. =20 >=20 > That seems a bit off the mark to me? Wouldn't the right approach here > be to call something OTHER THAN _multi_parts if you don't want the > strings treated as having multiple parts? >=20 That'd force everyone to use the "list of all files" semantics. However, I assumed that _multi_parts was used there for a reason (and dana's input confirms _multi_parts semantics are desired in some use-cases at least). Therefore, I looked for a way to make the behaviour configurable. > More specifically, _git_files already has the whole list in the $files > array, so instead of running > _wanted $tag expl $description _multi_parts -f $compadd_opts - / files > it could instead just do > _wanted $tag expl $description compadd -f $compadd_opts $files > (probably with some cleanup of subtleties I've ignored). (e.g., s/$files/-a files/ in case filenames start with a minus) > > I wonder if it could be more intelligent though =E2=80=94 maybe this st= yle could take > > an integer that acts as a threshold for whether it should work the norm= al way > > or the 'dumb' way? Like if there are more than x files with the same pr= efix or > > whatever. Not sure how you'd calculate it, but something like that. =20 >=20 > That could be put into a wrapper function around the two possible > _wanted calls above, if it were desirable to have it somewhere other > than in _git_files. Things do get a bit tricky if you're not passing > the -f option to compadd; you need something, other than the file > system, to which to compare the original strings. >=20 Seems like this would also allow people to use =C2=ABzstyle -e=C2=BB to cho= ose between the two behaviours dynamically, which could be used to implement the "if there are more than x files" semantics dana described. Cheers, Daniel