Re: [PATCH v10 0/2] introduce --[no-]autostash command line flag
- From
Mehul Jain <mehul.jain2029@gmail.com>
- Date
- Mar 25, 2016, 18:01 UTC
- Message-ID
- <CA+DCAeT0PW6oCjO5QxcL+nJYneLUGgvieki9_44HQJK4bDHaUQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cTqnev_YpamaSi1tkvWydZHRadBzo_zLnF1Pd6FyWKiTQ@mail.gmail.com>
On Fri, Mar 25, 2016 at 12:53 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 18 quoted lines
> On Mon, Mar 21, 2016 at 2:18 PM, Mehul Jain <mehul.jain2029@gmail.com> wrote: >> Changes introduced w.r.t. previous patch: >> [...] >> * Two more tests are added to checkout for error when "git pull >> --[no-]autostash" is called. Here I'm forced to use "test_i18ncmp" >> instead of "test_i18ngrep" to compare the expected error message with >> the actual because grep was, unfortunately, reading "--[no-]autostash" >> as an option and thus leading to test failure. > > Pass -e to grep to treat the next argument as an expression (even if > it happens to look like an option): > > test_i18ngrep -e "--[no-]-autostash ..." > > You may also need to escape the [ and ] with backslash (\) to force > grep to treat them as literal characters rather than as the character > set "[no-]". Alternately, rather than escaping, also pass the -F flag > to make it treat all characters as literals.
Thanks for this. I tried it out
test_i18ngrep -F -e "--[no-]autostash ..." err
and worked fine.
Thanks, Mehul