{"thread":{"id":"31749","subject":"[PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","startedAt":"2012-10-08T08:08:01Z","lastAt":"2012-10-09T07:15:25Z","messageCount":7,"participants":["Ben Walton","Junio C Hamano","Joachim Schmitz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"200742","messageId":"1349683681-18978-1-git-send-email-bdwalton@gmail.com","threadId":"31749","inReplyTo":null,"subject":"[PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Ben Walton","fromEmail":"bdwalton@gmail.com","sentAt":"2012-10-08T08:08:01Z","receivedAt":"2012-10-08T08:08:01Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Avoid a GNU-ism in the cp options used by t5400-send-pack.  Change -a\nto -pR.\n\nSigned-off-by: Ben Walton <bdwalton@gmail.com>\n---\n t/t5400-send-pack.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex 250c720..65b3b0f 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -159,7 +159,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n \t    git commit -a -m \"Second commit\" &&\n \t    git repack\n \t) &&\n-\tcp -a parent child &&\n+\tcp -pR parent child &&\n \t(\n \t    # Set the child to auto-pack if more than one pack exists\n \t    cd child &&\n-- \n1.7.12\n"},{"id":"200755","messageId":"7vlifgncq8.fsf@alter.siamese.dyndns.org","threadId":"31749","inReplyTo":"1349683681-18978-1-git-send-email-bdwalton@gmail.com","subject":"Re: [PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-08T16:35:27Z","receivedAt":"2012-10-08T16:35:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bdwalton@gmail.com> writes:\n\n> Avoid a GNU-ism in the cp options used by t5400-send-pack.  Change -a\n> to -pR.\n>\n> Signed-off-by: Ben Walton <bdwalton@gmail.com>\n> ---\n\nThanks, but is \"-p\" essential for this test to pass, or can we get\naway with just \"-R\"?\n\n>  t/t5400-send-pack.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\n> index 250c720..65b3b0f 100755\n> --- a/t/t5400-send-pack.sh\n> +++ b/t/t5400-send-pack.sh\n> @@ -159,7 +159,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n>  \t    git commit -a -m \"Second commit\" &&\n>  \t    git repack\n>  \t) &&\n> -\tcp -a parent child &&\n> +\tcp -pR parent child &&\n>  \t(\n>  \t    # Set the child to auto-pack if more than one pack exists\n>  \t    cd child &&\n"},{"id":"200758","messageId":"7vd30snbtk.fsf@alter.siamese.dyndns.org","threadId":"31749","inReplyTo":"7vlifgncq8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-08T16:55:03Z","receivedAt":"2012-10-08T16:55:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Ben Walton <bdwalton@gmail.com> writes:\n>\n>> Avoid a GNU-ism in the cp options used by t5400-send-pack.  Change -a\n>> to -pR.\n>>\n>> Signed-off-by: Ben Walton <bdwalton@gmail.com>\n>> ---\n>\n> Thanks, but is \"-p\" essential for this test to pass, or can we get\n> away with just \"-R\"?\n\nBesides, when you spot a potential problem, please ask \"git grep\"\nto catch them all.\n\n    $ git grep \"cp -a\" t/\n    t/t5400-send-pack.sh:   cp -a parent child &&\n    t/t5550-http-fetch.sh:  cp -a .git\"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n    t/t5800-remote-helpers.sh:      cp -a server server2 &&\n\n>>  t/t5400-send-pack.sh | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\n>> index 250c720..65b3b0f 100755\n>> --- a/t/t5400-send-pack.sh\n>> +++ b/t/t5400-send-pack.sh\n>> @@ -159,7 +159,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n>>  \t    git commit -a -m \"Second commit\" &&\n>>  \t    git repack\n>>  \t) &&\n>> -\tcp -a parent child &&\n>> +\tcp -pR parent child &&\n>>  \t(\n>>  \t    # Set the child to auto-pack if more than one pack exists\n>>  \t    cd child &&\n"},{"id":"200765","messageId":"7vvcekluwi.fsf@alter.siamese.dyndns.org","threadId":"31749","inReplyTo":"7vd30snbtk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-08T17:45:49Z","receivedAt":"2012-10-08T17:45:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> Thanks, but is \"-p\" essential for this test to pass, or can we get\n>> away with just \"-R\"?\n>\n> Besides, when you spot a potential problem, please ask \"git grep\"\n> to catch them all.\n\nIn other words, how about doing this instead?\n\n-- >8 --\nSubject: tests: \"cp -a\" is a GNUism\n\nThese tests just wants a bit-for-bit identical copy; they do not\nneed -H (there is no symbolic link involved) nor -p (there is no\nfunny permission or ownership issues involved).  Just use \"cp -R\"\ninstead.\n---\n t/t5400-send-pack.sh      | 2 +-\n t/t5550-http-fetch.sh     | 2 +-\n t/t5800-remote-helpers.sh | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex 250c720..418f515 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -159,7 +159,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '\n \t    git commit -a -m \"Second commit\" &&\n \t    git repack\n \t) &&\n-\tcp -a parent child &&\n+\tcp -R parent child &&\n \t(\n \t    # Set the child to auto-pack if more than one pack exists\n \t    cd child &&\ndiff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh\nindex 16ef041..80d20c8 100755\n--- a/t/t5550-http-fetch.sh\n+++ b/t/t5550-http-fetch.sh\n@@ -22,7 +22,7 @@ test_expect_success 'setup repository' '\n '\n \n test_expect_success 'create http-accessible bare repository with loose objects' '\n-\tcp -a .git \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n+\tcp -R .git \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n \t(cd \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n \t git config core.bare true &&\n \t mkdir -p hooks &&\ndiff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh\nindex 5702334..e7dc668 100755\n--- a/t/t5800-remote-helpers.sh\n+++ b/t/t5800-remote-helpers.sh\n@@ -76,7 +76,7 @@ test_expect_success 'pushing to local repo' '\n # git-remote-testgit, but is too slow to leave in for general use.\n : test_expect_success 'racily pushing to local repo' '\n \ttest_when_finished \"rm -rf server2 localclone2\" &&\n-\tcp -a server server2 &&\n+\tcp -R server server2 &&\n \tgit clone \"testgit::${PWD}/server2\" localclone2 &&\n \t(cd localclone2 &&\n \techo content >>file &&\n-- \n1.8.0.rc0.95.g9b3a052\n"},{"id":"200782","messageId":"CAP30j147c47y=cWVQNCtOdjp4mqV0kjhrSr7ZEfwDCyfQWthcw@mail.gmail.com","threadId":"31749","inReplyTo":"7vvcekluwi.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Ben Walton","fromEmail":"bdwalton@gmail.com","sentAt":"2012-10-08T20:05:05Z","receivedAt":"2012-10-08T20:05:05Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"On Mon, Oct 8, 2012 at 6:45 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>>> Thanks, but is \"-p\" essential for this test to pass, or can we get\n>>> away with just \"-R\"?\n>>\n>> Besides, when you spot a potential problem, please ask \"git grep\"\n>> to catch them all.\n>\n> In other words, how about doing this instead?\n\nThis works.  I was responding to a failing test so I didn't look for\nother instances.  Clearly I should have...I must not be exercising\nthose other tests.\n\nAcked-By: Ben Walton <bdwalton@gmail.com>\n\nThanks\n-Ben\n-- \n---------------------------------------------------------------------------------------------------------------------------\nTake the risk of thinking for yourself.  Much more happiness,\ntruth, beauty and wisdom will come to you that way.\n\n-Christopher Hitchens\n---------------------------------------------------------------------------------------------------------------------------\n"},{"id":"200789","messageId":"7v391ok6fv.fsf@alter.siamese.dyndns.org","threadId":"31749","inReplyTo":"CAP30j147c47y=cWVQNCtOdjp4mqV0kjhrSr7ZEfwDCyfQWthcw@mail.gmail.com","subject":"Re: [PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-08T21:19:32Z","receivedAt":"2012-10-08T21:19:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bdwalton@gmail.com> writes:\n\n> On Mon, Oct 8, 2012 at 6:45 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Junio C Hamano <gitster@pobox.com> writes:\n>>\n>>>> Thanks, but is \"-p\" essential for this test to pass, or can we get\n>>>> away with just \"-R\"?\n>>>\n>>> Besides, when you spot a potential problem, please ask \"git grep\"\n>>> to catch them all.\n>>\n>> In other words, how about doing this instead?\n>\n> This works.  I was responding to a failing test so I didn't look for\n> other instances.  Clearly I should have...I must not be exercising\n> those other tests.\n>\n> Acked-By: Ben Walton <bdwalton@gmail.com>\n\nI actually was planning to pass the blame to you so I'll re-queue it\nunder your \"Author:\" name, with S-o-b.\n\nThanks.\n"},{"id":"200821","messageId":"k50iuv$j0b$1@ger.gmane.org","threadId":"31749","inReplyTo":"7vd30snbtk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t/t5400-send-pack: Use POSIX options to cp for portability","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-10-09T07:15:25Z","receivedAt":"2012-10-09T07:15:25Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Ben Walton <bdwalton@gmail.com> writes:\n>>\n>>> Avoid a GNU-ism in the cp options used by t5400-send-pack.  Change\n>>> -a\n>>> to -pR.\n>>>\n>>> Signed-off-by: Ben Walton <bdwalton@gmail.com>\n>>> ---\n>>\n>> Thanks, but is \"-p\" essential for this test to pass, or can we get\n>> away with just \"-R\"?\n>\n> Besides, when you spot a potential problem, please ask \"git grep\"\n> to catch them all.\n>\n>    $ git grep \"cp -a\" t/\n>    t/t5400-send-pack.sh:   cp -a parent child &&\n>    t/t5550-http-fetch.sh:  cp -a\n>    .git\"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n> t/t5800-remote-helpers.sh:      cp -a server server2 &&\n\n\nThere's 2 more places in Documentation/git-tutorial.txt. There it looks like \nwe'd want to use 'cp -pR' instead\n\nBye, Jojo \n"}]}