git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/4] remote-helpers: trivial test fixes

From
Torsten Bögershausen <tboegi@web.de>
Date
Apr 6, 2013, 18:41 UTC
Message-ID
<51606C56.7060108@web.de>
In-Reply-To
<CAMP44s0tAmXxGLnKJ=+xvbMUJW_bqiK75-hKo9M3jh8J=YX-4g@mail.gmail.com>
On 06.04.13 19:58, Felipe Contreras wrote:
Show 27 quoted lines
> On Sat, Apr 6, 2013 at 11:45 AM, Torsten Bögershausen <tboegi@web.de> wrote:
>> On 06.04.13 19:29, Felipe Contreras wrote:
>>> On Sat, Apr 6, 2013 at 11:03 AM, Torsten Bögershausen <tboegi@web.de> wrote:
> 
>>>> --- a/contrib/remote-helpers/test-hg.sh
>>>> +++ b/contrib/remote-helpers/test-hg.sh
>>>> @@ -115,7 +115,7 @@ test_expect_success 'update bookmark' '
>>>>    git push
>>>>    ) &&
>>>>
>>>> -  hg -R hgrepo bookmarks | grep "devel\s\+3:"
>>>> +  hg -R hgrepo bookmarks | egrep "devel[[:space:]]+3:"
>>>>  '
>>>
>>> I would rather use [ \t] instead.
>> That doesn't work on e.g. Mac OS.
>> [:space:] is actually portable
> 
> Why wouldn't it work? This is from their manpage:
> 
> A bracket expression is a list of characters enclosed by [ and ].  It
> matches any single character in
> that list; if the first character of the list is the caret ^ then it
> matches any character not in the
> list.  For example, the regular expression [0123456789] matches any
> single digit.
> 

It's not about the "bracket list". It's about using \t as an abreviation for TAB. The "backslash n" as an replacement for TAB is quite often understood by many programs. It is not demanded to be understood by all grep implementations, please see below. Instead of using \t you can use a literal TAB. Contact your local editor how to put that inte source code ;-)

 
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_03
9.3.2 BRE Ordinary Characters
An ordinary character is a BRE that matches itself: any character in the supported character set, except for the BRE special characters listed in BRE Special Characters.
The interpretation of an ordinary character preceded by a backslash ( '\' ) is undefined, except for:
    The characters ')', '(', '{', and '}'
    The digits 1 to 9 inclusive (see BREs Matching Multiple Characters)
    A character inside a bracket expression
Previous: Felipe Contreras
Message 11 of 11 in “remote-helpers: trivial test fixes”
  1. 0/4 remote-helpers: trivial test fixesFelipe Contreras, Apr 4, 2013
  2. 1/4 remote-bzr: avoid echo -nFelipe Contreras, Apr 4, 2013
  3. 2/4 remote-helpers: fix the run of all testsFelipe Contreras, Apr 4, 2013
  4. 3/4 remote-bzr: remove stale check code for testsFelipe Contreras, Apr 4, 2013
  5. 4/4 remote-hg: fix hg-git test-caseFelipe Contreras, Apr 4, 2013
  6. Torsten BögershausenApr 6, 2013
  7. Torsten BögershausenApr 6, 2013
  8. Felipe ContrerasApr 6, 2013
  9. Torsten BögershausenApr 6, 2013
  10. Felipe ContrerasApr 6, 2013
  11. Torsten BögershausenApr 6, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.