Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] completion: git: fix __git_commit_objects/__git_recent_commits
- X-seq: zsh-workers 35171
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- Subject: Re: [PATCH] completion: git: fix __git_commit_objects/__git_recent_commits
- Date: Sun, 17 May 2015 23:46:42 +0000
- Cc: zsh-workers@xxxxxxx
- 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=
- In-reply-to: <1431884273-17095-1-git-send-email-genml+zsh-workers@thequod.de>
- 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: <1431884273-17095-1-git-send-email-genml+zsh-workers@thequod.de>
Daniel Hahler wrote on Sun, May 17, 2015 at 19:37:53 +0200:
> From: Daniel Hahler <git@xxxxxxxxxx>
>
> $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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author