zsh-workers
 help / color / mirror / code / Atom feed
From: Yves Delley <pu.y@delley.net>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: Bug report; git tab-completion on macOS within paths containing unicode characters
Date: Sun, 28 Apr 2024 09:22:24 +0200	[thread overview]
Message-ID: <CAB+zqbqmturuSzuOPuHs91beERmu5XHp_Jm0E5mA2PBfib0b_g@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7aHgOJd=tAwfr7_FziNxeQC9dn_coioT0ndFBJhf68V3g@mail.gmail.com>

Hey, thanks for looking into this! I did a quick test, where I
manually applied the patch to
`/opt/homebrew/Cellar/zsh/5.9/share/zsh/functions/_git` of my
currently running install (the only file by the name of `_git` that I
could `find`). As far as I could tell, that had no effect (I did open
a new terminal, but I didn't do a fresh OS login). Also, for me, `git
ls-files` seems to work normally independent of having unicode
characters in the path or not. I did find a somewhat related issue on
the fish issue tracker:
https://github.com/fish-shell/fish-shell/issues/474, suggesting that
this is in fact specific to the filesystem being used. The thread
suggests that bash managed to fix this issue. The obvious solution is
that whatever function/program does the globbing should apply some
form of unicode normalisation to both sides before the match (is this
what `qqqq` does here?). However, apparently that's easier said than
done.


On Sat, 27 Apr 2024 at 21:31, Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Sat, Apr 27, 2024 at 12:14 PM Bart Schaefer
> <schaefer@brasslantern.com> wrote:
> >
> > I'm uncertain that this is zsh's fault.  "git ls-files" is returning
> > that the directory is not a git repository, at least when I try to
> > reproduce.
>
> See if this helps -- I'm not sure this is the only (or even best)
> place to apply a change, but I'm curious whether it improves your
> results.
>
> diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
> index 7370aaead..47c386106 100644
> --- a/Completion/Unix/Command/_git
> +++ b/Completion/Unix/Command/_git
> @@ -7526,7 +7526,7 @@ __git_files () {
>    # TODO: --directory should probably be added to $opts when --others is given.
>
>    local pref=${(Q)${~PREFIX}}
> -  [[ $pref[1] == '/' ]] || pref=$gittoplevel$gitprefix$pref
> +  [[ $pref[1] == '/' ]] || pref=${(qqqq)gittoplevel}$gitprefix$pref
>
>    # First allow ls-files to pattern-match in case of remote repository. Use the
>    # icase pathspec magic word to ensure that we support case-insensitive path


  reply	other threads:[~2024-04-28  7:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  7:17 Yves Delley
2024-04-27 19:14 ` Bart Schaefer
2024-04-27 19:31   ` Bart Schaefer
2024-04-28  7:22     ` Yves Delley [this message]
2024-04-28 15:28       ` Bart Schaefer
2024-04-28 18:59         ` Bart Schaefer
2024-04-28 19:01           ` Bart Schaefer
2024-04-29 17:37             ` Jun. T
2024-04-29 17:54               ` Bart Schaefer
2024-04-30  0:41                 ` Jun. T
2024-04-30  1:57                   ` Bart Schaefer
2024-04-30  2:31                     ` Jun. T

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=CAB+zqbqmturuSzuOPuHs91beERmu5XHp_Jm0E5mA2PBfib0b_g@mail.gmail.com \
    --to=pu.y@delley.net \
    --cc=schaefer@brasslantern.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).