From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 0E3F821CDD for ; Sun, 28 Apr 2024 09:23:48 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1714289028; b=oWZq1xFkESoZlAfcg0RLwSTIEJpBzN8AR06HacAXm1i5P7ssqD9q5O/fe0kphTYT5FD+sHRfNO VBhdYdxf7GnaO+zoDB01NUp9BrCbPI3wFsx2Qo1ZJ9eX87QdjWm+29jY8snJn3l8bu3Drq/ELC iK7MFFINTpywSAN7ND5EmCIigZtKMcSNE2UTBw2Bvtwpjh6voHZry7JtEyMhpSOBdEo+Nfc0LC WFtFqsyT55Jh8gTG9BnEBN3T7ttY5Mv5M7Q9bZVsIC9+DJXIjK0AmFV6Y2hGHVjQUhC42teAW9 r5d5H9s21Jqzbq2WlJCpLA5a8Txs6MP6ymhHHrrB82S/1Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (www15.servertown.ch) smtp.remote-ip=94.231.94.134; dmarc=none header.from=delley.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1714289028; bh=Kpt2EAnljXBgiF4rhCi8TJwm7UQB2IxvYy7toN0wJ0A=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:Reply-To:In-Reply-To:References:MIME-Version: DKIM-Signature; b=Zn00IY+Eqf6aF4zBFO+0XUHEMNhIiRB0buc/Xf5knzR9hBBWzu3GSRyLSiFoh0aNMpRetQyrMT 3d3Mi4THZtTBud7jRgMmHEAUBGVtc79CpCDmDjIlw2WWeDzz7t51v16YgxK2AHaaMG+g7Jafna cAJszJvXiB1Ae7PWFi3XvuFSSuoIhXDoUyuJh+hvAIfWsRFvDgR0khtYefqQC01bB7tyUihUdb oRL4IwsTZbRvYT8v+g5ifOSKoAkGig4XdZsdRyV47G2K5mIK/LCrDuN+tgVAFs57errYv3F84s 0uhc2lulgA7qDwfeD2OLfLMtLOEX+5qzEqflmeMSf/lqWQ==; 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:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:Reply-To:In-Reply-To: References:MIME-Version:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=EQsForQxEXgNIcslZOCjjaBnVF4i5ONPgWvCTOJaPlM=; b=N+XzTHSWMK8bjNehSgICp7nacA hg3vjwUtynHbva2uj9DmUhbnGZ7fR7wzkpFg3ynoFUKfRH/i29oS37/j2t4fUwaM7xm/R84GT11VT n6XF9LJDBdIPCUCPozSzHc3ZuxZoslKuWfkfuM4fin1mR7rEkL/wGNyUNoCNHi+X7e/S+jxa39ejq +NO2VX8AuIgzy6bfo57kEuqUe1awufYGFKZUIMtv4H0vS0EbY30R2rcyA+cx2PoyfNseVobwhSP3k DhpYMXpC3Xkejd6WIa+psvlbpW8xpNhzKMeFNzYlFRNuiYBQyh7tNDPoI6aRkxbeK8r3ZwPlBTgfD pKa4EgLA==; Received: by zero.zsh.org with local id 1s0yt1-000FXn-UW; Sun, 28 Apr 2024 07:23:47 +0000 Authentication-Results: zsh.org; iprev=pass (www15.servertown.ch) smtp.remote-ip=94.231.94.134; dmarc=none header.from=delley.net; arc=none Received: from www15.servertown.ch ([94.231.94.134]:59915) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1s0ysI-000FE5-4Z; Sun, 28 Apr 2024 07:23:03 +0000 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by www15.servertown.ch (Postfix) with ESMTPSA id A05651613F7 for ; Sun, 28 Apr 2024 09:23:00 +0200 (CEST) Authentication-Results: www15.servertown.ch; spf=pass (sender IP is 209.85.221.54) smtp.mailfrom=pu.y@delley.net smtp.helo=mail-wr1-f54.google.com Received-SPF: pass (www15.servertown.ch: connection is authenticated) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3476dcd9c46so2912923f8f.0 for ; Sun, 28 Apr 2024 00:23:00 -0700 (PDT) X-Gm-Message-State: AOJu0Yyvk+xuCezk+D1NQFvZ4zf1lCNVHfMe81LgbUTXVd8eKG5PSQaL pY4S8cWy4xq+2Mp32uGd9sDiN7fIWpRC11oAs/WkdP9ySbIhHmDhz8cQ3TymBFTWK1EEcPkyo8f KAWCTw3l3FP+/NsWyPjijHG218+k= X-Google-Smtp-Source: AGHT+IHqiEU3m/r1ghNW5pdXUF11/USxe6KsrsXSo8mm6XVbuqcuZsNq39Btq6aK6LdkhRmcMXc0Y4UTR3gKLdjwFUY= X-Received: by 2002:a05:6000:acb:b0:343:9a57:7d1f with SMTP id di11-20020a0560000acb00b003439a577d1fmr4775156wrb.69.1714288980386; Sun, 28 Apr 2024 00:23:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: pu.y@delley.net From: Yves Delley Date: Sun, 28 Apr 2024 09:22:24 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Bug report; git tab-completion on macOS within paths containing unicode characters To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-PPP-Message-ID: <171428898105.2679193.6694063052166489316@www15.servertown.ch> X-PPP-Vhost: delley.net X-Seq: 52901 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: 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 wro= te: > > On Sat, Apr 27, 2024 at 12:14=E2=80=AFPM Bart Schaefer > 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=3D${(Q)${~PREFIX}} > - [[ $pref[1] =3D=3D '/' ]] || pref=3D$gittoplevel$gitprefix$pref > + [[ $pref[1] =3D=3D '/' ]] || pref=3D${(qqqq)gittoplevel}$gitprefix$pre= f > > # 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