From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Daniel Hahler <genml+zsh-workers@thequod.de>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] completion: git: fix __git_commit_objects/__git_recent_commits
Date: Sun, 17 May 2015 23:46:42 +0000 [thread overview]
Message-ID: <20150517234642.GI2214@tarsus.local2> (raw)
In-Reply-To: <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@thequod.de>
>
> $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.
next prev parent reply other threads:[~2015-05-17 23:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-17 17:37 Daniel Hahler
2015-05-17 17:57 ` Daniel Hahler
2015-05-17 23:46 ` Daniel Shahaf [this message]
2015-05-19 3:46 ` Daniel Hahler
2015-05-19 4:42 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150517234642.GI2214@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=genml+zsh-workers@thequod.de \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).