git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] tests: Test how well "git apply" copes with weird filenames

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 24, 2010, 08:48 UTC
Message-ID
<20100724084847.GB7150@burratino>
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 &&
Previous: Andreas SchwabNext: Jonathan Nieder
Message 5 of 6 in “apply: handle traditional patches with spaces in filename”
  1. 0/3 apply: handle traditional patches with spaces in filenameJonathan Nieder, Jul 24, 2010
  2. 1/3 apply: Split quoted filename handling into new functionJonathan Nieder, Jul 24, 2010
  3. 2/3 tests: Test how well "git apply" copes with weird filenamesJonathan Nieder, Jul 24, 2010
  4. Andreas SchwabJul 24, 2010
  5. Jonathan NiederJul 24, 2010
  6. 3/3 apply: Handle traditional patches with space in filenameJonathan Nieder, Jul 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.