zsh-workers
 help / color / mirror / code / Atom feed
From: "Tom M." <boojum@stercus-accidit.com>
To: zsh-workers@zsh.org
Subject: Re: Zsh git filename completion with “--git-dir=… --work-tree=…”: not a git repository
Date: Thu, 10 Aug 2017 14:15:13 +0100	[thread overview]
Message-ID: <CACfAdfa3-KTa6UJAEhkkjjVcxqa_8JdJweRE6ukTLmnAsj+8CA@mail.gmail.com> (raw)
In-Reply-To: <CACfAdfZ8xpPTZm2bKvYFoeUWgWDbYHwGRCU8+mLvkAV5YrOnig@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

On 10 August 2017 at 11:51, Tom M. <boojum@stercus-accidit.com> 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.

  reply	other threads:[~2017-08-10 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 10:51 Tom M.
2017-08-10 13:15 ` Tom M. [this message]
2017-08-10 17:14   ` Daniel Shahaf
     [not found]     ` <CACfAdfbiQDH1M32QGxZg21G3xqVFcq5JB+ZSaYbGd5-czNgLbg@mail.gmail.com>
     [not found]       ` <1502401291.1328986.1069732648.63580361@webmail.messagingengine.com>
2017-08-10 21:59         ` Tom M.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACfAdfa3-KTa6UJAEhkkjjVcxqa_8JdJweRE6ukTLmnAsj+8CA@mail.gmail.com \
    --to=boojum@stercus-accidit.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).