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

Re: [PATCH] grep -P: Fix matching ^ and $

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2012, 22:39 UTC
Message-ID
<7vlinpdxsu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1330161868-7954-1-git-send-email-michal.kiedrowicz@gmail.com>
Michał Kiedrowicz <michal.kiedrowicz@gmail.com> writes:
Show 19 quoted lines
> @@ -893,4 +900,20 @@ test_expect_success 'mimic ack-grep --group' '
>  	test_cmp expected actual
>  '
>  
> +cat >expected <<EOF
> +space: line with leading space1
> +space: line with leading space2
> +space: line with leading space3
> +EOF
> +
> +test_expect_success 'grep -E "^ "' '
> +	git grep -E "^ " space >actual &&
> +	test_cmp expected actual
> +'
> +
> +test_expect_success "grep -P '^ '" '
> +	git grep -P "^ " space >actual &&
> +	test_cmp expected actual
> +'

This test does not pass for me as I do not usually build with pcre; shouldn't it be protected with some test prerequisite?

Otherwise the patch looks good; thanks.
Previous: Zbigniew Jędrzejewski-SzmekNext: Zbigniew Jędrzejewski-Szmek
Message 4 of 6 in “grep -P: Fix matching ^ and $”
  1. grep -P: Fix matching ^ and $Michał Kiedrowicz, Feb 25, 2012
  2. Michał KiedrowiczFeb 25, 2012
  3. Zbigniew Jędrzejewski-SzmekFeb 25, 2012
  4. Junio C HamanoFeb 26, 2012
  5. grep -P: add tests for matching ^ and $Zbigniew Jędrzejewski-Szmek, Feb 27, 2012
  6. Junio C HamanoFeb 27, 2012

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.