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

Re: PATCH: _git (large)



On 25/09/2007, Clint Adams <clint@xxxxxxx> wrote:
> On Tue, Sep 25, 2007 at 07:34:07PM +0200, Mikael Magnusson wrote:
> > When I do git-merge <tab>, I get the following (which I also get when
> > I use _git straight from Nikolai's repo):
> > _arguments:comparguments:303: invalid rest argument definition:
> > *{-s,--strategy=-}[use given merge strategy]:merge
> > strategy:__git_merge_strategies
> > and nothing is completed.
>
> See if this does the right thing.
>
> Index: Completion/Unix/Command/_git

Now it doesn't bomb out, but it does the wrong thing:

% git-merge <tab>
---- merge message

and

% git-merge a <tab>
---- heads
---- tags
dot-zsh-199905041932 etc

merge message is only supposed to be completed after -m.
Additionally,
% git-merge -<tab>
does not offer -m :). (Nor goes git-merge a -<tab>)

Suspect following patch will fix it:

diff --git a/Completion/Unix/Command/_git
b/Completion/Unix/Command/_git
index 62b2361..b89b0c9 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1663,7 +1663,7 @@ _git-ls-remote () {
 _git-merge () {
   _arguments \
     "$merge_args[@]" \
-    ':merge message' \
+    '-m:merge message' \
     '*:remote:__git_commits' && ret=0
 }



-- 
Mikael Magnusson



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