Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh git filename completion with “--git-dir=… --work-tree=…”: not a git repository
- X-seq: zsh-workers 41522
- From: "Tom M." <boojum@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Zsh git filename completion with “--git-dir=… --work-tree=…”: not a git repository
- Date: Thu, 10 Aug 2017 14:15:13 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stercus-accidit.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=TL8BPQmrYB7SeNXzJneJ4jgQ8AR6t1w7aB+lQPJELXI=; b=jCK3JE7iqBW5Z2cQzqjhrDEr8bxuuR7BPzDPL+A2xacIrmbYVIg2w8xyMt+Q3sfNjZ oK1Ab5F27/iWMTOFOrVpcpUE5+6V6YRvtD1kV0Hm1BRxBy8w0FM8/l876i8gj1OMFWDB yG//yKf/vRiTdA/iyAjhJCn3o5hin+CPlao6M=
- In-reply-to: <CACfAdfZ8xpPTZm2bKvYFoeUWgWDbYHwGRCU8+mLvkAV5YrOnig@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CACfAdfZ8xpPTZm2bKvYFoeUWgWDbYHwGRCU8+mLvkAV5YrOnig@mail.gmail.com>
On 10 August 2017 at 11:51, Tom M. <boojum@xxxxxxxxxxxxxxxxxxx> wrote:
>
> % grep dof .config/zsh/aliases
> alias dofenv='GIT_DIR=$HOME/.dotfiles/ GIT_WORK_TREE=$HOME'
> alias dof='dofenv git'
>
I redefined the above aliases as a function:
dof() {
if [[ $(pwd) = ${HOME} ]]; then
/usr/bin/git --git-dir=${HOME}/.dotfiles --work-tree=${HOME} $@
else
/usr/bin/git $@
fi
}
But this doesn't work either:
% dof status
fatal: Not a git repository: '/home/user/dotfiles'
The weird thing is that this is working:
% dof --work-tree=$HOME status
On branch master
Your branch is up-to-date with 'origin/master'.
But completion for add still doesn't:
% dof --work-tree=$HOME add [Tab]
---- not a git repository
The issues seems to be solely with git add or, in my case with dof add.
Things like {dof,g} log or show work like expected. Am I missing something
here or is it a bug in zsh completion for git add?
T.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author