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

Re: Bug in completion for git merge

On 02/15/2016 12:20 PM, Thomas Becker wrote:
> Ahh sorry about that.  That explains some of the other weirdness I’ve been seeing. I’m trying to upgrade my completion to something that knows about newer git options than what is provided in 5.0.5. Is there any way to do that? Thanks.
By patching the completer to use portable syntax, portable in terms of zsh.
The following patch applied to master should work in pre 5.1.

Considering that this is the only line in _git that expects the reserved word behavior,
it may be a good idea to commit it for consistency sake. But bart has a point.

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index b7eaf2e..fb10fa6 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1129,9 +1129,9 @@ _git-log () {

 (( $+functions[_git-merge] )) ||
 _git-merge () {
-  local -a merge_options
+  local -a merge_options git_commit_opts
-  local -a git_commit_opts=(--all --not HEAD --not)
+  git_commit_opts=(--all --not HEAD --not)

   _arguments -w -S -s \
     $merge_options \

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