threads / discuss / 15901

What's in git.git (Oct 2008, #03; Tue, 14)

Subject: What's in git.git (Oct 2008, #03; Tue, 14)

## tl;dr

16 messages between Oct 14, 2008 and Oct 24, 2008.

replies: 15people: 7as markdown or json

Junio C Hamano· Oct 14, 2008, 22:08 UTC · lore

Just trying to get my development repository back in sync with what I received from Shawn. Thanks to everybody, I think maint is ready for 1.6.0.3.

* The 'maint' branch has these fixes since the last announcement.
Junio C Hamano (1):
  Update draft release notes to 1.6.0.3
* The 'master' branch has these since the last announcement
  in addition to the above.
Jeff King (1):
  tests: shell negation portability fix
Junio C Hamano (1):
  Update draft release notes to 1.6.1
Brandon Casey· Oct 15, 2008, 15:35 UTC · re: Junio C Hamano · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Two questions:
  1) Should a5a5a048 be in maint?
     "xdiff-interface.c: strip newline (and cr) from line before pattern matching"
  2) Do we want to stick with compat/regex on
      Darwin: Arjen
     FreeBSD: Jeff
         AIX: Mike
     now that the builtin funcname patterns have been converted to Extended
     Regular Expressions?
-brandon
Mike Ralphson· Oct 15, 2008, 17:25 UTC · re: Brandon Casey · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

2008/10/15 Brandon Casey <casey@nrlssc.navy.mil>:
Show 8 quoted lines
>  2) Do we want to stick with compat/regex on
>
>      Darwin: Arjen
>     FreeBSD: Jeff
>         AIX: Mike
>
>     now that the builtin funcname patterns have been converted to Extended
>     Regular Expressions?

Thanks for the reminder, I'd been meaning to recheck this. It appears that AIX doesn't require compat/regex now with the eregexes, so:

Tested-as-no-longer-required-by: Mike Ralphson <mike@abacus.co.uk>
Though I've just noticed my test counts don't actually add up...

fixed 1 success 3555 failed 0 broken 1 total 3559

8-)
Mike
Junio C Hamano· Oct 15, 2008, 19:38 UTC · re: Brandon Casey · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Brandon Casey <casey@nrlssc.navy.mil> writes:
> Two questions:
>
>   1) Should a5a5a048 be in maint?
>      "xdiff-interface.c: strip newline (and cr) from line before pattern matching"

I would have forked a maint-fix topic to prepare a merge of this fix to both 'maint' and 'master' but apparently this was applied directly on 'master'. I may be missing a valid reason why Shawn did it this way.

If we can add a test case to demonstrate the existing breakage, I think we can (and should) cherry-pick it to 'maint'.

Show 8 quoted lines
>   2) Do we want to stick with compat/regex on
>
>       Darwin: Arjen
>      FreeBSD: Jeff
>          AIX: Mike
>
>      now that the builtin funcname patterns have been converted to Extended
>      Regular Expressions?

Mike already said AIX does not need to, and I expect others would say their native regexp library can grok ERE just fine. Let's wait for others to confirm and then remove the compat/regex thing.

Shawn O. Pearce· Oct 15, 2008, 20:20 UTC · re: Junio C Hamano · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
> 
> > Two questions:
> >
> >   1) Should a5a5a048 be in maint?
> >      "xdiff-interface.c: strip newline (and cr) from line before pattern matching"
> 
> I would have forked a maint-fix topic to prepare a merge of this fix to
> both 'maint' and 'master' but apparently this was applied directly on
> 'master'.  I may be missing a valid reason why Shawn did it this way.

My fault. I didn't have a reason for putting it on master. My reason really boiled down to "I can't decide where this goes, oops, got distracted by something, git checkout master, git am, move on...".

Yes, it probably should have gone to maint.  No, it didn't go there.
Temporary lapse in maintainer judgement.
 
> If we can add a test case to demonstrate the existing breakage, I think we
> can (and should) cherry-pick it to 'maint'.
Probably.  Sorry for the cherry-pick being required here.
-- 
Shawn.
Junio C Hamano· Oct 15, 2008, 20:26 UTC · re: Shawn O. Pearce · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 5 quoted lines
>> If we can add a test case to demonstrate the existing breakage, I think we
>> can (and should) cherry-pick it to 'maint'.
>
> Yes, it probably should have gone to maint.  No, it didn't go there.
> Temporary lapse in maintainer judgement.

That is Ok. I do the same all the time (and I try to rewind and rebuild when I spot it before pushing the results out, but I am not always successful).

I just wanted to see if there was any particular reason not to have this on 'maint'.

