From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: Brian Gernhardt <benji@silverinsanity.com>
Cc: git@vger.kernel.org
Subject: [PATCH] Fail softly if file system does not like test data.
Date: Tue, 30 Jan 2007 23:49:08 +0100 [thread overview]
Message-ID: <20070130224446.28311.31828.stgit@lathund.dewire.com> (raw)
In-Reply-To: <20070130163219.GA14431@164.242.249.10.in-addr.arpa>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 3576 bytes --]
Most unix file system allow almost any byte sequence, but other may reject
sequences that are not valid according to the locale. This change makes
failure somewhat less likely by using UTF-8-encoded characters (which
happen to be valid interpreted as ISO-8859-1 and skips the test if the
local file system does not support the test data.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
Please try this on cygwin (western iso-8859-X, korean on FAT & NTFS) and
MacOSX (HFS) where we know there was a problem. The non-ascii filename
test should be skipped, with a notice) in most asian locales on Windows
and MacOSX.
t/t9200-git-cvsexportcommit.sh | 35 +++++++++++++++++++++--------------
1 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index fd0a554..fdf7b3f 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -169,20 +169,27 @@ test_expect_success \
test "$(echo $(sort "G g/CVS/Entries"|cut -d/ -f2,3,5))" = "with spaces.png/1.2/-kb with spaces.txt/1.2/"
)'
-# This test contains ISO-8859-1 characters
-test_expect_success \
- 'File with non-ascii file name' \
- 'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
- echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
- git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
- cp ../test9200a.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
- git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
- git commit -a -m "Går det så går det" && \
- id=$(git rev-list --max-count=1 HEAD) &&
- (cd "$CVSWORK" &&
- git-cvsexportcommit -v -c $id &&
- test "$(echo $(sort Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/CVS/Entries|cut -d/ -f2,3,5))" = "gårdetsågårdet.png/1.1/-kb gårdetsågårdet.txt/1.1/"
- )'
+# This test contains UTF-8 characters and may fail on some filesystems
+mkdir -p "/å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" >/dev/null 2>&1
+if test $? -ne 0
+then
+ test_expect_success 'File with non-ascii file name skipped, file system is incompatible with test data' :
+else
+ test_expect_success \
+ 'File with non-ascii file name' \
+ '(mkdir -p "å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" ||
+ echo "Local filesystem does not permit this test" ) &&
+ echo Foo >"å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt" &&
+ git add "å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt" &&
+ cp ../test9200a.png "å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png" &&
+ git add "å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png" &&
+ git commit -a -m "Går det så går det" && \
+ id=$(git rev-list --max-count=1 HEAD) &&
+ (cd "$CVSWORK" &&
+ git-cvsexportcommit -v -c $id &&
+ test "$(echo $(sort "å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/CVS/Entries"|cut -d/ -f2,3,5))" = "gårdetsågårdet.png/1.1/-kb gårdetsågårdet.txt/1.1/"
+ )'
+fi
test_expect_success \
'Mismatching patch should fail' \
next prev parent reply other threads:[~2007-01-30 22:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-30 16:32 t9200-git-cvsexportcommit #8 failure on OS X Brian Gernhardt
2007-01-30 22:20 ` Robin Rosenberg
2007-01-30 22:49 ` Robin Rosenberg [this message]
2007-01-30 23:28 ` [PATCH] Fail softly if file system does not like test data Brian Gernhardt
2007-01-31 0:14 ` Robin Rosenberg
2007-01-31 5:39 ` Brian Gernhardt
2007-01-31 0:10 ` Robin Rosenberg
2007-01-31 22:17 ` Junio C Hamano
2007-01-31 22:36 ` Robin Rosenberg
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=20070130224446.28311.31828.stgit@lathund.dewire.com \
--to=robin.rosenberg@dewire.com \
--cc=benji@silverinsanity.com \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox