From 3fb0459bc89bebb07e0603ce3ce92dbbc8a39ea4 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 11 Apr 2012 13:24:01 +0200 Subject: tests: modernise style: more uses of test_line_count Prefer: test_line_count COUNT FILE over: test $(wc -l COUNT (or similar usages) in several tests. Signed-off-by: Stefano Lattarini Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 444279077e..a01d244502 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -188,23 +188,23 @@ test_expect_success 'empty email' ' test_expect_success 'del LF before empty (1)' ' git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual && - test $(wc -l actual && - test $(wc -l actual && - test $(wc -l actual && - test $(wc -l test.txt && - test $(git rev-list --oneline HEAD | wc -l) -eq 5 && - test $(git rev-list --oneline --graph HEAD | wc -l) -eq 5 + test_line_count = 5 test.txt && + git rev-list --oneline --graph HEAD >testg.txt && + test_line_count = 5 testg.txt ' test_done -- cgit v1.2.1 From d9955fd60fa79da1e7310a55c30e2d87c227d6f9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 22 May 2012 02:12:20 -0400 Subject: fix off-by-one error in split_ident_line Commit 4b340cf split the logic to parse an ident line out of pretty.c's format_person_part. But in doing so, it accidentally introduced an off-by-one error that caused it to think that single-character names were invalid. This manifested itself as the "%an" format failing to show anything at all for a single-character name. Reported-by: Brian Turner Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 444279077e..244701e96e 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -282,4 +282,11 @@ test_expect_success 'oneline with empty message' ' test $(git rev-list --oneline --graph HEAD | wc -l) -eq 5 ' +test_expect_success 'single-character name is parsed correctly' ' + git commit --author="a " --allow-empty -m foo && + echo "a " >expect && + git log -1 --format="%an <%ae>" >actual && + test_cmp expect actual +' + test_done -- cgit v1.2.1 From 2581ad5e85f6443b0d2cf6898793662aec47ef10 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 17 Dec 2012 17:56:23 -0500 Subject: t6006: clean up whitespace The test_format function did not indent its in-line test script in an attempt to make the output of the test look better. But it does not make a big difference to the output, and the source looks quite ugly. Let's use our normal indenting instead. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index f94f0c48e6..c0c62c9da0 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -11,12 +11,12 @@ touch foo && git add foo && git commit -m "added foo" && ' # usage: test_format name format_string expect.$1 test_expect_success "format $1" " -git rev-list --pretty=format:'$2' master >output.$1 && -test_cmp expect.$1 output.$1 -" + git rev-list --pretty=format:'$2' master >output.$1 && + test_cmp expect.$1 output.$1 + " } test_format percent %%h <<'EOF' -- cgit v1.2.1 From 30825178fb72e3664bd1bda7c02c62e300e2e5ce Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 17 Dec 2012 17:56:49 -0500 Subject: log --format: teach %C(auto,black) to respect color config Traditionally, %C(color attr) always emitted the ANSI color sequence; it was up to the scripts that wanted to conditionally color their output to omit %C(...) specifier when they do not want colors. Optionally allow "auto," to be prefixed to the color, so that the output is colored iff we would color regular "log" output (e.g., taking into account color.* and --color command line options). Tests and pretty_context bits by Jeff King . Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index c0c62c9da0..3fc3b74c8e 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -3,6 +3,7 @@ test_description='git rev-list --pretty=format test' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-terminal.sh test_tick test_expect_success 'setup' ' @@ -19,6 +20,18 @@ test_format () { " } +# Feed to --format to provide predictable colored sequences. +AUTO_COLOR='%C(auto,red)foo%C(auto,reset)' +has_color () { + printf '\033[31mfoo\033[m\n' >expect && + test_cmp expect "$1" +} + +has_no_color () { + echo foo >expect && + test_cmp expect "$1" +} + test_format percent %%h <<'EOF' commit 131a310eb913d107dd3c09a65d1651175898735d %h @@ -124,6 +137,48 @@ commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873 foo EOF +test_expect_success '%C(auto) does not enable color by default' ' + git log --format=$AUTO_COLOR -1 >actual && + has_no_color actual +' + +test_expect_success '%C(auto) enables colors for color.diff' ' + git -c color.diff=always log --format=$AUTO_COLOR -1 >actual && + has_color actual +' + +test_expect_success '%C(auto) enables colors for color.ui' ' + git -c color.ui=always log --format=$AUTO_COLOR -1 >actual && + has_color actual +' + +test_expect_success '%C(auto) respects --color' ' + git log --format=$AUTO_COLOR -1 --color >actual && + has_color actual +' + +test_expect_success '%C(auto) respects --no-color' ' + git -c color.ui=always log --format=$AUTO_COLOR -1 --no-color >actual && + has_no_color actual +' + +test_expect_success TTY '%C(auto) respects --color=auto (stdout is tty)' ' + ( + TERM=vt100 && export TERM && + test_terminal \ + git log --format=$AUTO_COLOR -1 --color=auto >actual && + has_color actual + ) +' + +test_expect_success '%C(auto) respects --color=auto (stdout not tty)' ' + ( + TERM=vt100 && export TERM && + git log --format=$AUTO_COLOR -1 --color=auto >actual && + has_no_color actual + ) +' + cat >commit-msg <<'EOF' Test printing of complex bodies -- cgit v1.2.1 From 7e77df39bf20f04b266f394a64c2fca54c1e5db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 19 Apr 2013 09:08:47 +1000 Subject: pretty: two phase conversion for non utf-8 commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Always assume format_commit_item() takes an utf-8 string for string handling simplicity (we can handle utf-8 strings, but can't with other encodings). If commit message is in non-utf8, or output encoding is not, then the commit is first converted to utf-8, processed, then output converted to output encoding. This of course only works with encodings that are compatible with Unicode. This also fixes the iso8859-1 test in t6006. It's supposed to create an iso8859-1 commit, but the commit content in t6006 is in UTF-8. t6006 is now converted back in UTF-8 (the downside is we can't put utf-8 strings there anymore). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 3fc3b74c8e..0393c9fd0b 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -184,7 +184,7 @@ Test printing of complex bodies This commit message is much longer than the others, and it will be encoded in iso8859-1. We should therefore -include an iso8859 character: ¡bueno! +include an iso8859 character: bueno! EOF test_expect_success 'setup complex body' ' git config i18n.commitencoding iso8859-1 && @@ -192,14 +192,14 @@ git config i18n.commitencoding iso8859-1 && ' test_format complex-encoding %e <<'EOF' -commit f58db70b055c5718631e5c61528b28b12090cdea +commit 1ed88da4a5b5ed8c449114ac131efc62178734c3 iso8859-1 commit 131a310eb913d107dd3c09a65d1651175898735d commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873 EOF test_format complex-subject %s <<'EOF' -commit f58db70b055c5718631e5c61528b28b12090cdea +commit 1ed88da4a5b5ed8c449114ac131efc62178734c3 Test printing of complex bodies commit 131a310eb913d107dd3c09a65d1651175898735d changed foo @@ -208,17 +208,17 @@ added foo EOF test_format complex-body %b <<'EOF' -commit f58db70b055c5718631e5c61528b28b12090cdea +commit 1ed88da4a5b5ed8c449114ac131efc62178734c3 This commit message is much longer than the others, and it will be encoded in iso8859-1. We should therefore -include an iso8859 character: ¡bueno! +include an iso8859 character: bueno! commit 131a310eb913d107dd3c09a65d1651175898735d commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873 EOF test_expect_success '%x00 shows NUL' ' - echo >expect commit f58db70b055c5718631e5c61528b28b12090cdea && + echo >expect commit 1ed88da4a5b5ed8c449114ac131efc62178734c3 && echo >>expect fooQbar && git rev-list -1 --format=foo%x00bar HEAD >actual.nul && nul_to_q actual && -- cgit v1.2.1 From 77a6815d7d5be7031324788f9935587bdb00de60 Mon Sep 17 00:00:00 2001 From: Alexey Shumkin Date: Wed, 26 Jun 2013 14:19:46 +0400 Subject: t6006 (rev-list-format): don't hardcode SHA-1 in expected outputs The expected SHA-1 digests are always available in variables. Use them instead of hardcoding. Signed-off-by: Alexey Shumkin Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 140 +++++++++++++++++++++++++-------------------- 1 file changed, 77 insertions(+), 63 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 0393c9fd0b..cc1008d024 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -7,8 +7,19 @@ test_description='git rev-list --pretty=format test' test_tick test_expect_success 'setup' ' -touch foo && git add foo && git commit -m "added foo" && - echo changed >foo && git commit -a -m "changed foo" + : >foo && + git add foo && + git commit -m "added foo" && + head1=$(git rev-parse --verify HEAD) && + head1_short=$(git rev-parse --verify --short $head1) && + tree1=$(git rev-parse --verify HEAD:) && + tree1_short=$(git rev-parse --verify --short $tree1) && + echo changed >foo && + git commit -a -m "changed foo" && + head2=$(git rev-parse --verify HEAD) && + head2_short=$(git rev-parse --verify --short $head2) && + tree2=$(git rev-parse --verify HEAD:) && + tree2_short=$(git rev-parse --verify --short $tree2) ' # usage: test_format name format_string foo && git commit -a -F commit-msg + git config i18n.commitencoding iso8859-1 && + echo change2 >foo && git commit -a -F commit-msg && + head3=$(git rev-parse --verify HEAD) && + head3_short=$(git rev-parse --short $head3) ' -test_format complex-encoding %e <<'EOF' -commit 1ed88da4a5b5ed8c449114ac131efc62178734c3 +test_format complex-encoding %e <expect commit 1ed88da4a5b5ed8c449114ac131efc62178734c3 && + echo >expect commit $head3 && echo >>expect fooQbar && git rev-list -1 --format=foo%x00bar HEAD >actual.nul && nul_to_q actual && -- cgit v1.2.1 From de6029a2d7734a93a9e27b9c4471862a47dd8123 Mon Sep 17 00:00:00 2001 From: Alexey Shumkin Date: Wed, 26 Jun 2013 14:19:49 +0400 Subject: pretty: Add failing tests: --format output should honor logOutputEncoding One can set an alias $ git config alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date=local" to see the log as a pretty tree (like *gitk* but in a terminal). However, log messages written in an encoding i18n.commitEncoding which differs from terminal encoding are shown corrupted even when i18n.logOutputEncoding and terminal encoding are the same (e.g. log messages committed on a Cygwin box with Windows-1251 encoding seen on a Linux box with a UTF-8 encoding and vice versa). To simplify an example we can say the following two commands are expected to give the same output to a terminal: $ git log --oneline --no-color $ git log --pretty=format:'%h %s' However, the former pays attention to i18n.logOutputEncoding configuration, while the latter does not when it formats "%s". The same corruption is true for $ git diff --submodule=log and $ git rev-list --pretty=format:%s HEAD and $ git reset --hard This patch adds failing tests for the next patch that fixes them. Signed-off-by: Alexey Shumkin Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 83 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 24 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index cc1008d024..c66a07f8da 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -1,34 +1,60 @@ #!/bin/sh +# Copyright (c) 2009 Jens Lehmann +# Copyright (c) 2011 Alexey Shumkin (+ non-UTF-8 commit encoding tests) + test_description='git rev-list --pretty=format test' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh test_tick +# String "added" in German (translated with Google Translate), encoded in UTF-8, +# used as a commit log message below. +added=$(printf "added (hinzugef\303\274gt) foo") +added_iso88591=$(echo "$added" | iconv -f utf-8 -t iso-8859-1) +# same but "changed" +changed=$(printf "changed (ge\303\244ndert) foo") +changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t iso-8859-1) + test_expect_success 'setup' ' : >foo && git add foo && - git commit -m "added foo" && + git config i18n.commitEncoding iso-8859-1 && + git commit -m "$added_iso88591" && head1=$(git rev-parse --verify HEAD) && head1_short=$(git rev-parse --verify --short $head1) && tree1=$(git rev-parse --verify HEAD:) && tree1_short=$(git rev-parse --verify --short $tree1) && - echo changed >foo && - git commit -a -m "changed foo" && + echo "$changed" > foo && + git commit -a -m "$changed_iso88591" && head2=$(git rev-parse --verify HEAD) && head2_short=$(git rev-parse --verify --short $head2) && tree2=$(git rev-parse --verify HEAD:) && tree2_short=$(git rev-parse --verify --short $tree2) + git config --unset i18n.commitEncoding ' -# usage: test_format name format_string expect.$1 - test_expect_success "format $1" " - git rev-list --pretty=format:'$2' master >output.$1 && - test_cmp expect.$1 output.$1 - " + name="format $1" + command="git rev-list --pretty=format:'$2' master >output.$1 && + test_cmp expect.$1 output.$1" + if test $must_fail -eq 1 + then + test_expect_failure "$name" "$command" + else + test_expect_success "$name" "$command" + fi } # Feed to --format to provide predictable colored sequences. @@ -110,14 +136,16 @@ EOF test_format encoding %e <commit-msg <<'EOF' +iconv -f utf-8 -t iso8859-1 > commit-msg <foo && git commit -a -F commit-msg && head3=$(git rev-parse --verify HEAD) && - head3_short=$(git rev-parse --short $head3) + head3_short=$(git rev-parse --short $head3) && + # unset commit encoding config + # otherwise %e does not print encoding value + # and following test fails + git config --unset i18n.commitEncoding + ' test_format complex-encoding %e <actual && - test $(wc -w actual && - test $(wc -w Date: Wed, 26 Jun 2013 14:19:50 +0400 Subject: pretty: --format output should honor logOutputEncoding One can set an alias $ git config [--global] alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date=local" to see the log as a pretty tree (like *gitk* but in a terminal). However, log messages written in an encoding i18n.commitEncoding which differs from terminal encoding are shown corrupted even when i18n.logOutputEncoding and terminal encoding are the same (e.g. log messages committed on a Cygwin box with Windows-1251 encoding seen on a Linux box with a UTF-8 encoding and vice versa). To simplify an example we can say the following two commands are expected to give the same output to a terminal: $ git log --oneline --no-color $ git log --pretty=format:'%h %s' However, the former pays attention to i18n.logOutputEncoding configuration, while the latter does not when it formats "%s". The same corruption is true for $ git diff --submodule=log and $ git rev-list --pretty=format:%s HEAD and $ git reset --hard This patch makes pretty --format honor logOutputEncoding when it formats log message. Signed-off-by: Alexey Shumkin Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index c66a07f8da..380c85bf12 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -141,7 +141,7 @@ commit $head1 iso-8859-1 EOF -test_format failure subject %s < Date: Thu, 4 Jul 2013 16:45:46 +0400 Subject: t4041, t4205, t6006, t7102: use iso8859-1 rather than iso-8859-1 Both "iso8859-1" and "iso-8859-1" are understood as latin-1 by modern platforms, but the latter is not understood by older platforms;update tests to use the former. This is in line with 3994e8a9 (t4201: use ISO8859-1 rather than ISO-8859-1, 2009-12-03), which did the same. Signed-off-by: Alexey Shumkin Reviewed-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 380c85bf12..4751d22217 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -12,15 +12,15 @@ test_tick # String "added" in German (translated with Google Translate), encoded in UTF-8, # used as a commit log message below. added=$(printf "added (hinzugef\303\274gt) foo") -added_iso88591=$(echo "$added" | iconv -f utf-8 -t iso-8859-1) +added_iso88591=$(echo "$added" | iconv -f utf-8 -t iso8859-1) # same but "changed" changed=$(printf "changed (ge\303\244ndert) foo") -changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t iso-8859-1) +changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t iso8859-1) test_expect_success 'setup' ' : >foo && git add foo && - git config i18n.commitEncoding iso-8859-1 && + git config i18n.commitEncoding iso8859-1 && git commit -m "$added_iso88591" && head1=$(git rev-parse --verify HEAD) && head1_short=$(git rev-parse --verify --short $head1) && @@ -136,9 +136,9 @@ EOF test_format encoding %e < Date: Fri, 5 Jul 2013 16:01:48 +0400 Subject: t4205, t6006, t7102: make functions better readable Function 'test_format' has become harder to read after its change in de6029a2 (pretty: Add failing tests: --format output should honor logOutputEncoding, 2013-06-26). Simplify it by moving its "should we expect it to fail?" parameter to the end. Note, current code does not use this last parameter as far as there are no tests expected to fail. We can keep that for future use. Also, reformat comments. Signed-off-by: Alexey Shumkin Improved-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 4751d22217..b32405a760 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -9,8 +9,9 @@ test_description='git rev-list --pretty=format test' . "$TEST_DIRECTORY"/lib-terminal.sh test_tick -# String "added" in German (translated with Google Translate), encoded in UTF-8, -# used as a commit log message below. +# String "added" in German +# (translated with Google Translate), +# encoded in UTF-8, used as a commit log message below. added=$(printf "added (hinzugef\303\274gt) foo") added_iso88591=$(echo "$added" | iconv -f utf-8 -t iso8859-1) # same but "changed" @@ -35,26 +36,13 @@ test_expect_success 'setup' ' git config --unset i18n.commitEncoding ' -# usage: test_format [failure] name format_string expect.$1 - name="format $1" - command="git rev-list --pretty=format:'$2' master >output.$1 && - test_cmp expect.$1 output.$1" - if test $must_fail -eq 1 - then - test_expect_failure "$name" "$command" - else - test_expect_success "$name" "$command" - fi + test_expect_${3:-success} "format $1" " + git rev-list --pretty=format:'$2' master >output.$1 && + test_cmp expect.$1 output.$1 + " } # Feed to --format to provide predictable colored sequences. -- cgit v1.2.1 From 0fe6df3ce8e6373536d1a9016cac9126a1aed0da Mon Sep 17 00:00:00 2001 From: Alexey Shumkin Date: Fri, 5 Jul 2013 16:01:49 +0400 Subject: t6006 (rev-list-format): add tests for "%b" and "%s" for the case i18n.commitEncoding is not set In de6029a (pretty: Add failing tests: --format output should honor logOutputEncoding, 2013-06-26) 'complex-subject' test was changed. Revert it back, because that change actually removed tests for "%b" and "%s" with i18n.commitEncoding set. Also, add two more tests for mentioned above "%b" and "%s" to test encoding conversions with no i18n.commitEncoding set. Signed-off-by: Alexey Shumkin Suggested-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 't/t6006-rev-list-format.sh') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index b32405a760..98744038ec 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -218,12 +218,7 @@ test_expect_success 'setup complex body' ' git config i18n.commitencoding iso8859-1 && echo change2 >foo && git commit -a -F commit-msg && head3=$(git rev-parse --verify HEAD) && - head3_short=$(git rev-parse --short $head3) && - # unset commit encoding config - # otherwise %e does not print encoding value - # and following test fails - git config --unset i18n.commitEncoding - + head3_short=$(git rev-parse --short $head3) ' test_format complex-encoding %e <expected.utf-8 && + commit $head3 + This commit message is much longer than the others, + and it will be encoded in iso8859-1. We should therefore + include an iso8859 character: ¡bueno! + + commit $head2 + commit $head1 + EOF + iconv -f utf-8 -t iso8859-1 expected.utf-8 >expected.iso8859-1 +' + +test_format complex-body %b expect commit $head3 && echo >>expect fooQbar && -- cgit v1.2.1