git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* t7810.94 (git-grep -E -F -G) never passed
@ 2011-05-25  3:27 Brian Gernhardt
  2011-05-25 10:21 ` Michael J Gruber
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Gernhardt @ 2011-05-25  3:27 UTC (permalink / raw)
  To: git@vger.kernel.org List

I'm not sure why it's supposed to pass, actually.  -G makes the pattern be a basic regex and basic regexen don't recognize the + repetition operator.

expecting success: 
	echo ab:aab >expected &&
	git grep -E -F -G a\\+b >actual &&
	test_cmp expected actual

--- expected	2011-05-25 03:19:05.000000000 +0000
+++ actual	2011-05-25 03:19:05.000000000 +0000
@@ -1 +1 @@
-ab:aab
+ab:a+b
not ok - 94 grep -E -F -G pattern

~~ Brian G

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: t7810.94 (git-grep -E -F -G) never passed
  2011-05-25  3:27 t7810.94 (git-grep -E -F -G) never passed Brian Gernhardt
@ 2011-05-25 10:21 ` Michael J Gruber
  2011-05-25 12:48   ` Brian Gernhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Michael J Gruber @ 2011-05-25 10:21 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: git@vger.kernel.org List

Brian Gernhardt venit, vidit, dixit 25.05.2011 05:27:
> I'm not sure why it's supposed to pass, actually.  -G makes the pattern be a basic regex and basic regexen don't recognize the + repetition operator.
> 
> expecting success: 
> 	echo ab:aab >expected &&
> 	git grep -E -F -G a\\+b >actual &&
> 	test_cmp expected actual
> 
> --- expected	2011-05-25 03:19:05.000000000 +0000
> +++ actual	2011-05-25 03:19:05.000000000 +0000
> @@ -1 +1 @@
> -ab:aab
> +ab:a+b
> not ok - 94 grep -E -F -G pattern

"Never" is a strong statement when this test always passed for everyone
else running tests, assuming they would have reported otherwise. What's
your system?

reg-ex.info says:

"The other BRE metacharacters require a backslash to give them their
special meaning."

"Some implementations support \? and \+... but \? and \+ are not part of
the POSIX standard."

So I guess we're going with "some".

Michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: t7810.94 (git-grep -E -F -G) never passed
  2011-05-25 10:21 ` Michael J Gruber
@ 2011-05-25 12:48   ` Brian Gernhardt
  2011-05-25 21:22     ` Michał Kiedrowicz
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Gernhardt @ 2011-05-25 12:48 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git@vger.kernel.org List


On May 25, 2011, at 6:21 AM, Michael J Gruber wrote:

> "Never" is a strong statement when this test always passed for everyone
> else running tests, assuming they would have reported otherwise. What's
> your system?

My apologies.  It was late and I wasn't explicit enough.  What I meant was:

"This test has failed on my system ever since the commit that introduced it."

My system is running OS X 10.6.7.

> reg-ex.info says:
> 
> "The other BRE metacharacters require a backslash to give them their
> special meaning."
> 
> "Some implementations support \? and \+... but \? and \+ are not part of
> the POSIX standard."
> 
> So I guess we're going with "some".

Some would be right.  I tend to find that the BSD (and BSD-like) libraries on OS X are more strict and have less features than the GNU equivalents.  (The fact that OS X's libreadline is actually the only mostly compatible libedit drives me batty sometimes.)

This does leave us with the question of what to do with the test.  Perhaps a pattern like "a*+b" to match "aa+b"?  Plain + should always match just + in a BRE, even if \+ is special, and the * makes sure that it is a regex instead of plain string matching.

~~ Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: t7810.94 (git-grep -E -F -G) never passed
  2011-05-25 12:48   ` Brian Gernhardt
@ 2011-05-25 21:22     ` Michał Kiedrowicz
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Kiedrowicz @ 2011-05-25 21:22 UTC (permalink / raw)
  To: git

Brian Gernhardt <brian <at> gernhardtsoftware.com> writes:

> 
> Some would be right.  I tend to find that the BSD (and BSD-like) libraries on
OS X are more strict and have less
> features than the GNU equivalents.  (The fact that OS X's libreadline is
actually the only mostly
> compatible libedit drives me batty sometimes.)
> 
> This does leave us with the question of what to do with the test.  Perhaps a
pattern like "a*+b" to match
> "aa+b"?  Plain + should always match just + in a BRE, even if \+ is special,
and the * makes sure that it is a
> regex instead of plain string matching.
> 
> ~~ Brian
> 
> 

You're right about \+ in BRE. I guess I missed that because glibc's
implementation isn't strict BRE. I'll post a patch that fixes this problem.
Thanks for catching this up!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-25 21:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25  3:27 t7810.94 (git-grep -E -F -G) never passed Brian Gernhardt
2011-05-25 10:21 ` Michael J Gruber
2011-05-25 12:48   ` Brian Gernhardt
2011-05-25 21:22     ` Michał Kiedrowicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).