Re: [PATCH 1/2] submodule: preserve all arguments exactly when recursing
- From
Kevin Ballard <kevin@sb.org>
- Date
- Nov 3, 2010, 04:40 UTC
- Message-ID
- <5BE96A08-B8AB-4041-ABF2-7095EB5DD585@sb.org>
- In-Reply-To
- <20101103043725.GA10311@burratino>
On Nov 2, 2010, at 9:37 PM, Jonathan Nieder wrote:
Show 24 quoted lines
> Hi Kevin, > > Kevin Ballard wrote: > >> It's also a reasonable model for how to handle this problem >> in other shell commands. > > This caught my attention. :) > >> +# Emit a quoted version of the all argument suitable for passing to `eval` >> +# $@ = words to quote >> +# >> +# This is intended to be used like the following: >> +# orig_args="$(quote_words "$@")" >> +# # do some work that includes calling shift >> +# eval "set - $orig_args" >> +# # now $@ has been restored, suitable for passing to another command >> +# >> +# Note that you cannot simply save off $@ into another variable because >> +# the shell gives $@ and $* special handling in parameter expansion >> +# >> +quote_words () > > Have you looked into "git rev-parse --sq-quote"?
Well crud, I wish I'd seen that before. Looks like it does pretty much the exact same thing as my quote_words function. I'll send out another patch that uses this instead of quote_words. Thanks for the info!
-Kevin Ballard