From: Bart Schaefer <schaefer@brasslantern.com>
To: Clint Adams <schizo@debian.org>, zsh-workers@sunsite.dk
Cc: Hugo Haas <hugo@larve.net>,
Debian Bug Tracking System <315255-forwarded@bugs.debian.org>
Subject: Re: Bug#315255: zsh: cvs commit completion breaks on spaces
Date: Wed, 22 Jun 2005 00:57:45 +0000 [thread overview]
Message-ID: <1050622005745.ZM22841@candle.brasslantern.com> (raw)
In-Reply-To: <20050621175055.GA25622@scowler.net>
On Jun 21, 1:50pm, Clint Adams wrote:
}
} _cvs_modified_entries() doesn't like filenames with spaces.
That's almost certainly because it's calling "builtin stat" and then
parsing the output with the World's Hairiest Parameter Substitution (TM).
Which is pretty silly given that stat can assign directly to an array
without the need to fork a $(...) substitution.
See if this isn't better. The substitution isn't that much less hairy,
but it doesn't fork and it doesn't depend on splitting on spaces.
Index: Src/_cvs
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Unix/Command/_cvs,v
retrieving revision 1.17
diff -c -r1.17 _cvs
--- Src/_cvs 28 May 2005 04:32:46 -0000 1.17
+++ Src/_cvs 22 Jun 2005 00:53:00 -0000
@@ -868,8 +868,11 @@
: ${PREFIX:#(#b)(*/)(*)}
linedir="$match[1]"
realdir=${(e)~linedir}
- [[ -f "$realdir"CVS/Entries ]] &&
- [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/${slash}[^${slash}]#${slash}//}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] &&
+ [[ -f "$realdir"CVS/Entries ]] && {
+ local -a mtime
+ LC_ALL=C builtin stat -A mtime -gn +mtime -F $'%a %b %e %T %Y\n' ${realdir}*(D) 2>/dev/null
+ [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/${slash}[^${slash}]#${slash}//}%/[^/]#/[^/]#}:#${(j:|:)~${(f)${(j:/:)${mtime##*/}}//(#m)[][*?()<|^~#\\]/\\$MATCH}#/}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]]
+ } &&
_wanted files expl 'modified file' _path_files -g "$pat"
else
_cvs_existing_entries
next prev parent reply other threads:[~2005-06-22 0:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050621142441.GA32423@larve.net>
2005-06-21 17:50 ` Clint Adams
2005-06-22 0:57 ` Bart Schaefer [this message]
2005-06-22 1:30 ` Clint Adams
2005-06-22 23:57 ` 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=1050622005745.ZM22841@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=315255-forwarded@bugs.debian.org \
--cc=hugo@larve.net \
--cc=schizo@debian.org \
--cc=zsh-workers@sunsite.dk \
/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).