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

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

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'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 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.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr2C28ACgkQJdeBCYSNAANc0wCfSZTcjOvDZU34CVgV3tn9QwOo
v7YAniCv+xfl6jGkWux/it4XtfAp8r5Y
=JHhR
-----END PGP SIGNATURE-----

« Back to merge proposal