Re: [PATCH 1/3] rev-parse: add --sq-quote to shell quote arguments
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Apr 24, 2009, 08:33 UTC
- Message-ID
- <49F17945.8000004@viscovery.net>
- In-Reply-To
- <7v8wlqii2y.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 15 quoted lines
> Not very readable. A better example might be to demonstrate something > like this: > > $ cat >your-git-script.sh <<\EOF > #!/bin/sh > # quote user-supplied arguments > args=$(git rev-parse --sq-quote "$@") > # and use it inside a handcrafted command line > command="git frotz -n24 $args" > eval "$command" > EOF > > $ sh your-git-script.sh "a b'c" > > i.e, put stress on how to use it, not on how it works internally.
Hmm, that makes me wonder why we special-case shell-quoting and implement it in an executable. Why don't we have perl-quoting, C-quoting, PHP-quoting, $language-of-your-choice quoting, etc, too?
I think we should simply move sq() from git-am to git-sh-setup and use that in git-bisect.
-- Hannes