Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#315255: zsh: cvs commit completion breaks on spaces
- X-seq: zsh-workers 21370
- From: Clint Adams <clint@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Bug#315255: zsh: cvs commit completion breaks on spaces
- Date: Tue, 21 Jun 2005 21:30:18 -0400
- Cc: zsh-workers@xxxxxxxxxx, Hugo Haas <hugo@xxxxxxxxx>, Debian Bug Tracking System <315255@xxxxxxxxxxxxxxx>
- In-reply-to: <1050622005745.ZM22841@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxx, Hugo Haas <hugo@xxxxxxxxx>, Debian Bug Tracking System <315255@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050621142441.GA32423@xxxxxxxxx> <20050621175055.GA25622@xxxxxxxxxxx> <1050622005745.ZM22841@xxxxxxxxxxxxxxxxxxxxxxx>
> 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.
It certainly looks better, but the filenames are still being split on
spaces, so if one touches "blah argh" and "blah", and cvs add's them,
then cvs commit <TAB> will complete "blah" and "argh".
$pat will be something like "blah argh|blah"
Adding the parens makes it do the right thing in this particular case.
What's the correct fix?
Index: _cvs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cvs,v
retrieving revision 1.25
diff -u -r1.25 _cvs
--- _cvs 11 May 2005 09:27:10 -0000 1.25
+++ _cvs 22 Jun 2005 01:26:49 -0000
@@ -868,9 +868,12 @@
: ${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}"} ]] &&
- _wanted files expl 'modified file' _path_files -g "$pat"
+ [[ -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
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author