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

Re: Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authors

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2013, 21:25 UTC
Message-ID
<xmqqd2ow2nqi.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqqhae82nsb.fsf_-_@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Actually, I think not fixing it inside that 1/8 is good, as there
> are many existing "cmd > file" (and worse, "cmd > file-$x") in these
> test-*.sh scripts.  Clean-up is better done as a follow-up patch.
>
> Here are two that I noticed.
>
> -- >8 --
> Subject: [PATCH 9/8] contrib/remote-helpers: style updates for test scripts
And here is the second one.
-- >8 --
Subject: [PATCH 10/8] remote-helpers: quote variable references in redirection targets

Even though it is not required by POSIX to double-quote the redirection target in a variable, our code does so because some versions of bash issue a warning without the quotes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/remote-helpers/test-hg-hg-git.sh | 40 ++++++++++++++++----------------
 1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh
index a5123ca..6dcd95d 100755
--- a/contrib/remote-helpers/test-hg-hg-git.sh
+++ b/contrib/remote-helpers/test-hg-hg-git.sh
@@ -144,10 +144,10 @@ test_expect_success 'executable bit' '
 		hg_log . &&
 		hg manifest -r 1 -v &&
 		hg manifest -v
-		) >output-$x &&
+		) >"output-$x" &&
 
 		git_clone_$x hgrepo-$x gitrepo2-$x &&
-		git_log gitrepo2-$x >log-$x
+		git_log gitrepo2-$x >"log-$x"
 	done &&
 
 	test_cmp output-hg output-git &&
@@ -175,10 +175,10 @@ test_expect_success 'symlink' '
 		cd hgrepo-$x &&
 		hg_log . &&
 		hg manifest -v
-		) >output-$x &&
+		) >"output-$x" &&
 
 		git_clone_$x hgrepo-$x gitrepo2-$x &&
-		git_log gitrepo2-$x >log-$x
+		git_log gitrepo2-$x >"log-$x"
 	done &&
 
 	test_cmp output-hg output-git &&
@@ -212,8 +212,8 @@ test_expect_success 'merge conflict 1' '
 	do
 		git_clone_$x hgrepo1 gitrepo-$x &&
 		hg_clone_$x gitrepo-$x hgrepo2-$x &&
-		hg_log hgrepo2-$x >hg-log-$x &&
-		git_log gitrepo-$x >git-log-$x
+		hg_log hgrepo2-$x >"hg-log-$x" &&
+		git_log gitrepo-$x >"git-log-$x"
 	done &&
 
 	test_cmp hg-log-hg hg-log-git &&
@@ -247,8 +247,8 @@ test_expect_success 'merge conflict 2' '
 	do
 		git_clone_$x hgrepo1 gitrepo-$x &&
 		hg_clone_$x gitrepo-$x hgrepo2-$x &&
-		hg_log hgrepo2-$x >hg-log-$x &&
-		git_log gitrepo-$x >git-log-$x
+		hg_log hgrepo2-$x >"hg-log-$x" &&
+		git_log gitrepo-$x >"git-log-$x"
 	done &&
 
 	test_cmp hg-log-hg hg-log-git &&
@@ -283,8 +283,8 @@ test_expect_success 'converged merge' '
 	do
 		git_clone_$x hgrepo1 gitrepo-$x &&
 		hg_clone_$x gitrepo-$x hgrepo2-$x &&
-		hg_log hgrepo2-$x >hg-log-$x &&
-		git_log gitrepo-$x >git-log-$x
+		hg_log hgrepo2-$x >"hg-log-$x" &&
+		git_log gitrepo-$x >"git-log-$x"
 	done &&
 
 	test_cmp hg-log-hg hg-log-git &&
@@ -323,8 +323,8 @@ test_expect_success 'encoding' '
 		hg_clone_$x gitrepo hgrepo-$x &&
 		git_clone_$x hgrepo-$x gitrepo2-$x &&
 
-		HGENCODING=utf-8 hg_log hgrepo-$x >hg-log-$x &&
-		git_log gitrepo2-$x >git-log-$x
+		HGENCODING=utf-8 hg_log hgrepo-$x >"hg-log-$x" &&
+		git_log gitrepo2-$x >"git-log-$x"
 	done &&
 
 	test_cmp hg-log-hg hg-log-git &&
@@ -361,10 +361,10 @@ test_expect_success 'file removal' '
 		hg_log . &&
 		hg manifest -r 3 &&
 		hg manifest
