{"thread":{"id":"38993","subject":"[PATCHv2 0/4] git-p4: fix filetype detection on files opened exclusively","startedAt":"2015-04-03T18:53:34Z","lastAt":"2015-04-03T21:55:46Z","messageCount":8,"participants":["Luke Diamand","Eric Sunshine","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"258932","messageId":"1428087218-8186-1-git-send-email-luke@diamand.org","threadId":"38993","inReplyTo":null,"subject":"[PATCHv2 0/4] git-p4: fix filetype detection on files opened exclusively","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-03T18:53:34Z","receivedAt":"2015-04-03T18:53:34Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"This is a followup series to Blair's patch to fix filetype detection on files\nopened exclusively. It updates the git-p4 unit tests to catchup with that\nfix, fixing a couple of small bugs in the original tests.\n\nHolloway, Blair (1):\n  git-p4: fix filetype detection on files opened exclusively\n\nLuke Diamand (3):\n  git-p4: fix small bug in locked test scripts\n  git-p4: small fix for locked-file-move-test\n  git-p4: update locked test case\n\n git-p4.py                |  2 +-\n t/t9816-git-p4-locked.sh | 10 +++++-----\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\n-- \n2.3.0.rc1.30.g76afe74\n"},{"id":"258933","messageId":"1428087218-8186-2-git-send-email-luke@diamand.org","threadId":"38993","inReplyTo":"1428087218-8186-1-git-send-email-luke@diamand.org","subject":"[PATCHv2 1/4] git-p4: fix small bug in locked test scripts","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-03T18:53:35Z","receivedAt":"2015-04-03T18:53:35Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Test script t9816-git-p4-locked.sh test #4 tests for\nadding a file that is locked by Perforce automatially.\nThis is currently not supported by git-p4 and so is\nexpected to fail.\n\nHowever, a small typo meant it always failed, even with\na fixed git-p4. Fix the typo to resolve this.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9816-git-p4-locked.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\nindex e71e543..ce0eb22 100755\n--- a/t/t9816-git-p4-locked.sh\n+++ b/t/t9816-git-p4-locked.sh\n@@ -41,7 +41,7 @@ test_expect_failure 'add with lock not taken' '\n \t(\n \t\tcd \"$git\" &&\n \t\techo line1 >>add-lock-not-taken &&\n-\t\tgit add file2 &&\n+\t\tgit add add-lock-not-taken &&\n \t\tgit commit -m \"add add-lock-not-taken\" &&\n \t\tgit config git-p4.skipSubmitEdit true &&\n \t\tgit p4 submit --verbose\n-- \n2.3.0.rc1.30.g76afe74\n"},{"id":"258934","messageId":"1428087218-8186-3-git-send-email-luke@diamand.org","threadId":"38993","inReplyTo":"1428087218-8186-1-git-send-email-luke@diamand.org","subject":"[PATCHv2 2/4] git-p4: small fix for locked-file-move-test","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-03T18:53:36Z","receivedAt":"2015-04-03T18:53:36Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"The test for handling of failure when trying to move a file\nthat is locked by another client was not quite correct - it\nfailed early on because the target file in the move already\nexisted.\n\nThe test now fails because git-p4 does not properly detect\nthat p4 has rejected the move, and instead just crashes. At\npresent, git-p4 has no support for detecting that a file\nhas been locked and reporting it to the user, so this is\nthe expected outcome.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9816-git-p4-locked.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\nindex ce0eb22..464f10b 100755\n--- a/t/t9816-git-p4-locked.sh\n+++ b/t/t9816-git-p4-locked.sh\n@@ -130,8 +130,8 @@ test_expect_failure 'move with lock taken' '\n \tgit p4 clone --dest=\"$git\" //depot &&\n \t(\n \t\tcd \"$git\" &&\n-\t\tgit mv file1 file2 &&\n-\t\tgit commit -m \"mv file1 to file2\" &&\n+\t\tgit mv file1 file3 &&\n+\t\tgit commit -m \"mv file1 to file3\" &&\n \t\tgit config git-p4.skipSubmitEdit true &&\n \t\tgit config git-p4.detectRenames true &&\n \t\tgit p4 submit --verbose\n-- \n2.3.0.rc1.30.g76afe74\n"},{"id":"258935","messageId":"1428087218-8186-4-git-send-email-luke@diamand.org","threadId":"38993","inReplyTo":"1428087218-8186-1-git-send-email-luke@diamand.org","subject":"[PATCHv2 3/4] git-p4: fix filetype detection on files opened exclusively","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-03T18:53:37Z","receivedAt":"2015-04-03T18:53:37Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"From: \"Holloway, Blair\" <Blair_Holloway@playstation.sony.com>\n\nIf a Perforce server is configured to automatically set +l (exclusive lock) on\nadd of certain file types, git p4 submit will fail during getP4OpenedType, as\nthe regex doesn't expect the trailing '*exclusive*' from p4 opened:\n\n//depot/file.png#1 - add default change (binary+l) *exclusive*\n\nSigned-off-by: Blair Holloway <blair_holloway@playstation.sony.com>\nAcked-by: Luke Diamand <luke@diamand.org>\n---\n git-p4.py | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex ff132b2..d43482a 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -368,7 +368,7 @@ def getP4OpenedType(file):\n     # Returns the perforce file type for the given file.\n \n     result = p4_read_pipe([\"opened\", wildcard_encode(file)])\n-    match = re.match(\".*\\((.+)\\)\\r?$\", result)\n+    match = re.match(\".*\\((.+)\\)( \\*exclusive\\*)?\\r?$\", result)\n     if match:\n         return match.group(1)\n     else:\n-- \n2.3.0.rc1.30.g76afe74\n"},{"id":"258936","messageId":"1428087218-8186-5-git-send-email-luke@diamand.org","threadId":"38993","inReplyTo":"1428087218-8186-1-git-send-email-luke@diamand.org","subject":"[PATCHv2 4/4] git-p4: update locked test case","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-03T18:53:38Z","receivedAt":"2015-04-03T18:53:38Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"The add-new-file and copy-existing-file tests from\nt9816-git-p4-locked.sh now pass. Update the test\ncase accordingly.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9816-git-p4-locked.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\nindex 464f10b..d048bd3 100755\n--- a/t/t9816-git-p4-locked.sh\n+++ b/t/t9816-git-p4-locked.sh\n@@ -35,7 +35,7 @@ test_expect_success 'edit with lock not taken' '\n \t)\n '\n \n-test_expect_failure 'add with lock not taken' '\n+test_expect_success 'add with lock not taken' '\n \ttest_when_finished cleanup_git &&\n \tgit p4 clone --dest=\"$git\" //depot &&\n \t(\n@@ -107,7 +107,7 @@ test_expect_failure 'chmod with lock taken' '\n \t)\n '\n \n-test_expect_failure 'copy with lock taken' '\n+test_expect_success 'copy with lock taken' '\n \tlock_in_another_client &&\n \ttest_when_finished cleanup_git &&\n \ttest_when_finished \"cd \\\"$cli\\\" && p4 revert file2 && rm -f file2\" &&\n-- \n2.3.0.rc1.30.g76afe74\n"},{"id":"258937","messageId":"CAPig+cSd6vZagHnWktUmv+nQe99yi28nkGLhF8Ks08A=p1UzYw@mail.gmail.com","threadId":"38993","inReplyTo":"1428087218-8186-2-git-send-email-luke@diamand.org","subject":"Re: [PATCHv2 1/4] git-p4: fix small bug in locked test scripts","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-04-03T19:02:16Z","receivedAt":"2015-04-03T19:02:16Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Apr 3, 2015 at 2:53 PM, Luke Diamand <luke@diamand.org> wrote:\n> Test script t9816-git-p4-locked.sh test #4 tests for\n> adding a file that is locked by Perforce automatially.\n\ns/automatially/automatically/\n\n> This is currently not supported by git-p4 and so is\n> expected to fail.\n>\n> However, a small typo meant it always failed, even with\n> a fixed git-p4. Fix the typo to resolve this.\n>\n> Signed-off-by: Luke Diamand <luke@diamand.org>\n> ---\n>  t/t9816-git-p4-locked.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\n> index e71e543..ce0eb22 100755\n> --- a/t/t9816-git-p4-locked.sh\n> +++ b/t/t9816-git-p4-locked.sh\n> @@ -41,7 +41,7 @@ test_expect_failure 'add with lock not taken' '\n>         (\n>                 cd \"$git\" &&\n>                 echo line1 >>add-lock-not-taken &&\n> -               git add file2 &&\n> +               git add add-lock-not-taken &&\n>                 git commit -m \"add add-lock-not-taken\" &&\n>                 git config git-p4.skipSubmitEdit true &&\n>                 git p4 submit --verbose\n> --\n> 2.3.0.rc1.30.g76afe74\n"},{"id":"258939","messageId":"CAPig+cSsPZZ=kEQ9jwj-BKkO+gKFwZYVi-FrTvvTZpmatmokAQ@mail.gmail.com","threadId":"38993","inReplyTo":"1428087218-8186-5-git-send-email-luke@diamand.org","subject":"Re: [PATCHv2 4/4] git-p4: update locked test case","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-04-03T20:00:23Z","receivedAt":"2015-04-03T20:00:23Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Apr 3, 2015 at 2:53 PM, Luke Diamand <luke@diamand.org> wrote:\n> The add-new-file and copy-existing-file tests from\n> t9816-git-p4-locked.sh now pass. Update the test\n> case accordingly.\n\nThis patch should be folded into patch 3/4, shouldn't it?\n\n> Signed-off-by: Luke Diamand <luke@diamand.org>\n> ---\n>  t/t9816-git-p4-locked.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\n> index 464f10b..d048bd3 100755\n> --- a/t/t9816-git-p4-locked.sh\n> +++ b/t/t9816-git-p4-locked.sh\n> @@ -35,7 +35,7 @@ test_expect_success 'edit with lock not taken' '\n>         )\n>  '\n>\n> -test_expect_failure 'add with lock not taken' '\n> +test_expect_success 'add with lock not taken' '\n>         test_when_finished cleanup_git &&\n>         git p4 clone --dest=\"$git\" //depot &&\n>         (\n> @@ -107,7 +107,7 @@ test_expect_failure 'chmod with lock taken' '\n>         )\n>  '\n>\n> -test_expect_failure 'copy with lock taken' '\n> +test_expect_success 'copy with lock taken' '\n>         lock_in_another_client &&\n>         test_when_finished cleanup_git &&\n>         test_when_finished \"cd \\\"$cli\\\" && p4 revert file2 && rm -f file2\" &&\n> --\n> 2.3.0.rc1.30.g76afe74\n"},{"id":"258952","messageId":"xmqqk2xsg9lp.fsf@gitster.dls.corp.google.com","threadId":"38993","inReplyTo":"CAPig+cSsPZZ=kEQ9jwj-BKkO+gKFwZYVi-FrTvvTZpmatmokAQ@mail.gmail.com","subject":"Re: [PATCHv2 4/4] git-p4: update locked test case","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-03T21:55:46Z","receivedAt":"2015-04-03T21:55:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Fri, Apr 3, 2015 at 2:53 PM, Luke Diamand <luke@diamand.org> wrote:\n>> The add-new-file and copy-existing-file tests from\n>> t9816-git-p4-locked.sh now pass. Update the test\n>> case accordingly.\n>\n> This patch should be folded into patch 3/4, shouldn't it?\n\nIf the fix and tests were done by the same person, we strongly\nprefer to see the code fix and test expectation update in the same\ncommit.\n\nWhat Luke is doing here is to spread the credits/blame to two\npeople.  If I were playing Luke's role, I might have squashed them\ninto a single commit, kept the authorship of the whole thing under\nBlair Holloway's name, and extend the log message by mentioning that\nI flipped the test expectations, but I'd say either is fine for this\nchange.\n\n>> Signed-off-by: Luke Diamand <luke@diamand.org>\n>> ---\n>>  t/t9816-git-p4-locked.sh | 4 ++--\n>>  1 file changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\n>> index 464f10b..d048bd3 100755\n>> --- a/t/t9816-git-p4-locked.sh\n>> +++ b/t/t9816-git-p4-locked.sh\n>> @@ -35,7 +35,7 @@ test_expect_success 'edit with lock not taken' '\n>>         )\n>>  '\n>>\n>> -test_expect_failure 'add with lock not taken' '\n>> +test_expect_success 'add with lock not taken' '\n>>         test_when_finished cleanup_git &&\n>>         git p4 clone --dest=\"$git\" //depot &&\n>>         (\n>> @@ -107,7 +107,7 @@ test_expect_failure 'chmod with lock taken' '\n>>         )\n>>  '\n>>\n>> -test_expect_failure 'copy with lock taken' '\n>> +test_expect_success 'copy with lock taken' '\n>>         lock_in_another_client &&\n>>         test_when_finished cleanup_git &&\n>>         test_when_finished \"cd \\\"$cli\\\" && p4 revert file2 && rm -f file2\" &&\n>> --\n>> 2.3.0.rc1.30.g76afe74\n"}]}