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

Re: Git completion slowness

On Fri, Dec 10, 2010 at 13:48, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> "Benjamin R. Haskell" wrote:

> So for _git-add, we'd need something like:
> __git_filestatus() {
> Â[[ $(git status --porcelain $REPLY) = ?M* ]]
> }
> __git_modified_files () {
> Â_files -g "*(.e:__git_filestatus:)"
> }
> That may need to run git status for every file but that's way better
> than recursing through every subdirectory. Note that it is possible to
> add non-existant files - look at _subversion for an example.

Hm, I thought we had some functions like that already.  Perhaps that
was in an earlier version.  I will look into using this.  Letâs hope
libgit2 finally arrives and someone (OK, I) implement zgit so that we
donât have to do so much forking (think Cygwin).

> This also loses you the division of files into ignored-modified-files,
> ignored-other-files etc but you can actually put that back in with a
> suitable file-patterns style provided __git_filestatus doesn't hard code
> the regex/pattern (and options needed for e.g. ignored files).

OK, good.  We can have a look at that subdivision later (because I
think itâs desirable, especially for _git-add).

> I would work on this but if Nikolai has a rewritten _git, I'll hold off.

Thanks.  Iâm sorry that itâs taking so long, but I want to clean it
all up so that future revisions will be easier to make.

> By the way, what's with all the double underscores in _git. Is there
> some meaning to those or has someone just been doing too much Python.

Yes, although itâs slightly redundant.  _git-* is completion for git
*.  __git_* is an internal helper function.

> Oliver


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