From: "Torsten Bögershausen" <tboegi@web.de>
To: felipe.contreras@gmail.com, christophe@kn.gl
Cc: git@vger.kernel.org, tboegi@web.de
Subject: [PATCH] test-bzr: portable shell and utf-8 strings for Mac OS
Date: Fri, 12 Apr 2013 23:18:20 +0200 [thread overview]
Message-ID: <201304122318.20780.tboegi@web.de> (raw)
Make the shell script more portable:
- Split export X=Y into 2 lines
- Use printf instead of echo -e
Use UTF-8 code points which are not decomposed by the filesystem:
Code points like "á" will be decomposed by Mac OS X.
bzr is unable to find the file "á" on disk.
Use code points from unicode which can not be decomposed.
In other words, the precompsed form use the same bytes as decomposed.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
contrib/remote-helpers/test-bzr.sh | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index e800c97..34666e1 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -169,31 +169,30 @@ test_expect_success 'fetch utf-8 filenames' '
mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
- export LC_ALL=en_US.UTF-8
-
+ LC_ALL=en_US.UTF-8
+ export LC_ALL
(
bzr init bzrrepo &&
cd bzrrepo &&
- echo test >> "áéíóú" &&
- bzr add "áéíóú" &&
- echo test >> "îø∫∆" &&
- bzr add "îø∫∆" &&
- bzr commit -m utf-8 &&
- echo test >> "áéíóú" &&
- bzr commit -m utf-8 &&
- bzr rm "îø∫∆" &&
- bzr mv "áéíóú" "åß∂" &&
- bzr commit -m utf-8
+ echo test >> "ærø" &&
+ bzr add "ærø" &&
+ echo test >> "ø~?" &&
+ bzr add "ø~?" &&
+ bzr commit -m add-utf-8 &&
+ echo test >> "ærø" &&
+ bzr commit -m test-utf-8 &&
+ bzr rm "ø~?" &&
+ bzr mv "ærø" "ø~?" &&
+ bzr commit -m bzr-mv-utf-8
) &&
(
git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo &&
- git ls-files > ../actual
+ git -c core.quotepath=false ls-files > ../actual
) &&
-
- echo "\"\\303\\245\\303\\237\\342\\210\\202\"" > expected &&
+ echo "ø~?" > expected &&
test_cmp expected actual
'
@@ -201,7 +200,8 @@ test_expect_success 'push utf-8 filenames' '
mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
- export LC_ALL=en_US.UTF-8
+ LC_ALL=en_US.UTF-8
+ export LC_ALL
(
bzr init bzrrepo &&
@@ -216,15 +216,15 @@ test_expect_success 'push utf-8 filenames' '
git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo &&
- echo test >> "áéíóú" &&
- git add "áéíóú" &&
+ echo test >> "ærø" &&
+ git add "ærø" &&
git commit -m utf-8 &&
git push
) &&
(cd bzrrepo && bzr ls > ../actual) &&
- echo -e "content\náéíóú" > expected &&
+ printf "content\nærø\n" > expected &&
test_cmp expected actual
'
--
1.8.2.341.g543621f
next reply other threads:[~2013-04-12 21:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-12 21:18 Torsten Bögershausen [this message]
2013-04-12 21:27 ` [PATCH] test-bzr: portable shell and utf-8 strings for Mac OS Felipe Contreras
2013-04-12 22:40 ` 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=201304122318.20780.tboegi@web.de \
--to=tboegi@web.de \
--cc=christophe@kn.gl \
--cc=felipe.contreras@gmail.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;
as well as URLs for NNTP newsgroup(s).