zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@sunsite.dk, Hugo Haas <hugo@larve.net>,
	Debian Bug Tracking System <315255@bugs.debian.org>
Subject: Re: Bug#315255: zsh: cvs commit completion breaks on spaces
Date: Tue, 21 Jun 2005 21:30:18 -0400	[thread overview]
Message-ID: <20050622013018.GA10774@scowler.net> (raw)
In-Reply-To: <1050622005745.ZM22841@candle.brasslantern.com>

> 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


  reply	other threads:[~2005-06-22  1:30 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
2005-06-22  1:30     ` Clint Adams [this message]
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=20050622013018.GA10774@scowler.net \
    --to=clint@zsh.org \
    --cc=315255@bugs.debian.org \
    --cc=hugo@larve.net \
    --cc=schaefer@brasslantern.com \
    --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).