From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8667 invoked by alias); 27 Jun 2011 22:04:56 -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: 29512 Received: (qmail 26225 invoked from network); 27 Jun 2011 22:04:43 -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,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh workers Cc: Nikolai Weibull Subject: PATCH: Fall back to file completion if nothing else works Date: Mon, 27 Jun 2011 23:55:17 +0200 Message-Id: <1309211717-9650-1-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 1.7.5 X-Df-Sender: 430444 Some people have for third party add-ons to git. `annex' is one such add-on. Currently "git annex add " does nothing, because there is no special subcommand handling function. _git should really fallback to file name completion in such cases. This patch does exactly that. I'm wondering how we should handle third party add ons to commands. _git used provide the `user-commands' style to do stuff like this: % zstyle ':completion:*:*:git:*' user-commands foo:'description for foo' You could even define `_git-foo()' to have special handling. In fact, the current _git still mentions that in the `user-commands' style. But the actual code is gone since the major update. I think it should be re-added for backward compatibility. `user-commands' is really only useful for user-specific add-ons. We might also want to invent something so third party add-ons (which might be distributed separately from git) could drop a _git-foo file into $fpath to get special completion for "git fo" and "git foo ". Thoughts? --- Completion/Unix/Command/_git | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e062705..2b8b8d6 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6024,6 +6024,10 @@ _git() { curcontext=${curcontext%:*:*}:git-$words[1]: _call_function ret _git-$words[1] + if (( ? != 0 )); then + _path_files + ret=$? + fi ;; esac else -- 1.7.5