From: Nikolai Weibull <now@bitwi.se>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@zsh.org
Subject: Re: Git completion slowness
Date: Fri, 10 Dec 2010 15:00:32 +0100 [thread overview]
Message-ID: <AANLkTintf8qbRZc-N2O77xtPJEpVjTw0pCbhfq9vrEEo@mail.gmail.com> (raw)
In-Reply-To: <631.1291985288@thecus>
On Fri, Dec 10, 2010 at 13:48, Oliver Kiddle <okiddle@yahoo.co.uk> 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
__self__
next prev parent reply other threads:[~2010-12-10 14:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 22:06 Brett Simmers
2010-12-09 22:18 ` Benjamin R. Haskell
2010-12-10 0:10 ` Brett Simmers
[not found] ` <87k4jhsx78.fsf@ft.bewatermyfriend.org>
2010-12-10 11:37 ` Nikolai Weibull
2010-12-10 11:49 ` Frank Terbeck
2010-12-10 12:09 ` Nikolai Weibull
2010-12-10 11:54 ` Thomas Gstädtner
2010-12-10 12:11 ` Nikolai Weibull
2010-12-10 12:48 ` Oliver Kiddle
2010-12-10 14:00 ` Nikolai Weibull [this message]
2010-12-10 11:29 ` Nikolai Weibull
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=AANLkTintf8qbRZc-N2O77xtPJEpVjTw0pCbhfq9vrEEo@mail.gmail.com \
--to=now@bitwi.se \
--cc=okiddle@yahoo.co.uk \
--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).