Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in _git: (was Re: _git:6147: math recursion limit exceeded )
- X-seq: zsh-workers 31065
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Michal Maruska <mmaruska@xxxxxxxxx>
- Subject: Re: bug in _git: (was Re: _git:6147: math recursion limit exceeded )
- Date: Mon, 25 Feb 2013 11:58:01 +0100
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=xwK7ccjhIdifLUXpnXRwooAymf5IDx177AwWqQCQx0g=; b=b5BjB4TSHf7mebbSRKiea/6wvXnL9wZGRv+Uw5qoyH6jT4KIe0H4DT4SM0zSWt/8tC ApeXo4AAGUhG55XX64cd0VQ2qEGXj66/nPPHINpqxezXCq4zkZKhs/cfTy/JUMH9PAI6 zJje673MciMxiltiNnkqZ1wdgI90DfWUH60dAcpmuFg6M3TK5DWc5iIADFVhH1PSMAr6 Zg01HwUB3quZbzXUz6zlAAf8al7YswXEYlh+ZYLKfsgZQoMufkoKHtmhUrtxU6PmewMg 2wn85LY11Qy4JAR6kWyFYgKHOMrSwphBUGdV35mjn0o34ScUL9V4C4Y2T9EwLPTC5KNH kvAw==
- In-reply-to: <CAPHw+0W8fk=pYEeGcorsEmGxbfiSmmzJndRHjDz5+AP_p+2c1A@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAPHw+0W8fk=pYEeGcorsEmGxbfiSmmzJndRHjDz5+AP_p+2c1A@mail.gmail.com>
On 25 February 2013 11:02, Michal Maruska <mmaruska@xxxxxxxxx> wrote:
> It turned out, that
> _git_third_party_commands+=$name$desc
> should be
> _git_third_party_commands+=($name $desc)
Probably something like this patch should be applied, I don't have
time to test these changes though (and only the one you found is
actually a bug, foo+=bar is okay for a regular array).
http://cgit.mika.l3ib.org/cgit/zsh-cvs/patch/?id=dd66e37e821eef41177af432b08fb76544ff345b
>From 398a9deb2fa4e32354d406f3b1719615c5461143 Mon Sep 17 00:00:00 2001
From: Mikael Magnusson <mikachu@xxxxxxxxx>
Date: Mon, 25 Feb 2013 11:51:27 +0100
Subject: PATCH: _git: Use () for all array append operations.
One of these, _git_third_party_commands+=$name$desc, was definitely a bug.
---
Completion/Unix/Command/_git | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2b6a369..d019df9 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -297,9 +297,9 @@ _git-branch () {
dependent_deletion_args=(
'-r[delete only remote-tracking branches]')
if (( words[(I)-r] )); then
- dependent_deletion_args+='*:
:__git_ignore_line_inside_arguments __git_remote_branch_names'
+ dependent_deletion_args+=( '*:
:__git_ignore_line_inside_arguments __git_remote_branch_names' )
else
- dependent_deletion_args+='*:
:__git_ignore_line_inside_arguments __git_branch_names'
+ dependent_deletion_args+=( '*:
:__git_ignore_line_inside_arguments __git_branch_names' )
fi
fi
@@ -2081,9 +2081,9 @@ _git-config () {
declare -a match mbegin mend
for opt in
${${${${(M)git_options_static:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether
or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]};
do
if (( ${git_options_static[(I)${opt%%:*}.*]} )); then
- sections_and_options+=$opt
+ sections_and_options+=( $opt )
else
- options+=$opt
+ options+=( $opt )
fi
done
@@ -3677,9 +3677,9 @@ _git-merge-index () {
else
declare -a arguments
- (( CURRENT == 2 )) && arguments+='-o[skip failed merges]'
- (( CURRENT == 2 || CURRENT == 3 )) && arguments+='(-o)-q[do not
complain about failed merges]'
- (( 2 <= CURRENT && CURRENT <= 4 )) && arguments+='*:merge
program:_files -g "*(*)"'
+ (( CURRENT == 2 )) && arguments+=( '-o[skip failed merges]' )
+ (( CURRENT == 2 || CURRENT == 3 )) && arguments+=( '(-o)-q[do not
complain about failed merges]' )
+ (( 2 <= CURRENT && CURRENT <= 4 )) && arguments+=( '*:merge
program:_files -g "*(*)"' )
_arguments -S $arguments
fi
@@ -4706,7 +4706,7 @@ _git_commands () {
local -a third_party_commands
local command
for command in $_git_third_party_commands; do
- (( $+commands[git-${command%%:*}] )) && third_party_commands+=$command
+ (( $+commands[git-${command%%:*}] )) && third_party_commands+=( $command )
done
local -a aliases unique_aliases
@@ -4724,7 +4724,7 @@ _git_commands () {
plumbing_interrogator_commands[(I)$name:*] ||
plumbing_sync_commands[(I)$name:*] ||
plumbing_sync_helper_commands[(I)$name:*] ||
- plumbing_internal_helper_commands[(I)$name:*] )) ||
unique_aliases+=$alias
+ plumbing_internal_helper_commands[(I)$name:*] )) ||
unique_aliases+=( $alias )
done
integer ret=1
@@ -5089,7 +5089,7 @@ __git_heads () {
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
if __git_command_successful $pipestatus; then
for f in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
- [[ -f $gitdir/$f ]] && heads+=$f
+ [[ -f $gitdir/$f ]] && heads+=( $f )
done
fi
@@ -5316,7 +5316,7 @@ __git_files_relative () {
fi
done
- files+=${(l@${#prefix[i,-1]//[^\/]}*3@@../@)}${file[i,-1]}
+ files+=( ${(l@${#prefix[i,-1]//[^\/]}*3@@../@)}${file[i,-1]} )
done
print ${(pj:\0:)files}
@@ -6158,7 +6158,7 @@ for file in ${^fpath}/_git-*~(*~|*.zwc)(.N); do
(( i++ ))
done < $file
- _git_third_party_commands+=$name$desc
+ _git_third_party_commands+=( $name $desc )
done
_git
--
1.7.10.GIT
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author