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 Fri, Mar 10, 2023 at 11:08 AM Elias Ghafari <eliasghafari@xxxxxxxxxxx> wrote:
>
> On 23/03/09 08:27PM, Oliver Kiddle wrote:
> >
> > I would suggest you try using ~ instead of $HOME in your alias:
> >
> >   alias config='git --git-dir=~/.local/share/dotfiles --work-tree=~'
> >
> > The tilde in ${~opt_args[--git-dir]}} ensures that tildes are expanded.
>
> I have actually tried that before and i noticed that the completion
> works as if i had put the (e), but the problem is, while the completion
> works the command itself doesn't and returns an error saying that
> '~/.local/share/dotfiles` isn't a git repo:
> fatal: not a git repository: '~/.local/share/dotfiles'

You can either replace `--work-tree=~` with `--work-tree ~` or set
magic_equal_subst. I'd do the former.

Roman.




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