Skip to content
Snippets Groups Projects
Commit fbbdbc8a authored by David M. Carr's avatar David M. Carr
Browse files

tests: make test-encoding.t compatible with git 1.8.0

It looks like Git 1.8.0 started silently converting latin1 commit messages to
utf-8.  That changed the result of this test.  This changeset alters the test
to make it accept both the pre-1.8.0 and post-1.8.0 behaviors.

https://raw.github.com/git/git/master/Documentation/RelNotes/1.8.0.txt
parent 8e8d06e7
No related branches found
No related tags found
No related merge requests found
...@@ -28,4 +28,6 @@ ...@@ -28,4 +28,6 @@
$ git add alpha $ git add alpha
$ commit -m 'add älphà' $ commit -m 'add älphà'
Create some commits using latin1 encoding
The warning message changed in Git 1.8.0
$ . $TESTDIR/latin-1-encoding $ . $TESTDIR/latin-1-encoding
...@@ -31,4 +33,4 @@ ...@@ -31,4 +33,4 @@
$ . $TESTDIR/latin-1-encoding $ . $TESTDIR/latin-1-encoding
Warning: commit message does not conform to UTF-8. Warning: commit message (did|does) not conform to UTF-8. (re)
You may want to amend it after fixing the message, or set the config You may want to amend it after fixing the message, or set the config
variable i18n.commitencoding to the encoding your project uses. variable i18n.commitencoding to the encoding your project uses.
...@@ -33,6 +35,6 @@ ...@@ -33,6 +35,6 @@
You may want to amend it after fixing the message, or set the config You may want to amend it after fixing the message, or set the config
variable i18n.commitencoding to the encoding your project uses. variable i18n.commitencoding to the encoding your project uses.
Warning: commit message does not conform to UTF-8. Warning: commit message (did|does) not conform to UTF-8. (re)
You may want to amend it after fixing the message, or set the config You may want to amend it after fixing the message, or set the config
variable i18n.commitencoding to the encoding your project uses. variable i18n.commitencoding to the encoding your project uses.
...@@ -45,7 +47,9 @@ ...@@ -45,7 +47,9 @@
4 files updated, 0 files merged, 0 files removed, 0 files unresolved 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd hgrepo $ cd hgrepo
$ HGENCODING=utf-8 hg log --graph --debug | grep -v ': *master' | grep -v phase: Latin1 commit messages started being automatically converted to UTF-8 in
@ changeset: 3:8549ee7fe0801b2dafc06047ca6f66d36da709f5 Git 1.8.0, so we accept the output of either version.
$ HGENCODING=utf-8 hg log --graph --debug | grep -v ': *master' | grep -v 'phase:' | grep -v ': *author=' | grep -v ': *message='
@ changeset: 3:(8549ee7fe0801b2dafc06047ca6f66d36da709f5|c3d3e39fc04f7e2e8cdb95f090415ec1ddc1be70) (re)
| tag: default/master | tag: default/master
| tag: tip | tag: tip
...@@ -50,8 +54,8 @@ ...@@ -50,8 +54,8 @@
| tag: default/master | tag: default/master
| tag: tip | tag: tip
| parent: 2:0422fbb4ec39fb69e87b94a3874ac890333de11a | parent: 2:(0422fbb4ec39fb69e87b94a3874ac890333de11a|f8aa41895a3a771a72520ca205a4685b76649fdd) (re)
| parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000
| manifest: 3:ea49f93388380ead5601c8fcbfa187516e7c2ed8 | manifest: 3:ea49f93388380ead5601c8fcbfa187516e7c2ed8
| user: tést èncödîng <test@example.org> | user: tést èncödîng <test@example.org>
| date: Mon Jan 01 00:00:13 2007 +0000 | date: Mon Jan 01 00:00:13 2007 +0000
| files+: delta | files+: delta
...@@ -53,9 +57,8 @@ ...@@ -53,9 +57,8 @@
| parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000
| manifest: 3:ea49f93388380ead5601c8fcbfa187516e7c2ed8 | manifest: 3:ea49f93388380ead5601c8fcbfa187516e7c2ed8
| user: tést èncödîng <test@example.org> | user: tést èncödîng <test@example.org>
| date: Mon Jan 01 00:00:13 2007 +0000 | date: Mon Jan 01 00:00:13 2007 +0000
| files+: delta | files+: delta
| extra: author=$ \x90\x01\x01\xe9\x91\x03\x03\x01\xe8\x91\x08\x02\x01\xf6\x91\x0c\x01\x01\xee\x91\x0f\x15
| extra: branch=default | extra: branch=default
| extra: committer=test <test@example.org> 1167609613 0 | extra: committer=test <test@example.org> 1167609613 0
| extra: encoding=latin-1 | extra: encoding=latin-1
...@@ -59,8 +62,7 @@ ...@@ -59,8 +62,7 @@
| extra: branch=default | extra: branch=default
| extra: committer=test <test@example.org> 1167609613 0 | extra: committer=test <test@example.org> 1167609613 0
| extra: encoding=latin-1 | extra: encoding=latin-1
| extra: message=\x0c\n\x90\x05\x01\xe9\x91\x07\x02\x01\xe0\x91\x0b\x01
| description: | description:
| add déltà | add déltà
| |
| |
...@@ -63,11 +65,11 @@ ...@@ -63,11 +65,11 @@
| description: | description:
| add déltà | add déltà
| |
| |
o changeset: 2:0422fbb4ec39fb69e87b94a3874ac890333de11a o changeset: 2:(0422fbb4ec39fb69e87b94a3874ac890333de11a|f8aa41895a3a771a72520ca205a4685b76649fdd) (re)
| parent: 1:9f6268bfc9eb3956c5ab8752d7b983b0ffe57115 | parent: 1:(9f6268bfc9eb3956c5ab8752d7b983b0ffe57115|955b24cf6f8f293741d3f39110c6fe554c292533) (re)
| parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000
| manifest: 2:f580e7da3673c137370da2b931a1dee83590d7b4 | manifest: 2:f580e7da3673c137370da2b931a1dee83590d7b4
| user: tést èncödîng <test@example.org> | user: tést èncödîng <test@example.org>
| date: Mon Jan 01 00:00:12 2007 +0000 | date: Mon Jan 01 00:00:12 2007 +0000
| files+: gamma | files+: gamma
...@@ -69,8 +71,7 @@ ...@@ -69,8 +71,7 @@
| parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000
| manifest: 2:f580e7da3673c137370da2b931a1dee83590d7b4 | manifest: 2:f580e7da3673c137370da2b931a1dee83590d7b4
| user: tést èncödîng <test@example.org> | user: tést èncödîng <test@example.org>
| date: Mon Jan 01 00:00:12 2007 +0000 | date: Mon Jan 01 00:00:12 2007 +0000
| files+: gamma | files+: gamma
| extra: author=$ \x90\x01\x01\xe9\x91\x03\x03\x01\xe8\x91\x08\x02\x01\xf6\x91\x0c\x01\x01\xee\x91\x0f\x15
| extra: branch=default | extra: branch=default
| extra: committer=test <test@example.org> 1167609612 0 | extra: committer=test <test@example.org> 1167609612 0
...@@ -75,7 +76,6 @@ ...@@ -75,7 +76,6 @@
| extra: branch=default | extra: branch=default
| extra: committer=test <test@example.org> 1167609612 0 | extra: committer=test <test@example.org> 1167609612 0
| extra: message=\x0c\n\x90\x05\x01\xe4\x91\x07\x02\x01\xe2\x91\x0b\x01
| description: | description:
| add gämmâ | add gämmâ
| |
| |
...@@ -78,11 +78,11 @@ ...@@ -78,11 +78,11 @@
| description: | description:
| add gämmâ | add gämmâ
| |
| |
o changeset: 1:9f6268bfc9eb3956c5ab8752d7b983b0ffe57115 o changeset: 1:(9f6268bfc9eb3956c5ab8752d7b983b0ffe57115|955b24cf6f8f293741d3f39110c6fe554c292533) (re)
| parent: 0:bb7d36568d6188ce0de2392246c43f6f213df954 | parent: 0:bb7d36568d6188ce0de2392246c43f6f213df954
| parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000
| manifest: 1:f0bd6fbafbaebe4bb59c35108428f6fce152431d | manifest: 1:f0bd6fbafbaebe4bb59c35108428f6fce152431d
| user: tést èncödîng <test@example.org> | user: tést èncödîng <test@example.org>
| date: Mon Jan 01 00:00:11 2007 +0000 | date: Mon Jan 01 00:00:11 2007 +0000
| files+: beta | files+: beta
...@@ -83,10 +83,9 @@ ...@@ -83,10 +83,9 @@
| parent: 0:bb7d36568d6188ce0de2392246c43f6f213df954 | parent: 0:bb7d36568d6188ce0de2392246c43f6f213df954
| parent: -1:0000000000000000000000000000000000000000 | parent: -1:0000000000000000000000000000000000000000
| manifest: 1:f0bd6fbafbaebe4bb59c35108428f6fce152431d | manifest: 1:f0bd6fbafbaebe4bb59c35108428f6fce152431d
| user: tést èncödîng <test@example.org> | user: tést èncödîng <test@example.org>
| date: Mon Jan 01 00:00:11 2007 +0000 | date: Mon Jan 01 00:00:11 2007 +0000
| files+: beta | files+: beta
| extra: author=$ \x90\x01\x01\xe9\x91\x03\x03\x01\xe8\x91\x08\x02\x01\xf6\x91\x0c\x01\x01\xee\x91\x0f\x15
| extra: branch=default | extra: branch=default
| extra: committer=test <test@example.org> 1167609611 0 | extra: committer=test <test@example.org> 1167609611 0
| description: | description:
...@@ -113,4 +112,6 @@ ...@@ -113,4 +112,6 @@
searching for changes searching for changes
$ cd .. $ cd ..
Latin1 commit messages started being automatically converted to UTF-8 in
Git 1.8.0, so we accept the output of either version.
$ git --git-dir=gitrepo2 log --pretty=medium $ git --git-dir=gitrepo2 log --pretty=medium
...@@ -116,7 +117,7 @@ ...@@ -116,7 +117,7 @@
$ git --git-dir=gitrepo2 log --pretty=medium $ git --git-dir=gitrepo2 log --pretty=medium
commit da0edb01d4f3d1abf08b1be298379b0b2960e680 commit (da0edb01d4f3d1abf08b1be298379b0b2960e680|51c509c1c7eeb8f0a5b20aa3e894e8823f39171f) (re)
Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc) Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
Date: Mon Jan 1 00:00:13 2007 +0000 Date: Mon Jan 1 00:00:13 2007 +0000
add d\xe9lt\xe0 (esc) add d\xe9lt\xe0 (esc)
...@@ -118,9 +119,9 @@ ...@@ -118,9 +119,9 @@
Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc) Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
Date: Mon Jan 1 00:00:13 2007 +0000 Date: Mon Jan 1 00:00:13 2007 +0000
add d\xe9lt\xe0 (esc) add d\xe9lt\xe0 (esc)
commit 2372b6c8f1b91f2db8ae5eb0f9e0427c318b449c commit (2372b6c8f1b91f2db8ae5eb0f9e0427c318b449c|bd576458238cbda49ffcfbafef5242e103f1bc24) (re)
Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc) Author: * <test@example.org> (glob)
Date: Mon Jan 1 00:00:12 2007 +0000 Date: Mon Jan 1 00:00:12 2007 +0000
...@@ -125,4 +126,4 @@ ...@@ -125,4 +126,4 @@
Date: Mon Jan 1 00:00:12 2007 +0000 Date: Mon Jan 1 00:00:12 2007 +0000
add g\xe4mm\xe2 (esc) add g*mm* (glob)
...@@ -128,6 +129,6 @@ ...@@ -128,6 +129,6 @@
commit 9ef7f6dcffe643b89ba63f3323621b9a923e4802 commit (9ef7f6dcffe643b89ba63f3323621b9a923e4802|7a7e86fc1b24db03109c9fe5da28b352de59ce90) (re)
Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc) Author: * <test@example.org> (glob)
Date: Mon Jan 1 00:00:11 2007 +0000 Date: Mon Jan 1 00:00:11 2007 +0000
add beta add beta
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment