git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Christian Couder <chriscool@tuxfamily.org>, git@vger.kernel.org
Subject: Re: [PATCH 1/3] rev-parse: add --sq-quote to shell quote arguments
Date: Fri, 24 Apr 2009 10:33:09 +0200	[thread overview]
Message-ID: <49F17945.8000004@viscovery.net> (raw)
In-Reply-To: <7v8wlqii2y.fsf@gitster.siamese.dyndns.org>

Junio C Hamano schrieb:
> 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

  reply	other threads:[~2009-04-24  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24  6:28 [PATCH 1/3] rev-parse: add --sq-quote to shell quote arguments Christian Couder
2009-04-24  8:14 ` Junio C Hamano
2009-04-24  8:33   ` Johannes Sixt [this message]
2009-04-25  5:06     ` Christian Couder
2009-04-25  4:57   ` Christian Couder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F17945.8000004@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).