Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG]Filename autocompletion using git-bare repos (--git-dir=... --work-tree=...)



On Thu, Mar 9, 2023 at 4:42 AM eliasghafari <eliasghafari@xxxxxxxxxxx> wrote:
>
> 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'",
> [...]
> (( $+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

The Q modifier is just cleaning up quotes, so you probably don't want
to remove that.  I think the right thing would be to change
${(Q)${~opt_args[--git-dir]}} to ${(Q)${(e)~opt_args[--git-dir]}} but
I would defer to Daniel or Oliver to confirm.




Messages sorted by: Reverse Date, Date, Thread, Author