-		) >output-$x &&
+		) >"output-$x" &&
 
 		git_clone_$x hgrepo-$x gitrepo2-$x &&
-		git_log gitrepo2-$x >log-$x
+		git_log gitrepo2-$x >"log-$x"
 	done &&
 
 	test_cmp output-hg output-git &&
@@ -392,7 +392,7 @@ test_expect_success 'git tags' '
 	for x in hg git
 	do
 		hg_clone_$x gitrepo hgrepo-$x &&
-		hg_log hgrepo-$x >log-$x
+		hg_log hgrepo-$x >"log-$x"
 	done &&
 
 	test_cmp log-hg log-git
@@ -457,8 +457,8 @@ test_expect_success 'hg author' '
 		hg_push_$x hgrepo-$x gitrepo-$x &&
 		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 
-		hg_log hgrepo2-$x >hg-log-$x &&
-		git_log gitrepo-$x >git-log-$x
+		hg_log hgrepo2-$x >"hg-log-$x" &&
+		git_log gitrepo-$x >"git-log-$x"
 	done &&
 
 	test_cmp hg-log-hg hg-log-git &&
@@ -494,8 +494,8 @@ test_expect_success 'hg branch' '
 		hg_push_$x hgrepo-$x gitrepo-$x &&
 		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 
-		hg_log hgrepo2-$x >hg-log-$x &&
-		git_log gitrepo-$x >git-log-$x
+		hg_log hgrepo2-$x >"hg-log-$x" &&
+		git_log gitrepo-$x >"git-log-$x"
 	done &&
 
 	test_cmp hg-log-hg hg-log-git &&
@@ -532,7 +532,7 @@ test_expect_success 'hg tags' '
 		git --git-dir=gitrepo-$x/.git tag -l &&
 		hg_log hgrepo2-$x &&
 		cat hgrepo2-$x/.hgtags
-		) >output-$x
+		) >"output-$x"
 	done &&
 
 	test_cmp output-hg output-git
-- 
1.8.4-335-g2c126a6
Previous: Junio C HamanoNext: Michael Haggerty
Message 13 of 32 in “remote-{hg,bzr}: updates”
  1. 0/8 remote-{hg,bzr}: updatesFelipe Contreras, Aug 28, 2013
  2. 1/8 remote-bzr: fix export of utf-8 authorsFelipe Contreras, Aug 28, 2013
  3. Matthieu MoyAug 28, 2013
  4. Felipe ContrerasAug 28, 2013
  5. Antoine PelisseAug 28, 2013
  6. Felipe ContrerasAug 28, 2013
  7. Felipe ContrerasAug 28, 2013
  8. Matthieu MoyAug 28, 2013
  9. Felipe ContrerasAug 28, 2013
  10. Junio C HamanoAug 28, 2013
  11. Felipe ContrerasAug 28, 2013
  12. Re* [PATCH 1/8] remote-bzr: fix export of utf-8 authorsJunio C Hamano, Aug 29, 2013
  13. Junio C HamanoAug 29, 2013
  14. Michael HaggertySep 1, 2013
  15. Antoine PelisseAug 29, 2013
  16. Junio C HamanoAug 29, 2013
  17. Junio C HamanoAug 29, 2013
  18. Michael HaggertySep 1, 2013
  19. Eric SunshineAug 28, 2013
  20. remote-bzr: fix export of utf-8 authorsFelipe Contreras, Aug 28, 2013
  21. 2/8 remote-bzr: make bzr branches configurable per-repoFelipe Contreras, Aug 28, 2013
  22. 3/8 remote-hg: fix testFelipe Contreras, Aug 28, 2013
  23. 4/8 remote-hg: add missing &&s in the testFelipe Contreras, Aug 28, 2013
  24. 5/8 remote-hg: improve basic testFelipe Contreras, Aug 28, 2013
  25. 6/8 remote-helpers: trivial style fixesFelipe Contreras, Aug 28, 2013
  26. 7/8 remote-helpers: cleanup more global variablesFelipe Contreras, Aug 28, 2013
  27. 8/8 remote-hg: support for notesFelipe Contreras, Aug 28, 2013
  28. Junio C HamanoAug 29, 2013
  29. remote-hg: support for notesFelipe Contreras, Aug 29, 2013
  30. Junio C HamanoAug 29, 2013
  31. remote-hg: support for notesFelipe Contreras, Aug 29, 2013
  32. Junio C HamanoAug 29, 2013

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.