{"thread":{"id":"38931","subject":"[PATCH V2 1/2] git-p4: Make rename test case runnable under dash","startedAt":"2015-03-28T00:03:01Z","lastAt":"2015-03-28T16:07:32Z","messageCount":4,"participants":["Vitor Antunes","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"258625","messageId":"1427500983-8802-1-git-send-email-vitor.hda@gmail.com","threadId":"38931","inReplyTo":null,"subject":"[PATCH V2 0/2] git-p4: Small updates to test cases","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2015-03-28T00:03:01Z","receivedAt":"2015-03-28T00:03:01Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Updated both fixes:\n\n1. Remove \"true\" from case statements and replaced it with \":\".\n2. Also use a case statement in the copy detection test to allow\n   diff-tree to detect two different files as the origin of the\n   copy. I've also reverted a change I introduced in the V1 patch\n   that no longer makes much sense to me.\n\nVitor Antunes (2):\n  git-p4: Make rename test case runnable under dash\n  git-p4: Fix copy detection test\n\n t/t9814-git-p4-rename.sh |    9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)\n\n-- \n1.7.10.4\n"},{"id":"258624","messageId":"1427500983-8802-2-git-send-email-vitor.hda@gmail.com","threadId":"38931","inReplyTo":"1427500983-8802-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCH V2 1/2] git-p4: Make rename test case runnable under dash","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2015-03-28T00:03:02Z","receivedAt":"2015-03-28T00:03:02Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n t/t9814-git-p4-rename.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh\nindex 95f4421..efae143 100755\n--- a/t/t9814-git-p4-rename.sh\n+++ b/t/t9814-git-p4-rename.sh\n@@ -180,7 +180,7 @@ test_expect_success 'detect copies' '\n \t\tcase \"$src\" in\n \t\tfile10 | file11) : ;; # happy\n \t\t*) false ;; # not\n-\t\t&&\n+\t\tesac &&\n \t\tgit config git-p4.detectCopies $(($level + 2)) &&\n \t\tgit p4 submit &&\n \t\tp4 filelog //depot/file12 &&\n@@ -197,7 +197,7 @@ test_expect_success 'detect copies' '\n \t\tcase \"$src\" in\n \t\tfile10 | file11 | file12) : ;; # happy\n \t\t*) false ;; # not\n-\t\t&&\n+\t\tesac &&\n \t\tgit config git-p4.detectCopies $(($level - 2)) &&\n \t\tgit p4 submit &&\n \t\tp4 filelog //depot/file13 &&\n-- \n1.7.10.4\n"},{"id":"258626","messageId":"1427500983-8802-3-git-send-email-vitor.hda@gmail.com","threadId":"38931","inReplyTo":"1427500983-8802-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCH V2 2/2] git-p4: Fix copy detection test","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2015-03-28T00:03:03Z","receivedAt":"2015-03-28T00:03:03Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"File file11 is copied from file2 and diff-tree correctly reports this file as\nits the source. But it is possible that the diff-tree algorithm detects file10,\nwhich was also copied from file2, as the origin of the new file.\n\nThis fix uses a case statement to support both files as the source of file11, as\nwas done in other tests in this file.\n\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n t/t9814-git-p4-rename.sh |    5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh\nindex efae143..8b9c295 100755\n--- a/t/t9814-git-p4-rename.sh\n+++ b/t/t9814-git-p4-rename.sh\n@@ -163,7 +163,10 @@ test_expect_success 'detect copies' '\n \t\tgit commit -a -m \"Copy file2 to file11\" &&\n \t\tgit diff-tree -r -C --find-copies-harder HEAD &&\n \t\tsrc=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f2) &&\n-\t\ttest \"$src\" = file10 &&\n+\t\tcase \"$src\" in\n+\t\tfile2 | file10) : ;; # happy\n+\t\t*) false ;; # not\n+\t\tesac &&\n \t\tgit config git-p4.detectCopiesHarder true &&\n \t\tgit p4 submit &&\n \t\tp4 filelog //depot/file11 &&\n-- \n1.7.10.4\n"},{"id":"258636","messageId":"xmqqa8yxyukb.fsf@gitster.dls.corp.google.com","threadId":"38931","inReplyTo":"1427500983-8802-1-git-send-email-vitor.hda@gmail.com","subject":"Re: [PATCH V2 0/2] git-p4: Small updates to test cases","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-03-28T16:07:32Z","receivedAt":"2015-03-28T16:07:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Will apply both.\n\nIt seems that I am to blame for 1/2 for botching the shell syntax\nX-<.  Thanks for fixing.\n\nI was not entirely happy with the \"we could find either file10 or\nfile11 because they are the same, so let's declare both are success\"\nin the original, f69b3a93 (git p4 test: copy source indeterminate,\n2012-06-27) in the first place, which survived the 9b6513ac (git p4\ntest: split up big t9800 test, 2012-06-27) and e832f737 (t9814: fix\nmisconversion from test $a -o $b to test $a || test $b, 2014-07-25).\nI think a better fix would have been not to have multiple identical\ncopies in the tested tree to begin with.\n\nBut 2/2 is an acceptable interim fix that uses the same approach as\nwe have been using since f69b3a93, so it should do at least for now.\n\nThanks.\n"}]}