Thanks.
Shawn O. Pearce· Oct 15, 2008, 20:36 UTC · re: Junio C Hamano · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> >> If we can add a test case to demonstrate the existing breakage, I think we
> >> can (and should) cherry-pick it to 'maint'.
> >
> > Yes, it probably should have gone to maint.  No, it didn't go there.
> > Temporary lapse in maintainer judgement.
> 
> That is Ok.  I do the same all the time (and I try to rewind and rebuild
> when I spot it before pushing the results out, but I am not always
> successful).

Oh, trust me, I had many times where I had to rebuild everything for that day's push because I forgot about a patch that should be in maint. At least your Meta/RB and Meta/PU scripts make it somewhat painless, that and Git's ability to just hard reset a branch back to what I last published. ;-)

I just utterly failed to do it that morning.  Or at least failed
to do it for this change.
 
> I just wanted to see if there was any particular reason not to have this
> on 'maint'.
Nope.
-- 
Shawn.
drafnel@gmail.com· Oct 16, 2008, 00:58 UTC · re: Junio C Hamano · lore

[PATCH maint 1/2] t4018-diff-funcname: rework negated last expression test

This test used the non-zero exit status of 'git diff' to indicate that a negated funcname pattern, when placed last, was correctly rejected.

The problem with this is that 'git diff' always returns non-zero if it finds differences in the files it is comparing, and the files must contain differences in order to trigger the funcname pattern codepath.

Instead of checking for non-zero exit status, make sure the expected error message is printed.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
---

This is not really a series, but I expect you'll apply both, so this seems easier for both of us.

-brandon
 t/t4018-diff-funcname.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 99fff97..72076ec 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -65,7 +65,8 @@ test_expect_success 'custom pattern' '
 
 test_expect_success 'last regexp must not be negated' '
 	git config diff.java.funcname "!static" &&
-	test_must_fail git diff --no-index Beer.java Beer-correct.java
+	git diff --no-index Beer.java Beer-correct.java 2>&1 |
+	grep "fatal: Last expression must not be negated:"
 '
 
 test_expect_success 'alternation in pattern' '
-- 
1.6.0.2.101.gb844
Jeff King· Oct 16, 2008, 10:08 UTC · re: Brandon Casey · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

On Wed, Oct 15, 2008 at 10:35:30AM -0500, Brandon Casey wrote:
Show 8 quoted lines
>   2) Do we want to stick with compat/regex on
> 
>       Darwin: Arjen
>      FreeBSD: Jeff
>          AIX: Mike
> 
>      now that the builtin funcname patterns have been converted to Extended
>      Regular Expressions?
t4018 passes without compat/regex on FreeBSD. Is that a sufficient test?
-Peff
Brandon Casey· Oct 16, 2008, 15:21 UTC · re: Jeff King · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Jeff King wrote:
Show 12 quoted lines
> On Wed, Oct 15, 2008 at 10:35:30AM -0500, Brandon Casey wrote:
> 
>>   2) Do we want to stick with compat/regex on
>>
>>       Darwin: Arjen
>>      FreeBSD: Jeff
>>          AIX: Mike
>>
>>      now that the builtin funcname patterns have been converted to Extended
>>      Regular Expressions?
> 
> t4018 passes without compat/regex on FreeBSD. Is that a sufficient test?

I think so. t4018 makes sure all the patterns compile, and includes Arjen's test for appropriate handling of the alternation operator.

Darwin, anyone?
-brandon
Pieter de Bie· Oct 16, 2008, 15:37 UTC · re: Brandon Casey · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

On 16 okt 2008, at 17:21, Brandon Casey wrote:
> Darwin, anyone?

'maint' passes for me on Darwin (OS X Leopard) after removing the regex stuff in Makefile

- Pieter
Arjen Laarhoven· Oct 17, 2008, 07:02 UTC · re: Pieter de Bie · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

On Thu, Oct 16, 2008 at 05:37:10PM +0200, Pieter de Bie wrote:
Show 7 quoted lines
> 
> On 16 okt 2008, at 17:21, Brandon Casey wrote:
> 
> >Darwin, anyone?
> 
> 'maint' passes for me on Darwin (OS X Leopard) after removing the  
> regex stuff in Makefile
Yup, confirmed.
Arjen
-- 
Arjen Laarhoven

The presence of those seeking the truth is infinitely to be preferred to 
those who think they've found it.
                                -- Terry Pratchett, "Monstrous Regiment"
Junio C Hamano· Oct 24, 2008, 02:44 UTC · re: Brandon Casey · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Brandon Casey <casey@nrlssc.navy.mil> writes:
Show 8 quoted lines
>   2) Do we want to stick with compat/regex on
>
>       Darwin: Arjen
>      FreeBSD: Jeff
>          AIX: Mike
>
>      now that the builtin funcname patterns have been converted to Extended
>      Regular Expressions?
-- >8 --
Subject: Stop using compat/regex.c on platforms with working regexp library

We used to have non-POSIX comformant BRE in our code, and linked with GNU regexp library on a few platforms (Darwin, FreeBSD and AIX) to work it around. This was backwards.

We've fixed the broken regexps to use ERE that native regexp libraries on these platforms can handle just fine. There is no need to link with GNU regexp library on these platforms anymore.

Tested-on-AIX-by: Mike Ralphson <mike@abacus.co.uk>
Tested-on-FreeBSD-by: Jeff King <peff@peff.net>
Tested-on-Darwin-by: Arjen Laarhoven <arjen@yaph.org>
Tested-on-Darwin-by: Pieter de Bie <pieter@frim.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
diff --git c/Makefile w/Makefile
index d6f3695..40309e1 100644
--- c/Makefile
+++ w/Makefile
@@ -640,8 +640,6 @@ ifeq ($(uname_S),Darwin)
 	endif
 	NO_STRLCPY = YesPlease
 	NO_MEMMEM = YesPlease
-	COMPAT_CFLAGS += -Icompat/regex
-	COMPAT_OBJS += compat/regex/regex.o
 endif
 ifeq ($(uname_S),SunOS)
 	NEEDS_SOCKET = YesPlease
@@ -692,8 +690,6 @@ ifeq ($(uname_S),FreeBSD)
 	BASIC_LDFLAGS += -L/usr/local/lib
 	DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
 	THREADED_DELTA_SEARCH = YesPlease
-	COMPAT_CFLAGS += -Icompat/regex
-	COMPAT_OBJS += compat/regex/regex.o
 endif
 ifeq ($(uname_S),OpenBSD)
 	NO_STRCASESTR = YesPlease
@@ -720,8 +716,6 @@ ifeq ($(uname_S),AIX)
 	INTERNAL_QSORT = UnfortunatelyYes
 	NEEDS_LIBICONV=YesPlease
 	BASIC_CFLAGS += -D_LARGE_FILES
-	COMPAT_CFLAGS += -Icompat/regex
-	COMPAT_OBJS += compat/regex/regex.o
 endif
 ifeq ($(uname_S),GNU)
 	# GNU/Hurd
Jeff King· Oct 17, 2008, 09:53 UTC · re: Junio C Hamano · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

On Tue, Oct 14, 2008 at 03:08:50PM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> * The 'master' branch has these since the last announcement
>   in addition to the above.
> 
> Jeff King (1):
>   tests: shell negation portability fix

Can you cherry-pick this into maint? The problem it fixes was caused by 969c877, which is in maint (IOW, master is fixed, but maint is still broken).

-Peff
Junio C Hamano· Oct 17, 2008, 23:58 UTC · re: Jeff King · lore

Re: What's in git.git (Oct 2008, #03; Tue, 14)

Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> On Tue, Oct 14, 2008 at 03:08:50PM -0700, Junio C Hamano wrote:
>
>> * The 'master' branch has these since the last announcement
>>   in addition to the above.
>> 
>> Jeff King (1):
>>   tests: shell negation portability fix
>
> Can you cherry-pick this into maint? The problem it fixes was caused by
> 969c877, which is in maint (IOW, master is fixed, but maint is still
> broken).
Thanks, will do.
drafnel@gmail.com· Oct 16, 2008, 00:58 UTC · lore

[PATCH maint 2/2] t4018-diff-funcname: demonstrate end of line funcname matching flaw

Since the newline is not removed from lines before pattern matching, a pattern cannot match to the end of the line using the '$' operator without using an additional operator which will indirectly match the '\n' character.

Introduce a test which should pass, but which does not due to this flaw.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 t/t4018-diff-funcname.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 72076ec..40a805a 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -69,6 +69,12 @@ test_expect_success 'last regexp must not be negated' '
 	grep "fatal: Last expression must not be negated:"
 '
 
+test_expect_failure 'pattern which matches to end of line' '
+	git config diff.java.funcname "Beer$" &&
+	git diff --no-index Beer.java Beer-correct.java |
+	grep "^@@.*@@ Beer"
+'
+
 test_expect_success 'alternation in pattern' '
 	git config diff.java.xfuncname "^[ 	]*((public|static).*)$" &&
 	git diff --no-index Beer.java Beer-correct.java |
-- 
1.6.0.2.101.gb844

← back to recent threads