{"thread":{"id":"49926","subject":"[PATCH] t6036: avoid \"cp -a\"","startedAt":"2018-12-01T02:52:18Z","lastAt":"2018-12-01T17:36:51Z","messageCount":4,"participants":["Carlo Marcelo Arenas Belón","Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"364409","messageId":"20181201025212.54244-1-carenas@gmail.com","threadId":"49926","inReplyTo":null,"subject":"[PATCH] t6036: avoid \"cp -a\"","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2018-12-01T02:52:12Z","receivedAt":"2018-12-01T02:52:18Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"b8cd1bb713 (\"t6036, t6043: increase code coverage for file collision handling\", 2018-11-07) uses this GNU extension that is not available in a POSIX complaint\ncp; use cp -R instead\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\nto be applied on top of en/merge-path-collision for next\n\n t/t6036-recursive-corner-cases.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh\nindex b7488b00c0..fdb120d0dc 100755\n--- a/t/t6036-recursive-corner-cases.sh\n+++ b/t/t6036-recursive-corner-cases.sh\n@@ -1631,7 +1631,7 @@ test_expect_success 'check nested conflicts' '\n \n \t\t# Compare m to expected contents\n \t\t>empty &&\n-\t\tcp -a m_stage_2 expected_final_m &&\n+\t\tcp -R m_stage_2 expected_final_m &&\n \t\ttest_must_fail git merge-file --diff3 \\\n \t\t\t-L \"HEAD\"                     \\\n \t\t\t-L \"merged common ancestors\"  \\\n-- \n2.20.0.rc1.6.ga1598010f\n\n"},{"id":"364412","messageId":"CABPp-BG0=bGW54eMHCiVMbU3dwccZM06qy2gzqm1CE-TUFZ2zg@mail.gmail.com","threadId":"49926","inReplyTo":"20181201025212.54244-1-carenas@gmail.com","subject":"Re: [PATCH] t6036: avoid \"cp -a\"","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-12-01T04:21:56Z","receivedAt":"2018-12-01T04:22:10Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nThanks for the patch!\n\nOn Fri, Nov 30, 2018 at 6:52 PM Carlo Marcelo Arenas Belón\n<carenas@gmail.com> wrote:\n>\n> b8cd1bb713 (\"t6036, t6043: increase code coverage for file collision handling\", 2018-11-07) uses this GNU extension that is not available in a POSIX complaint\n\nThis is an extraordinarily long line; can you rewrap at around 72 characters?\n\n> cp; use cp -R instead\n>\n> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n> ---\n> to be applied on top of en/merge-path-collision for next\n>\n>  t/t6036-recursive-corner-cases.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh\n> index b7488b00c0..fdb120d0dc 100755\n> --- a/t/t6036-recursive-corner-cases.sh\n> +++ b/t/t6036-recursive-corner-cases.sh\n> @@ -1631,7 +1631,7 @@ test_expect_success 'check nested conflicts' '\n>\n>                 # Compare m to expected contents\n>                 >empty &&\n> -               cp -a m_stage_2 expected_final_m &&\n> +               cp -R m_stage_2 expected_final_m &&\n>                 test_must_fail git merge-file --diff3 \\\n>                         -L \"HEAD\"                     \\\n>                         -L \"merged common ancestors\"  \\\n> --\n> 2.20.0.rc1.6.ga1598010f\n\nOops.  Thanks for catching.  To be honest, we don't even need -a, -R,\netc. -- it was just a habit for me to add -a after cp.  A simple cp\nwould do, though what you have here is fine too.\n"},{"id":"364415","messageId":"xmqqk1ktjvyr.fsf@gitster-ct.c.googlers.com","threadId":"49926","inReplyTo":"CABPp-BG0=bGW54eMHCiVMbU3dwccZM06qy2gzqm1CE-TUFZ2zg@mail.gmail.com","subject":"Re: [PATCH] t6036: avoid \"cp -a\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-01T12:02:52Z","receivedAt":"2018-12-01T12:24:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> Thanks for the patch!\n>\n> On Fri, Nov 30, 2018 at 6:52 PM Carlo Marcelo Arenas Belón\n> ...\n> Oops.  Thanks for catching.  To be honest, we don't even need -a, -R,\n> etc. -- it was just a habit for me to add -a after cp.  A simple cp\n> would do, though what you have here is fine too.\n\nThanks, both.  I think the topic won't escape 'next' until 2.20\nfinal, and after that we can rewind 'next', so it may be better\nto squash it in, but anyway...\n\n-- >8 --\nFrom: Carlo Marcelo Arenas Belón <carenas@gmail.com>\nDate: Fri, 30 Nov 2018 18:52:12 -0800\nSubject: [PATCH] t6036: avoid non-portable \"cp -a\"\n\nb8cd1bb713 (\"t6036, t6043: increase code coverage for file collision\nhandling\", 2018-11-07) uses this GNU extension that is not available\nin a POSIX complaint cp.  In this particular case, there is no need to\nuse the option, as it is just copying a single file to create another\nfile.\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t6036-recursive-corner-cases.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh\nindex b7488b00c0..d23b948f27 100755\n--- a/t/t6036-recursive-corner-cases.sh\n+++ b/t/t6036-recursive-corner-cases.sh\n@@ -1631,7 +1631,7 @@ test_expect_success 'check nested conflicts' '\n \n \t\t# Compare m to expected contents\n \t\t>empty &&\n-\t\tcp -a m_stage_2 expected_final_m &&\n+\t\tcp m_stage_2 expected_final_m &&\n \t\ttest_must_fail git merge-file --diff3 \\\n \t\t\t-L \"HEAD\"                     \\\n \t\t\t-L \"merged common ancestors\"  \\\n-- \n2.20.0-rc1-10-g7068cbc4ab\n\n"},{"id":"364418","messageId":"20181201173645.63430-1-carenas@gmail.com","threadId":"49926","inReplyTo":"xmqqk1ktjvyr.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] t6036: avoid \"cp -a\"","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2018-12-01T17:36:45Z","receivedAt":"2018-12-01T17:36:51Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"Thanks both. Agree with Junio it would be better if squashed; apologize\nfor not catching it earlier, but the following might help to make it\nvisible for anyone that care to run the linter:\n\n  $ make test-lint-shell-syntax\n\nCarlo\n-- >8 --\nFrom: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>\nSubject: [PATCH] tests: add lint for non portable cp -a\n\ncp -a, while a common flag isn't in POSIX and will therefore fail\non systems that don't have GNUish tools (like OpenBSD, AIX or Solaris)\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n t/check-non-portable-shell.pl | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl\nindex b45bdac688..8037eef777 100755\n--- a/t/check-non-portable-shell.pl\n+++ b/t/check-non-portable-shell.pl\n@@ -35,6 +35,7 @@ sub err {\n \t\tchomp;\n \t}\n \n+\t/\\bcp\\s+-a/ and err 'cp -a is not portable';\n \t/\\bsed\\s+-i/ and err 'sed -i is not portable';\n \t/\\becho\\s+-[neE]/ and err 'echo with option is not portable (use printf)';\n \t/^\\s*declare\\s+/ and err 'arrays/declare not portable';\n-- \n2.20.0.rc2\n\n"}]}