git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Brian Charles Gernhardt <gernhard@cs.rochester.edu>
Cc: Git List <git@vger.kernel.org>
Subject: Re: t4055 failure: see error
Date: Tue, 02 Oct 2012 11:52:47 -0700	[thread overview]
Message-ID: <7v391w905c.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v7gr890hd.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Tue, 02 Oct 2012 11:45:34 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Brian Charles Gernhardt <gernhard@cs.rochester.edu> writes:
>
>> Another problem caused by BSD v GNU sed, I think.
>
> Oh, that again X-<.
>
> Will patch up in a stupid-but-trivial way, unless somebody knows a
> reliable workaround.

I no longer have a BSD handy to test, so I'd appreciate it if
somebody can do a quick sanity check.

Thanks.

-- >8 --
Subject: [PATCH] t4055: avoid BSD/GNU sed incompatibilty issues

The 'a', 'i' and 'c' commands that take literal lines to be added
followed by backslash does not seem to work reliably on some BSD
systems.  Avoid it by having an extra line in a template file and
generate test vectors by deleting the line or replacing the line.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t4055-diff-context.sh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh
index 3527686..97172b4 100755
--- a/t/t4055-diff-context.sh
+++ b/t/t4055-diff-context.sh
@@ -8,7 +8,7 @@ test_description='diff.context configuration'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-	cat >x <<-\EOF &&
+	cat >template <<-\EOF &&
 	firstline
 	b
 	c
@@ -16,6 +16,7 @@ test_expect_success 'setup' '
 	e
 	f
 	preline
+	TARGET
 	postline
 	i
 	j
@@ -24,17 +25,15 @@ test_expect_success 'setup' '
 	m
 	n
 	EOF
+	sed "/TARGET/d" >x <template &&
 	git update-index --add x &&
 	git commit -m initial &&
 
-	git cat-file blob HEAD:x |
-	sed "/preline/a\
-	ADDED" >x &&
+	sed "s/TARGET/ADDED/" >x <template &&
 	git update-index --add x &&
 	git commit -m next &&
 
-	git cat-file blob HEAD:x |
-	sed s/ADDED/MODIFIED/ >x
+	sed "s/TARGET/MODIFIED/" >x <template
 '
 
 test_expect_success 'the default number of context lines is 3' '
-- 
1.8.0.rc0.45.g7ce8dc5

  reply	other threads:[~2012-10-02 18:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 12:18 t4055 failure: see error Brian Charles Gernhardt
2012-10-02 18:45 ` Junio C Hamano
2012-10-02 18:52   ` Junio C Hamano [this message]
2012-10-02 19:00 ` Junio C Hamano
2012-10-02 19:09   ` Junio C Hamano
2012-10-07 15:43     ` Brian Charles Gernhardt
2012-10-07 22:37       ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7v391w905c.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=gernhard@cs.rochester.edu \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).