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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23139 invoked from network); 12 Sep 2023 19:26:04 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Sep 2023 19:26:04 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1694546764; b=cGs9T181Wpu1ZmRVsiGwuwCquFPq2VYi68zm0uBKF3KUSQeGaNizt9mXSreeqFsh6iryxi7xqA IV1a33GFaM5jc5i5ujVvHsm6ULHx28x45Ncn1qR8CYh2zrPPKnkUC55ieywuEyjrj+NAV0HsjF hJA7FCVaohz4oHQjABwQeaXhNtdkeBe2Yp/2LZkIi77aNeAGd1UH8kULhFVHxYRojfGCBkCXN6 hX7eoMyH0DAM1FrFvWZROU0dzkP0KU7qvy3DpshNjaURtjemSoTDscdv+zTl93sCLSwY4YzeId UDQuEKyAuHk14K8bt+bEKnuCEWcqJ+XRvX1sDxUR5QgVGw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (layka.disroot.org) smtp.remote-ip=178.21.23.139; dkim=pass header.d=disroot.org header.s=mail header.a=rsa-sha256; dmarc=pass header.from=disroot.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1694546764; bh=/1x0lDILBeOdl8PDJ90hvfqi2XbhEsnywFUHMG8r2DY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:DKIM-Signature:Date:DKIM-Signature; b=l+VTZLaFLc4Gu0Gfl/2pmJ1KzvH/PRK8ifZCQ3B4mvA+MwJ+xoa0QSM5lPIuFsPwFNDmjmxFxE e2mUeaQMGkZ7rTqDgNXjpOQT0pBggcNljofVt5Fru0Uied/ChR+PLy+54RGdqYnGVeNYMHulCp Z+UByE7iZtYeXEvG5KsG6DyDQtxljNkRK6Nk+nJfCbcg1+6AKcKdsFmgBJPVCdcIIYQ3M8tjR2 i8K1oxo9hswtLGmkY2eN3hBpMNQnguP2KR9IySWIPs20Dy8CdGt9vZC2sl86jbnMkmjWMg7YkG gPn5WeXdneBxywUbgHvmBAXFFJTSnqwVy373XSz5VqRu9A==; 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-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Q7mE3O2zUG6rJMUlJbQayO/95++xMN3/ig7Yzdd6O/U=; b=UkIxhtExrnoVugN7gg1MmsZTfG tziMM7PRrZfhjIk9DiSIg3E6PG4deDoGPg+p9kTogRP10WXA6/3bGRYUyjZFSHVqfC0dudj26doqy M7hYxP2inWddkA8grlPnWt6j5AbK7lXVlQxPl1SAiAOhhvCBd54CAzoUQco8+vGmBxSGT28UKXi42 m51HlAs9CqLJFwmnmPhWO6btpLWmw670bquDinsX3X5Fppf/yU1LvCCIsPz9LLy58DLMlVcCxh5wx ukHEaymr52tSSZsTuvZYVj8UB9UUuUdsTEKgB2M8Zaao4bJ/iFx/Fe9Jes5ZBvaNgUpo2jLpNbavA ismpDZsQ==; Received: by zero.zsh.org with local id 1qg91P-000PIg-Iw; Tue, 12 Sep 2023 19:26:03 +0000 Authentication-Results: zsh.org; iprev=pass (layka.disroot.org) smtp.remote-ip=178.21.23.139; dkim=pass header.d=disroot.org header.s=mail header.a=rsa-sha256; dmarc=pass header.from=disroot.org; arc=none Received: from layka.disroot.org ([178.21.23.139]:36544) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qg919-000Oym-Gl; Tue, 12 Sep 2023 19:25:49 +0000 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id AABDC40152; Tue, 12 Sep 2023 21:25:46 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m0GAepuZn6Yt; Tue, 12 Sep 2023 21:25:45 +0200 (CEST) Date: Tue, 12 Sep 2023 22:25:35 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1694546745; bh=/1x0lDILBeOdl8PDJ90hvfqi2XbhEsnywFUHMG8r2DY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=AQTGdz958kPTs3/jcCHJXmlENm/KFtlEvM7ptZ2+8N32xdL3qnx7GgY8z0qjMMr0P va+MtzD0mkzL3DA8+0UY61AyacxNphmfx+fUxl50ZjGt9gWDw6nIkFvN1QCLrdhWI6 SMUpmV9WzF78tHjbxOnNXUv0MSF9aKBpisqVZokLTLZgp2qF94rhvqO/3oXLHNeI6C VQeEOFIejOUFDrgECaPi18xsGh2ZDGXZenJGWjxZWLD0VpFXbjmTB8jjo3Sc0c0L0F 0YgcEb/Qp7pGD+TThwDVuBPBvHnN2UL4RZoiou4PPLniH18R4hoKwMcCMwkb/PrDpe 8Zh7okZ34TlYw== From: eliasghafari To: Roman Perepelitsa Cc: zsh-workers@zsh.org Subject: Re: [BUG]Filename autocompletion using git-bare repos (--git-dir=... --work-tree=...) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 52136 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: On 23/09/12 11:34AM, Roman Perepelitsa wrote: > Given these two definitions that differ only in quotes: > > alias c1="git --git-dir=$HOME/.local/share/dotfiles --work-tree $HOME" > alias c2='git --git-dir=$HOME/.local/share/dotfiles --work-tree $HOME' > > Can you confirm that the following two commands work as expected? > > c1 diff > c2 diff Yes they both work and give the info they're supposed to give. > Can you furthermore confirm that only the first of the following works > as expected while the second does not? > > c1 diff > c2 diff Also yes c1 autocompletion works perfectly, while c2 doesn't. For further info during my reading of the log produced by `config diff ` I noticed a couple of things, which if you want to investigate this, it might help you out. Using this alias: 'git --git-dir=$HOME/.local/share/dotfiles --work-tree ~' +_git:64> local -x GIT_DIR='$HOME/.local/share/dotfiles' Notice that $HOME is not expanded, notice that the path is surrounded by '' +(eval):1> git --no-pager rev-list -20 '--format=%h%n%d%n%s (%cr)%n%p' HEAD fatal: not a git repository: '$HOME/.local/share/dotfiles' GIT_DIR not being expanded makes the autocompletion error out here where git doesn't recognize the path as a git dir, but the command itself does work if I `config status` it will give me the expected output. So the conclusion is that $HOME is not being expanded in GIT_DIR but is expanded in the command line (maybe ?). Using this alias: 'git --git-dir=~/.local/share/dotfiles --work-tree ~' +_git:64> local -x GIT_DIR=/home/elias/.local/share/dotfiles Notice ~ got expanded, and autocompletion works perfectly, but this time the command doesn't work it gives this error: warning: Not a git repository. Use --no-index to compare two paths outside a working tree So the ~ in GIT_DIR is being expanded but in the command line it's not. And like I said 'git --git-dir ~/.local/share/dotfiles --work-tree ~' both works with autocompletion and the command line. One last thing with config='git --git-dir ~/.local/share/dotfiles --work-tree ~' if I do `alias config` to show what the alias is set to, the output is exactly the same as above config=... But with config="git --git-dir=$HOME/.local/share/dotfiles --work-tree $HOME" alias config outputs: config='git --git-dir=/home/elias/.local/share/dotfiles --work-tree /home/elias' Which is interesting it's already expanded that might why it's working. Anyways hope this helps!