zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: m0viefreak <m0viefreak.cm@googlemail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [RFC] Case-insensitive path completion in _git
Date: Mon, 14 Dec 2020 04:25:08 -0600	[thread overview]
Message-ID: <48F77550-F5AF-424A-A474-9D379D69F5AD@dana.is> (raw)
In-Reply-To: <c7ece4f3-86e4-36d8-527a-e99f8a8f11d1@googlemail.com>

On 13 Dec 2020, at 07:55, m0viefreak <m0viefreak.cm@googlemail.com> wrote:
> This solution only handles simple upper-lower-case conversion matcher-list styles,
> but it will not work for more complicated styles like 'r:|[._-]=* r:|=*'.
> That's probably fine for most use-cases.

That's true.

On 13 Dec 2020, at 07:55, m0viefreak <m0viefreak.cm@googlemail.com> wrote:
> Performance-wise, it's obviously worse than than your proposed solution, but
> still better than the fallback, since it still passes $gitprefix to ls-files,
> which should also avoid the CWD problem.

Are you sure? It seems to me that $gittoplevel$gitprefix is normally the CWD,
so you'd just be running `git ls-files /path/to/cwd/*`, which will never match
a PREFIX like `../foo`.

I guess we could make it so that it retains any leading segments in PREFIX,
but then you have the same two issues again (those segments have to be matched
case-insensitively, and it doesn't account for more complex matcher-list
styles).

I also just realised that we can't match stuff like `./foo` or `.//foo` or
`../cwd/../`, since `git ls-files` elides unnecessary slashes/segments in its
output.

On 13 Dec 2020, at 07:55, m0viefreak <m0viefreak.cm@googlemail.com> wrote:
> The trigger of the fallback is broken anyways, isn't it? ...
> It just considers the case where no match was found at all, but it does not
> handle the case where *some* matches were found, but not all.

As it is in the repo, yes, actually. If you have like foobar and Foobaz, then
foo<TAB> will return only the former without triggering the fall-back.

dana



  reply	other threads:[~2020-12-14 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13  4:40 dana
2020-12-13 13:55 ` m0viefreak
2020-12-14 10:25   ` dana [this message]
2021-03-27 21:08   ` Daniel Shahaf
2021-03-28  5:07     ` dana
2021-03-28  8:08       ` Oliver Kiddle
2021-03-30  5:59         ` dana
2021-04-10 20:43           ` Lawrence Velázquez
2021-04-10 20:56             ` dana
2021-03-27 20:06 ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48F77550-F5AF-424A-A474-9D379D69F5AD@dana.is \
    --to=dana@dana.is \
    --cc=m0viefreak.cm@googlemail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).