git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Giuseppe Iuculano" <iuculano@debian.org>
Subject: Re: [PATCH 2/3] tests: Test how well "git apply" copes with weird filenames
Date: Sat, 24 Jul 2010 03:48:48 -0500	[thread overview]
Message-ID: <20100724084847.GB7150@burratino> (raw)
In-Reply-To: <m2r5iti9w0.fsf@igel.home>

Andreas Schwab wrote:

> pr -T is not portable.  What's wrong with expand?

Nothing at all.  Here’s a patch for squashing in.

-- 8< --
Subject: t4135 (apply): use expand instead of pr for portability

expand is just the thing for expanding tabs into spaces, and
unlike pr -T, it is portable.  Use it.

Noticed-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Thank you. :)

 t/t4135-apply-weird-filenames.sh |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git i/t/t4135-apply-weird-filenames.sh w/t/t4135-apply-weird-filenames.sh
index 2dcb040..dda554e 100755
--- i/t/t4135-apply-weird-filenames.sh
+++ w/t/t4135-apply-weird-filenames.sh
@@ -34,15 +34,6 @@ test_expect_success 'setup: test prerequisites' '
 	if diff -pruN 1 2
 	then
 		test_set_prereq FULLDIFF
-	fi &&
-
-	echo "tab ->  ." >expected &&
-	echo "tab ->	." >with-tab &&
-
-	pr -tT -e8 with-tab >actual &&
-	if test_cmp expected actual
-	then
-		test_set_prereq PR
 	fi
 '
 
@@ -99,16 +90,12 @@ try_filename 'with tab'         'post	image.txt' success failure failure
 try_filename 'with backslash'   'post\image.txt'
 try_filename 'with quote'       '"postimage".txt' success failure success
 
-if test_have_prereq FULLDIFF && test_have_prereq PR
-then
-	test_set_prereq FULLDIFFPR
-fi
-test_expect_success FULLDIFFPR 'whitespace-damaged traditional patch' '
+test_expect_success FULLDIFF 'whitespace-damaged traditional patch' '
 	reset_preimage &&
 	reset_subdirs &&
 	echo postimage >b/postimage.txt &&
 	! diff -pruN a b >diff-plain.txt &&
-	pr -tT -e8 diff-plain.txt >damaged.diff &&
+	expand diff-plain.txt >damaged.diff &&
 
 	mv postimage.txt postimage.saved &&
 	git apply -v damaged.diff &&
-- 

  reply	other threads:[~2010-07-24  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24  1:06 [PATCH 0/3] apply: handle traditional patches with spaces in filename Jonathan Nieder
2010-07-24  1:09 ` [PATCH 1/3] apply: Split quoted filename handling into new function Jonathan Nieder
2010-07-24  1:11 ` [PATCH 2/3] tests: Test how well "git apply" copes with weird filenames Jonathan Nieder
2010-07-24  8:03   ` Andreas Schwab
2010-07-24  8:48     ` Jonathan Nieder [this message]
2010-07-24  1:20 ` [PATCH 3/3] apply: Handle traditional patches with space in filename Jonathan Nieder

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=20100724084847.GB7150@burratino \
    --to=jrnieder@gmail.com \
    --cc=agx@sigxcpu.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=iuculano@debian.org \
    --cc=schwab@linux-m68k.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).