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 16464 invoked from network); 9 Mar 2023 12:41:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Mar 2023 12:41:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678365703; b=PHrMzrAYsyXUtv6rK3jt4rdctyKfZIye3lq6jR2pwufN2Lb5kS18LrM3vcYOoaTq+7pa/pQ4mk FKn30FfZ1aYqU+MaegzY7E0AxZE+CWVYZe1qOgwA0b/HczYboItSwXowfUfq5vLiday9iWEADw AHDS5DTrJ9KptcAjgB3ypzJf87otRD8RAX7wzRGbThRx4EQGmx+LIp8j/f1mGNyc7j6/uIyiRB XYw2/FUKH810NK71ez732ovOVxMZID76dlZE800SQBWzp5DgP/rYxgD06FHiEtWR/vblIT11SY Q6emryoYpx8AZuutfVZqrxNWfpVH9Zd8574Dkhl1unFfgQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (knopi.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=1678365703; bh=FgU5OaeOj+RnxL11QMIt0odZpuAU2NPhc3c62ty8kww=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From: DKIM-Signature:Date:DKIM-Signature; b=b5BH+TaNEHiIwAAN5w7e5DjuouBit8IcDgYTQykOi7ctE56dOospimIqKHLFAXW2I+sCkXsngE HqepNnrXfqF3FepewLszbbr3CyVD8wySjLcq0J5/MRi/kOYIT0c6L6IpQaKYl0uOQ0ge2jBuoY m2o1IyHllpC9iIk5EsLwYA5esGee41vOU3KpA6Ro0OHHf5A90cKmjg54yfTtllGPed/+s88uiy 6ivS8qNIXCaEiiKWUVNfKqtcR6EjA+qWTHTX8yeutPHFJ3hJWF4Sp+VUZqD9bA75HrW63pgPnu tdiArOhffWTIJ4pRBIrt17a2JX1vA0NexGX495IbGJtbiw==; 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-Type:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=FgU5OaeOj+RnxL11QMIt0odZpuAU2NPhc3c62ty8kww=; b=BudNCXH0s4GkIFK1N1C3BxrO1+ prId9u/Uc7Oj7sU8bse/JCQ2xg88jaKSVcqeSBEBdLPng+hUgeKIercofgaH4W0Mo6W13mZLI1Awj U89/7SI9S4umM+vnJ2Mcx6nulNh9xTffk7sQ1F+5GbD1/h2nx24C4AKTDpKmb3LY6a9yIJUiK0hKZ Ajwbw5WOVtvuOURWVN/sGOfKzbHz9f8CTJw/5zEce2pGaVpA/obiv4OAZUDLQfh9e2fwZkgOCYQh1 rLr/E2IGHDJje7unp07Us4xov8ehEqUu3aPXCO+m0GR5mU2u/TrfJIg5fptpp9VJfy/2eNRqyHC+P 1bTTBanA==; Received: by zero.zsh.org with local id 1paFaY-0001LE-ND; Thu, 09 Mar 2023 12:41:42 +0000 Authentication-Results: zsh.org; iprev=pass (knopi.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 knopi.disroot.org ([178.21.23.139]:37772) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1paFa0-00011N-Ts; Thu, 09 Mar 2023 12:41:11 +0000 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 102D244570 for ; Thu, 9 Mar 2023 13:41:08 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id WLHFzsGrdRyr for ; Thu, 9 Mar 2023 13:41:07 +0100 (CET) Date: Thu, 9 Mar 2023 14:33:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1678365187; bh=FgU5OaeOj+RnxL11QMIt0odZpuAU2NPhc3c62ty8kww=; h=Date:From:To:Subject; b=AdbQRihCKMMVEQNJM8Gq6VeQEAm+kngMHuIBDDT6Ju8CNG/l5p7Eyr2oWaBe3G5QM 7haLTJ0oQERWshPJ2cDCK34GSgRElUQe6QKPIMgP8lE27exgg0Q0gh3r0iEfJhuM9Z hBOH4BfCm8eBCdUUfiHHVvGovapU35LbGENbKq1gwG707y+HN/8POKSSOczVgfMH43 eooipHdIWXHhPKdxSXyaxIbsl10L+514Z2MOZWYajMCpIz/1CDv/7ZMro+6dfL15I6 kz/jZ36wwiQXjZ7sdidbyUmYcm9gjdNWI17ctNzGpSdahJ2dFQHXhNW1blAKGWygSq qW4Yf3OLQqmxQ== From: eliasghafari To: zsh-workers@zsh.org Subject: [BUG]Filename autocompletion using git-bare repos (--git-dir=... --work-tree=...) Message-ID: <20230309123303.77hztdd63lvxafg4@eliaspc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Seq: 51541 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: Hello, I'm using a git bare repo to manage my files with this alias: "alias config='git --git-dir=$HOME/.local/share/dotfiles --work-tree=$HOME'", completion for the commands works perfectly, e.g: config ad config add config rm --ca config rm --cached But when it comes to filenames the autocompletion e.g: in a normal git repo: git rm --cached will show all the files that could be removed from the index. And git add will show all the files that were modified or created. While using git bare repo: config rm --cached doesn't show anything. config add also shows nothing So after investigating a bit, I found that the problem lied in the expansion of the address of the git-dir and I found that by modifying this line: (( $+opt_args[--git-dir] )) && local -x GIT_DIR=${(Q)${~opt_args[--git-dir]}} && printf("\n${(Q)${~opt_args[--git-dir]}}\n") which shows that the address passed to GIT_DIR is "$HOME/.local/share/dotfiles" without the "$HOME" being expanded to "/home/user". I fixed this by replacing the Q modifier with e, but please note that I have no idea how the zsh completion system works and I fixed this by simply trying every modifier and seeing which one works. After making that replacement, config rm --cached shows what can be removed from the index, and config add works too.