git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Prohaska <prohaska@zib.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, mitcht.git@gmail.com,
	Steffen Prohaska <prohaska@zib.de>
Subject: [PATCH] Add tests for filesystem challenges (case and unicode normalization)
Date: Sun, 24 Feb 2008 18:19:09 +0100	[thread overview]
Message-ID: <1203873549507-git-send-email-prohaska@zib.de> (raw)
In-Reply-To: <7vlk5vjpi4.fsf@gitster.siamese.dyndns.org>

Unfortunately, I had no time to start the real work of fixing the
issues that are tested below.  But at least the tests should be in
good shape now and could be applied.

    Steffen

-- 8< --
Git has difficulties on file systems that do not properly
distinguish case or modify filenames in unexpected ways.  The two
major examples are Windows and Mac OS X.  Both systems preserve
case of file names but do not distinguish between filenames that
differ only by case.  Simple operations such as "git mv" or
"git merge" can fail unexpectedly.  In addition, Mac OS X normalizes
unicode, which make git's life even harder.

This commit adds tests that currently fail but should pass if
file system as decribed above are fully supported.  The test need
to be run on Windows and Mac X as they already pass on Linux.

Mitch Tishmack is the original author of the tests for unicode
normalization.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 t/t0050-filesystem.sh |   67 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100755 t/t0050-filesystem.sh

diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
new file mode 100755
index 0000000..a0ab02e
--- /dev/null
+++ b/t/t0050-filesystem.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+test_description='Various filesystem issues'
+
+. ./test-lib.sh
+
+test_expect_success "setup case tests" '
+
+	touch camelcase &&
+	git add camelcase &&
+	git commit -m "initial" &&
+	git tag initial &&
+	git checkout -b topic &&
+	git mv camelcase tmp &&
+	git mv tmp CamelCase &&
+	git commit -m "rename" &&
+	git checkout -f master
+
+'
+
+test_expect_failure 'rename (case change)' '
+
+	git mv camelcase CamelCase &&
+	git commit -m "rename"
+
+'
+
+test_expect_failure 'merge (case change)' '
+
+	git reset --hard initial &&
+	git merge topic
+
+'
+
+auml=`perl -CO -e 'print pack("U",0x00E4)'`
+aumlcdiar=`perl -CO -e 'print pack("U",0x0061).pack("U",0x0308)'`
+test_expect_success "setup unicode normalization tests" "
+
+  test_create_repo unicode &&
+  cd unicode &&
+  touch $aumlcdiar &&
+  git add $aumlcdiar &&
+  git commit -m \"initial\"
+  git tag initial &&
+  git checkout -b topic &&
+  git mv $aumlcdiar tmp &&
+  git mv tmp $auml &&
+  git commit -m \"rename\" &&
+  git checkout -f master
+
+"
+
+test_expect_failure 'rename (silent unicode normalization)' "
+
+ git mv $aumlcdiar $auml &&
+ git commit -m \"rename\"
+
+"
+
+test_expect_failure 'merge (silent unicode normalization)' '
+
+ git reset --hard initial &&
+ git merge topic
+
+'
+
+test_done
-- 
1.5.4.3.310.g78af

  reply	other threads:[~2008-02-24 17:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08  7:09 Add case-challenged file system tests Steffen Prohaska
2008-02-08  7:09 ` [PATCH] [WIP] git on MacOSX and files with decomposed utf-8 file names Steffen Prohaska
2008-02-08 18:02 ` Add case-challenged file system tests Junio C Hamano
2008-02-24 17:19   ` Steffen Prohaska [this message]
2008-02-25 20:44     ` [PATCH] Add tests for filesystem challenges (case and unicode normalization) Junio C Hamano
2008-02-25 23:34       ` Steffen Prohaska
2008-02-26  0:28         ` 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

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

  git send-email \
    --in-reply-to=1203873549507-git-send-email-prohaska@zib.de \
    --to=prohaska@zib.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mitcht.git@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).