From: Philip Oakley <philipoakley@iee.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Nicolas Vigier <boklm@mars-attacks.org>,
sandals@crustytoothpaste.net
Subject: Re: [PATCH v3 8/9] rebase: add the --gpg-sign option
Date: Sat, 08 Feb 2014 13:04:09 +0000 [thread overview]
Message-ID: <52F62B49.7080709@iee.org> (raw)
In-Reply-To: <20140207235058.GJ635004@vauxhall.crustytoothpaste.net>
On 07/02/14 23:50, brian m. carlson wrote:
> On Mon, Feb 03, 2014 at 01:42:06PM -0800, Junio C Hamano wrote:
>>> + --gpg-sign)
>>> + gpg_sign_opt=-S
>>> + ;;
>>> + --gpg-sign=*)
>>> + # Try to quote only the argument, as this will appear in human-readable
>>> + # output as well as being passed to commands.
>>> + gpg_sign_opt="-S$(git rev-parse --sq-quote "${1#--gpg-sign=}" |
>>> + sed 's/^ //')"
>>
>> Isn't an invocation of sed excessive?
>>
>> gpg_sign_opt=$(git rev-parse --sq-quote "${1#--gpg-sign=}") &&
>> gpg_sign_opt=-S${gpg_sign_opt# }
>>
>> if you really need to strip the leading SP, which I do not think is
>> a necessary thing to do. It is sufficient to remove the SP before
>> the variable substitution in the human-readable messages, e.g.
>
> I'm not sure that command line parsing of "-S 'foo <x@example.tld>'"
> will work exactly as expected due to the fact that -S doesn't always
> take an argument. Your suggestion to use # seems fine, though.
>
> I'm a little embarrassed to admit that in my fifteen years of Unix
> experience, I've never learned the variable modifiers for shell, so it
> didn't occur to me to use them in this case. Guess it's time to learn
> them now.
Same here:
For other readers, I found most google results were only partial on the
issue, missing the '#' symbol option. Here's a more complete ref
http://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion-1
for fellow learners.
Philip
--
>
next prev parent reply other threads:[~2014-02-08 13:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-01 2:17 [PATCH v3 0/9] add --gpg-sign to rebase and pull brian m. carlson
2014-02-01 2:17 ` [PATCH v3 1/9] cherry-pick, revert: add the --gpg-sign option brian m. carlson
2014-02-03 20:50 ` Junio C Hamano
2014-02-01 2:17 ` [PATCH v3 2/9] git-sh-setup.sh: add variable to use the stuck-long mode brian m. carlson
2014-02-01 2:18 ` [PATCH v3 3/9] am: parse options in " brian m. carlson
2014-02-01 2:18 ` [PATCH v3 4/9] am: add the --gpg-sign option brian m. carlson
2014-02-01 2:18 ` [PATCH v3 5/9] rebase: remove useless arguments check brian m. carlson
2014-02-01 2:18 ` [PATCH v3 6/9] rebase: don't try to match -M option brian m. carlson
2014-02-01 2:18 ` [PATCH v3 7/9] rebase: parse options in stuck-long mode brian m. carlson
2014-02-01 2:18 ` [PATCH v3 8/9] rebase: add the --gpg-sign option brian m. carlson
2014-02-03 21:42 ` Junio C Hamano
2014-02-07 23:50 ` brian m. carlson
2014-02-08 13:04 ` Philip Oakley [this message]
2014-02-01 2:18 ` [PATCH v3 9/9] pull: " brian m. carlson
2014-02-03 20:31 ` Junio C Hamano
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=52F62B49.7080709@iee.org \
--to=philipoakley@iee.org \
--cc=boklm@mars-attacks.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.