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

Re: git completion horribly slow in kernel tree



On 23/01/2008, Clint Adams <clint@xxxxxxx> wrote:
> On Wed, Jan 23, 2008 at 12:20:26PM +0100, Mikael Magnusson wrote:
> > I don't know if this problem is due to this change, but git add
> > completion doesn't work from subdirs when the file to add is above the
> > current dir, even if you write the ../ yourself (which i think you
> > should have to).
>
> Probably directly related to git ls-tree HEAD .. not doing what
> the function expects.
>
> How can we achieve the equivalent with git?

Hm, I don't really know... git ls-tree seems to not want to output ..,
if you specify --full-name, it does show the dir you specify, but
relative to the root of the project. So if you're in proj/dir1/dir2
and git ls-tree --full-name --name-only HEAD .., you will get files
shown as dir1/file1. I guess it's possible to use that output, but
maybe it's easier to just manually cd to the proj/ dir first :). I
just looked at the bash completer (which is very confusing code), and
it seems to use something like
git --git-dir=$(git rev-parse --git-dir) ls-tree $ref:prefix
which lists the file as file1 instead of dir1/file1. (no idea why it
doesn't use --name-only).

-- 
Mikael Magnusson



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