[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: list --search matching and Windows *-expansion

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 18 Dec 2017 19:14:36 +0100

On Mon, Dec 18, 2017 at 06:01:52PM +0000, Daniel Shahaf wrote:
> Branko Čibej wrote on Mon, 18 Dec 2017 16:24 +0100:
> > Or use a different set of match chars on Windows instead of * and ?, as
> > a hacky but usable workaround. That would mean that, only on windows,
> > and in the argument of --search, we would replace, say, % and # with *
> > and ? or some such. I'd even go as far as to add a warning that this
> > substitution will be removed once (if?) we get rid of setargv.obj.
>
> I'm concerned about API divergence between Windows and Unix. Could we
> try to minimise the possibilities for Windows admins to write code (say,
> Python code using subprocess.check_call()) that won't work on Unix, and
> vice-versa?
>
> For example, how about if we only perform the substitution you describe
> if the pattern had a magic prefix, so «--search "nostar:foo#bar%"» would
> pass "foo*bar?" to the API's on *all* platforms? This way, Windows code
> would work on Unix, and Unix code that actually searches for percent signs
> would work on Windows.

How about we use Brane's idea, but with a twist:

Essentially, we'd define some mapping between our fnmatch special chars
and another set of chars that won't cause problems on a windows command
line, chosen as needed to work around this windows-specific issue in
our command line client.

Then we could keep supporting these aliases on all platforms and it
wouldn't matter which set of chars people use. Windows users would
of course be advised to use the set of chars which works for them.
Received on 2017-12-18 19:14:50 CET

This is an archived mail posted to the Subversion Dev mailing list.