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

Re: [PATCH] t6036: avoid "cp -a"

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Dec 1, 2018, 17:36 UTC
Message-ID
<20181201173645.63430-1-carenas@gmail.com>
In-Reply-To
<xmqqk1ktjvyr.fsf@gitster-ct.c.googlers.com>

Thanks both. Agree with Junio it would be better if squashed; apologize for not catching it earlier, but the following might help to make it visible for anyone that care to run the linter:

  $ make test-lint-shell-syntax
Carlo
-- >8 --
From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>
Subject: [PATCH] tests: add lint for non portable cp -a

cp -a, while a common flag isn't in POSIX and will therefore fail on systems that don't have GNUish tools (like OpenBSD, AIX or Solaris)

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 t/check-non-portable-shell.pl | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
index b45bdac688..8037eef777 100755
--- a/t/check-non-portable-shell.pl
+++ b/t/check-non-portable-shell.pl
@@ -35,6 +35,7 @@ sub err {
 		chomp;
 	}
 
+	/\bcp\s+-a/ and err 'cp -a is not portable';
 	/\bsed\s+-i/ and err 'sed -i is not portable';
 	/\becho\s+-[neE]/ and err 'echo with option is not portable (use printf)';
 	/^\s*declare\s+/ and err 'arrays/declare not portable';
-- 
2.20.0.rc2
Previous: Junio C Hamano
Message 4 of 4 in “t6036: avoid "cp -a"”
  1. t6036: avoid "cp -a"Carlo Marcelo Arenas Belón, Dec 1, 2018
  2. Elijah NewrenDec 1, 2018
  3. Junio C HamanoDec 1, 2018
  4. Carlo Marcelo Arenas BelónDec 1, 2018

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.