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

[PATCH] t6006 (rev-list-format): quote format strings to avoid error on some shells

From
Alexey Shumkin <alex.crezoff@gmail.com>
Date
May 20, 2014, 14:48 UTC
Message-ID
<7a4473fce2948c31f561c6002ab0b1d5ab0ee841.1400597264.git.Alex.Crezoff@gmail.com>
In-Reply-To
<537B5E8C.3070803@ramsay1.demon.co.uk>

Added in 0a144b3 (t4205, t6006: add failing tests for the case when i18n.logOutputEncoding is set, 2014-05-19) tests give no error (somehow) with Bash as /bin/sh but fail for some other shells.

Quote format strings to avoid errors.
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Suggested-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 t/t6006-rev-list-format.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index c6e9a73..19434ad 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -149,7 +149,7 @@ commit $head1
 $added
 EOF
 
-test_format subject-truncated %<($truncate_count,trunc)%s <<EOF
+test_format subject-truncated "%<($truncate_count,trunc)%s" <<EOF
 commit $head2
 changed (ge${changed_utf8_part}ndert)..
 commit $head1
@@ -259,7 +259,7 @@ commit $head1
 $added_iso88591
 EOF
 
-test_format complex-subject-trunc %<($truncate_count,trunc)%s <<EOF
+test_format complex-subject-trunc "%<($truncate_count,trunc)%s" <<EOF
 commit $head3
 Test printing of c..
 commit $head2
@@ -268,7 +268,7 @@ commit $head1
 added (hinzugef${added_utf8_part_iso88591}gt..
 EOF
 
-test_format complex-subject-mtrunc %<($truncate_count,mtrunc)%s <<EOF
+test_format complex-subject-mtrunc "%<($truncate_count,mtrunc)%s" <<EOF
 commit $head3
 Test prin..ex bodies
 commit $head2
@@ -277,7 +277,7 @@ commit $head1
 added (hi..f${added_utf8_part_iso88591}gt) foo
 EOF
 
-test_format complex-subject-ltrunc %<($truncate_count,ltrunc)%s <<EOF
+test_format complex-subject-ltrunc "%<($truncate_count,ltrunc)%s" <<EOF
 commit $head3
 .. of complex bodies
 commit $head2
@@ -314,7 +314,7 @@ commit $head1
 $added
 EOF
 
-test_format complex-subject-commitencoding-unset-trunc %<($truncate_count,trunc)%s <<EOF
+test_format complex-subject-commitencoding-unset-trunc "%<($truncate_count,trunc)%s" <<EOF
 commit $head3
 Test printing of c..
 commit $head2
@@ -323,7 +323,7 @@ commit $head1
 added (hinzugef${added_utf8_part}gt..
 EOF
 
-test_format complex-subject-commitencoding-unset-mtrunc %<($truncate_count,mtrunc)%s <<EOF
+test_format complex-subject-commitencoding-unset-mtrunc "%<($truncate_count,mtrunc)%s" <<EOF
 commit $head3
 Test prin..ex bodies
 commit $head2
@@ -332,7 +332,7 @@ commit $head1
 added (hi..f${added_utf8_part}gt) foo
 EOF
 
-test_format complex-subject-commitencoding-unset-ltrunc %<($truncate_count,ltrunc)%s <<EOF
+test_format complex-subject-commitencoding-unset-ltrunc "%<($truncate_count,ltrunc)%s" <<EOF
 commit $head3
 .. of complex bodies
 commit $head2
-- 
1.9.2-17
Previous: Alexey ShumkinNext: Ramsay Jones
Message 9 of 11 in “t6006-*.sh: Fix truncation tests”
  1. t6006-*.sh: Fix truncation testsRamsay Jones, May 20, 2014
  2. Alexey ShumkinMay 20, 2014
  3. Alexey ShumkinMay 20, 2014
  4. Ramsay JonesMay 20, 2014
  5. Alexey ShumkinMay 20, 2014
  6. Ramsay JonesMay 20, 2014
  7. Junio C HamanoMay 20, 2014
  8. Alexey ShumkinMay 21, 2014
  9. t6006 (rev-list-format): quote format strings to avoid error on some shellsAlexey Shumkin, May 20, 2014
  10. Ramsay JonesMay 20, 2014
  11. Alexey ShumkinMay 21, 2014

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.