Code review comment for lp:~bialix/bzr/no-single-quote-on-win32

Revision history for this message
Alexander Belchenko (bialix) wrote :

> Alexander Belchenko wrote:
> > I disagree with John intent to make command-line posix like (despite the
> glob) because it breaks rule of the least surprise. If I know how all programs
> in standard shell behave then I'd like to get the same behavior from bzr.
> >
> > John's patch was about fixing 3 bugs/feature requests for adding glob
> expansion. There was no request to change command-line parsing to follow all
> linux rules. Why then you don't support `` syntax?
>
> We also have had a bug about "don't use single quotes in documentation
> because it breaks on Windows". I don't have the bug # offhand.

I remember that bug.

> It *has* been a source of difficulty for users that the command line
> does not behave the same across different platforms. Even if we fix up
> the bzr docs, people may read recipes in blog posts, etc. And then not
> have them work.

I don't know how to handle this problem really.

Actually I more concerned about wrong habits. I have very strong fingers memory so sometimes I'm even trying to run normal windows commands as `bzr xxx` instead of just `xxx`. And I fear that intensive usage of single quotes leads me or other users to the fact we start trying to use them with standard commands. And they will fail every time.

So the problem is two-fold.

Globs are there for very long time, at least as part of bzr add. This is natural improvement. But single quote is mental block for me. Maybe I'm crazy.

> I'm at the point of being willing to land your patch to make you happy,
> even if it makes me a little unhappy. If you want to continue onward to
> change the rest of the differences, feel free. I'll review and land it.

I don't want to be in position of hard pressure on you and make you unhappy. That's why I've asked bzr-windows community to comment on this issue. You put me in the position when I can only give up. But in fact: *why* you feel unhappy?

I certainly can make myself happy very easy: I can build custom bzr.exe for myself with my patch inside. I don't need TortoiseBzr so it's possible for me.

> I also found a couple test suite failures because we no longer do
> globbing of 'run_bzr()' arguments, though I consider that a good thing.
> I'll be proposing a patch for that in a few minutes.
>
> >
> > John don't use standard shell, he's using Cygwin. Robert don't use Windows
> either. Why you then want to beak standard windows shell behavior instead of
> following it? For those who need different there is always Cygwin and Msys.
> >
> > More closer to some concerns about escaping quotes. I've made some testing
> with simple python snippet. Here is how it works in standard shell:
> >
> > C:\>python -c "import sys; print sys.argv"
> > ['-c']
> >
> > C:\>python -c "import sys; print sys.argv" foo"bar
> > ['-c', 'foobar']
> >
> > C:\>python -c "import sys; print sys.argv" foobar"
> > ['-c', 'foobar']
> >
> > C:\>python -c "import sys; print sys.argv" "foo"bar"
> > ['-c', 'foobar']
> >
> > C:\>python -c "import sys; print sys.argv" foo""bar
> > ['-c', 'foobar']
> >
> > C:\>python -c "import sys; print sys.argv" foo" "bar
> > ['-c', 'foo bar']
> >
> > C:\>python -c "import sys; print sys.argv" foo\"bar
> > ['-c', 'foo"bar']
> >
> > C:\>python -c "import sys; print sys.argv" "foo""bar"
> > ['-c', 'foo"bar']
> >
> > C:\>python -c "import sys; print sys.argv" foo\'bar
> > ['-c', "foo\\'bar"]
> >
> > C:\>python -c "import sys; print sys.argv" "foo" "bar"
> > ['-c', 'foo', 'bar']
> >
> > C:\>python -c "import sys; print sys.argv" foo\" \"bar
> > ['-c', 'foo"', '"bar']
>
> As mentioned, if you want to preserve this, it shouldn't be too hard.

I've showed this session as example of cmd.exe behavior and maybe as possible source for extending test suite. I'm still trying to figure out how your new command-line parsing may impact on qsubprocess and bencoded command-line.

« Back to merge proposal