Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in autocompletion in CVS



On Jul 3, 12:24pm, Peter Stephenson wrote:
}
} I think there may be a similar problem when checking for modified files,
} but as the test is currently [...very complex...]
} I don't feel like investigating more closely at the moment.

Here's that substitution broke down into its components:

local ents stats
ents="$(<"$realdir"CVS/Entries)"
ents=(${(@f)ents})
ents=(${(@M)ents:#/*})
ents=(${(@)ents#/})
ents=(${(@)ents/${slash}[^${slash}]#${slash}//})
ents=(${(@)ents%/[^/]#/[^/]#})
stats="$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"
stats=(${(f)stats})
stats=(${stats##*/})
stats=(${stats/ //})
stats=(${stats//(#m)[][*?()<|^~#\\]/\\$MATCH})
stats=${(j:|:)stats}
ents=(${(@)ents:#${~stats}})
ents=(${(@)ents%%/*})
[[ -n ${pat::="${(@j:|:)ents//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]]

I don't immediately see what to do to simplify it or to be sure it quotes
spaces in filenames correctly, though.



Messages sorted by: Reverse Date, Date, Thread, Author