{"thread":{"id":"38965","subject":"[PATCH] git-p4: fix filetype detection on files opened exclusively","startedAt":"2015-03-31T21:54:08Z","lastAt":"2015-04-02T21:17:07Z","messageCount":3,"participants":["Holloway, Blair","Luke Diamand","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"258786","messageId":"2D2A7688059E344DB86768405D63DEB42D3D75FC@USCULXMSG09.am.sony.com","threadId":"38965","inReplyTo":null,"subject":"[PATCH] git-p4: fix filetype detection on files opened exclusively","fromName":"Holloway, Blair","fromEmail":"blair_holloway@playstation.sony.com","sentAt":"2015-03-31T21:54:08Z","receivedAt":"2015-03-31T21:54:08Z","isPatch":true,"sender":{"key":"blair_holloway@playstation.sony.com","avatar":null},"body":"If 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>\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-- \n1.8.3.msysgit.0\n"},{"id":"258881","messageId":"CAE5ih7_QpkX-U+XJ8gKSKKt1+Vu+FM4XBADTkys-4MDa129jyw@mail.gmail.com","threadId":"38965","inReplyTo":"2D2A7688059E344DB86768405D63DEB42D3D75FC@USCULXMSG09.am.sony.com","subject":"Re: [PATCH] git-p4: fix filetype detection on files opened exclusively","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-02T19:54:32Z","receivedAt":"2015-04-02T19:54:32Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"(+Pete for interest).\n\nOn 31 March 2015 at 22:54, Holloway, Blair\n<Blair_Holloway@playstation.sony.com> wrote:\n> If a Perforce server is configured to automatically set +l (exclusive lock) on\n> add of certain file types, git p4 submit will fail during getP4OpenedType, as\n> the regex doesn't expect the trailing '*exclusive*' from p4 opened:\n\nThanks - that actually fixes a part of the long-standing problem of\nhandling locked files which Pete identified about a year ago.\n\nThere's a test case for handling of locked files,\nt9816-git-p4-locked.sh, which needs updating now as a bit more of it\npasses. Junio, I'll submit a followup patch to update those tests once\nI get back from vacation.\n\n(Fixing t9816 is very slightly non-trivial because test #4 is subtly\nbroken and so incorrectly passes).\n\nAck,\nLuke\n"},{"id":"258896","messageId":"xmqqiodei624.fsf@gitster.dls.corp.google.com","threadId":"38965","inReplyTo":"CAE5ih7_QpkX-U+XJ8gKSKKt1+Vu+FM4XBADTkys-4MDa129jyw@mail.gmail.com","subject":"Re: [PATCH] git-p4: fix filetype detection on files opened exclusively","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-02T21:17:07Z","receivedAt":"2015-04-02T21:17:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n> (+Pete for interest).\n>\n> On 31 March 2015 at 22:54, Holloway, Blair\n> <Blair_Holloway@playstation.sony.com> wrote:\n>> If a Perforce server is configured to automatically set +l (exclusive lock) on\n>> add of certain file types, git p4 submit will fail during getP4OpenedType, as\n>> the regex doesn't expect the trailing '*exclusive*' from p4 opened:\n>\n> Thanks - that actually fixes a part of the long-standing problem of\n> handling locked files which Pete identified about a year ago.\n>\n> There's a test case for handling of locked files,\n> t9816-git-p4-locked.sh, which needs updating now as a bit more of it\n> passes. Junio, I'll submit a followup patch to update those tests once\n> I get back from vacation.\n\nThanks.  Lest I forget, I'd prefer this patch resent from you in a\ntwo (or more) patch series, with this one marked as 1/N with your\n\"Acked-by:\", and your follow-up patches 2/N...N/N.  If it is not a\ntoo much work for you, that is.\n\nThanks.\n"}]}