zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@zsh.org
Cc: Joey Hess <joeyh@debian.org>, 603503@bugs.debian.org
Subject: Re: Bug#603503: numerous infelicities in git completion
Date: Sun, 14 Nov 2010 19:43:48 +0000	[thread overview]
Message-ID: <20101114194348.GA11912@scru.org> (raw)
In-Reply-To: <20101113170009.GA25537@gnu.kitenet.net>

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<tab>` all the time.
> 2. git diff ditto
> 3. git anne<tab> doesn't complete git annex, despite git-annex
>    being in path and that being a valid subcommand here.
> 4. git annex add <tab> 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
       ;;


       reply	other threads:[~2010-11-14 19:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20101113170009.GA25537@gnu.kitenet.net>
2010-11-14 19:43 ` Clint Adams [this message]
2010-11-14 19:47   ` Joey Hess
2010-11-14 20:24     ` Holger Weiß
2010-11-14 19:48   ` Nikolai Weibull
2010-11-14 20:37     ` 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=20101114194348.GA11912@scru.org \
    --to=clint@zsh.org \
    --cc=603503@bugs.debian.org \
    --cc=joeyh@debian.org \
    --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).