From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22914 invoked by alias); 17 May 2015 23:46:49 -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: 35171 Received: (qmail 25494 invoked from network); 17 May 2015 23:46:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=wEp3MXhFwvQtWYxCZ0j4/ymWWds=; b=O8npHb 7cPHsTFb0Eq3pAQEHmyzli9l3ZuLDFKogZn/HF3OX4m7DRg/k94gJQY6HyE+mJOr FBUiMFdg4kOJxevhaB2YkbjSu5Ujvl3z+TT65+Tyfz9qprb/pboQcyIQoBlssBrj bCib9cPB2JC2/HyLbY7FBt0YeNG8ye0wZgo14= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=wEp3MXhFwvQtWYxCZ0j4/ymWWds=; b=N+ypa t0yWBgDu+NqKJu8d5T2NUc8py7MUlLAkf4197vCE7IE0sg/xYS11abX4SYflcbN2 Oa4krE+JhjLkEzYHs3bmvth8odcmozHH7SUzuRhyWxMim4EpqO+dzmwdaGud/Iqg oN5ICthKXfVtyeXLgQmZ1AHA2+Z2R0JC+H2Bc4= X-Sasl-enc: AMPdVEtBNxGK4I4Nf1oJD06lWodPJxu2cvHSf/X/dCuu 1431906405 Date: Sun, 17 May 2015 23:46:42 +0000 From: Daniel Shahaf To: Daniel Hahler Cc: zsh-workers@zsh.org Subject: Re: [PATCH] completion: git: fix __git_commit_objects/__git_recent_commits Message-ID: <20150517234642.GI2214@tarsus.local2> References: <1431884273-17095-1-git-send-email-genml+zsh-workers@thequod.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431884273-17095-1-git-send-email-genml+zsh-workers@thequod.de> User-Agent: Mutt/1.5.21 (2010-09-15) Daniel Hahler wrote on Sun, May 17, 2015 at 19:37:53 +0200: > From: Daniel Hahler > > $pipestatus for `: foo` appears to be 0 always. > Explicitly declare `$commits` as associative array, and assign it > normally. The change from sequential to associative array breaks __git_recent_commits. I assume you should revert the declaration change but keep the initialization change. Incidentally, _describe's documentation says colons should be escaped, so I think we also need something like this: diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 918f6be..a281597 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5672,7 +5672,7 @@ __git_recent_commits () { for i j k in "$commits[@]" ; do # Note: the after-the-colon part must be unique across the entire array; # see workers/34768 - descr+=("$i:[$i] $k") + descr+=("$i:[$i] ${k//:/\\:}") j=${${j# \(}%\)} # strip leading ' (' and trailing ')' for j in ${(s:, :)j}; do if [[ $j == 'tag: '* ]] ; then But I haven't tested this, and in any case I won't commit this until you finish pushing your outstanding changes (to avoid conflicts). Daniel > Without this, "git checkout" in a non-git directory would complete " ", > but not result in a note/error about not being in a git dir.