From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1610 invoked by alias); 14 Nov 2010 19:40:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28411 Received: (qmail 1158 invoked from network); 14 Nov 2010 19:40:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at zsh.org does not designate permitted sender hosts) Date: Sun, 14 Nov 2010 19:43:48 +0000 From: Clint Adams To: zsh-workers@zsh.org Cc: Joey Hess , 603503@bugs.debian.org Subject: Re: Bug#603503: numerous infelicities in git completion Message-ID: <20101114194348.GA11912@scru.org> References: <20101113170009.GA25537@gnu.kitenet.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101113170009.GA25537@gnu.kitenet.net> User-Agent: Mutt/1.5.18 (2008-05-17) On Sat, Nov 13, 2010 at 01:00:09PM -0400, Joey Hess wrote: > 1. git log completes only branches, but not filenames. I try to do > `git log Foo/Bar` all the time. > 2. git diff ditto > 3. git anne doesn't complete git annex, despite git-annex > being in path and that being a valid subcommand here. > 4. git annex add doesn't complete anything. I think that if zsh is > unfamiliar with the parameters taken by a subcommand, it should > complete filenames. I'm going to punt on #1 and #2 due to lack of time. Until git gets a convenient way of outputting all the commands and descriptions I think we're stuck hardcoding them. I'm adding annex and submodule (it was claimed that someone is working on submodule completion now). I don't know where annex belongs. Hopefully someone will move it and write completion for it. As for #4 I agree. Index: Completion/Unix/Command/_git =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v retrieving revision 1.131 diff -u -r1.131 _git --- Completion/Unix/Command/_git 24 Jul 2010 19:01:23 -0000 1.131 +++ Completion/Unix/Command/_git 14 Nov 2010 19:22:40 -0000 @@ -205,6 +205,7 @@ 'stage:add file contents to the staging area' 'stash:stash away changes to the working tree' 'status:show working-tree'\''s status' + 'submodule:initialize or update or inspect submodules' 'tag:create tag object signed with GPG' 'verify-tag:check GPG signature of a tag') @@ -290,7 +291,8 @@ 'cvsimport:import a CVS "repository" into a git repository' 'svnimport:import SVN repository into git' 'quiltimport:apply a quilt patchset' - 'svn:bidirectional operation between a single Subversion branch and git') + 'svn:bidirectional operation between a single Subversion branch and git' + 'annex:manage files without tracking content') local -a ancillary_commands ancillary_commands=( @@ -4493,7 +4495,11 @@ __git_aliases_and_commands else curcontext="${curcontext%:*:*}:git-$words[1]:" - _call_function ret _git-$words[1] + if (( $+functions[_git-$words[1]] )); then + _call_function ret _git-$words[1] + else + _files + fi return ret fi ;;