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

[PATCH] Add tests for filesystem challenges (case and unicode normalization)

From
Steffen Prohaska <prohaska@zib.de>
Date
Feb 24, 2008, 17:19 UTC
Message-ID
<1203873549507-git-send-email-prohaska@zib.de>
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
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “Add case-challenged file system tests”
  1. Steffen ProhaskaFeb 8, 2008
  2. [WIP] git on MacOSX and files with decomposed utf-8 file namesSteffen Prohaska, Feb 8, 2008
  3. Junio C HamanoFeb 8, 2008
  4. Add tests for filesystem challenges (case and unicode normalization)Steffen Prohaska, Feb 24, 2008
  5. Junio C HamanoFeb 25, 2008
  6. Steffen ProhaskaFeb 25, 2008
  7. Junio C HamanoFeb 26, 2008

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.