Re: [PATCH] Fail softly if file system does not like test data.

Previous thread: Re: MinGW port usable by Johannes Sixt on Tuesday, January 30, 2007 - 9:31 am. (1 message)

Next thread: Re: newbie questions about git design and features (some wrt hg) by Jakub Narebski on Tuesday, January 30, 2007 - 10:44 am. (1 message)
From: Brian Gernhardt
Date: Tuesday, January 30, 2007 - 9:32 am

* expecting success: 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/"
      )
mkdir: ?: Invalid argument

It looks like one of the odd characters that git's using for the test is
an invalid character for HFS+, so the entire test fails.  Perhaps this
should be made a "soft" failure like all of the SVN tests passing
despite me not having SVN installed, or should a different character be
used somewhere?  Git can't possibly be expected to work in a situation
where the FS fails.

~~ Brian
-

From: Robin Rosenberg
Date: Tuesday, January 30, 2007 - 3:20 pm

tisdag 30 januari 2007 17:32 skrev Brian Gernhardt:

My fault. The problem is that the data is ISO-8859-1, which is invalid
when interpreted as UTF-8.  Another user reported the same problem in cygwin 
on a Korean Windows. The byte sequences are illegal there too.

A number of solution could be concieved, like converting to the local encoding 
first, but that cannot be done beacuase I couldn't find any non-ascii 
characters that would be convertible into any (major) locale. 

Another is to ignore the test if these files cannot be created.

-- robin
-

From: Robin Rosenberg
Date: Tuesday, January 30, 2007 - 3:49 pm

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 
From: Brian Gernhardt
Date: Tuesday, January 30, 2007 - 4:28 pm

Doesn't work, but it's closer.  I can't see where a .gitignore is  
getting set, though.

* expecting success: (mkdir -p "
From: Robin Rosenberg
Date: Tuesday, January 30, 2007 - 5:14 pm

I did not create any .gitignore files, so I have no explanation at this time.

-- robin
-

From: Brian Gernhardt
Date: Tuesday, January 30, 2007 - 10:39 pm

First off, I couldn't get your patch to apply (atop master and next)  
and I don't know why.  I did the change manually though, and still  
got the same error.  I'm not seeing a .gitignore either, so I have no  
idea why the error is showing up.  Anyone else have a guess?

* expecting success: (mkdir -p "
From: Robin Rosenberg
Date: Tuesday, January 30, 2007 - 5:10 pm

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 and skips
    the test if the local file system does not support the test data.
    
    Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

The first version of the patch had two errors. First it had a slash too much, then
it did not clean up after test for applicability and then it was sent UTF-8 encoded
which is wrong for non-utf8 systems. The patch is ment to actually have the
UTF-8 byte sequences and not be translated (it should work regardless on most
systems).

 t/t9200-git-cvsexportcommit.sh |   37 +++++++++++++++++++++++--------------
 1 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index fd0a554..d0d5365 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -169,20 +169,29 @@ 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�dets��det.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�dets��det.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�dets��det.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�dets��det.png &&
-      git commit -a -m "G� det s�g� det" && \
-      id=$(git rev-list --max-count=1 HEAD) &&
-      (cd "$CVSWORK" &&
-      git-cvsexportcommit -v -c $id &&
-      test "$(echo $(sort ...
Previous thread: Re: MinGW port usable by Johannes Sixt on Tuesday, January 30, 2007 - 9:31 am. (1 message)

Next thread: Re: newbie questions about git design and features (some wrt hg) by Jakub Narebski on Tuesday, January 30, 2007 - 10:44 am. (1 message)