git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: BJ Hargrave <bj@bjhargrave.com>
Cc: Junio C Hamano <gitster@pobox.com>, <git@vger.kernel.org>,
	<trast@student.ethz.ch>
Subject: Re: [ANNOUNCE] Git 1.7.9.3
Date: Tue, 6 Mar 2012 15:50:37 +0100	[thread overview]
Message-ID: <87y5rd4wci.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <A518E7E7-25D5-429C-A1C1-35F94EC8F043@bjhargrave.com> (BJ Hargrave's message of "Tue, 6 Mar 2012 09:35:48 -0500")

BJ Hargrave <bj@bjhargrave.com> writes:

> ok 6 - empty bundle file is rejected
> not ok - 7 ridiculously long subject in boundary
> #	
> #		: >file4 &&
> #		test_tick &&
> #		git add file4 &&
> #		printf "%01200d
> #	" 0 | git commit -F - &&
> #		test_commit fifth &&
> #		git bundle create long-subject-bundle.bdl HEAD^..HEAD &&
> #		git bundle list-heads long-subject-bundle.bdl >heads &&
> #		test -s heads &&
> #		git fetch long-subject-bundle.bdl &&
> #		sed -n "/^-/{p;q}" long-subject-bundle.bdl >boundary &&
> #		grep "^-$_x40 " boundary

I can reproduce this.  The failure (to be seen from -v, which would have
been really nice to have in the original mail):

  sed: 1: "/^-/{p;q}": extra characters at the end of q command

This can be fixed with the change below, which then gets us into the
next one

  grep: Regular expression too big

Sheesh, Apple, are you kidding me?!  So we also need to change the grep
expression.

----- 8< -----
Subject: [PATCH] t5704: fix nonportable sed/grep usages

OS X's sed and grep would complain with (respectively)

  sed: 1: "/^-/{p;q}": extra characters at the end of q command
  grep: Regular expression too big

For sed, use an explicit ; to terminate the q command.

For grep, spell the "40 hex digits" explicitly in the regex, instead
of being lazy with the shell pattern $_x40.
---
 t/t5704-bundle.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t5704-bundle.sh b/t/t5704-bundle.sh
index a51c8b0..9e43731 100755
--- a/t/t5704-bundle.sh
+++ b/t/t5704-bundle.sh
@@ -54,8 +54,8 @@ test_expect_success 'ridiculously long subject in boundary' '
 	git bundle list-heads long-subject-bundle.bdl >heads &&
 	test -s heads &&
 	git fetch long-subject-bundle.bdl &&
-	sed -n "/^-/{p;q}" long-subject-bundle.bdl >boundary &&
-	grep "^-$_x40 " boundary
+	sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary &&
+	grep "^-[0-9a-f]\\{40\\} " boundary
 '
 
 test_done
-- 
1.7.6.557.gcee4



-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2012-03-06 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 23:24 [ANNOUNCE] Git 1.7.9.3 Junio C Hamano
2012-03-06 14:35 ` BJ Hargrave
2012-03-06 14:50   ` Thomas Rast [this message]
2012-03-06 16:03     ` Junio C Hamano
2012-03-06 20:08     ` Junio C Hamano
2012-03-06 20:31       ` Thomas Rast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5rd4wci.fsf@thomas.inf.ethz.ch \
    --to=trast@inf.ethz.ch \
    --cc=bj@bjhargrave.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).