git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 3/4] git-p4: fix filetype detection on files opened exclusively

From
Luke Diamand <luke@diamand.org>
Date
Apr 3, 2015, 18:53 UTC
Message-ID
<1428087218-8186-4-git-send-email-luke@diamand.org>
In-Reply-To
<1428087218-8186-1-git-send-email-luke@diamand.org>
From: "Holloway, Blair" <Blair_Holloway@playstation.sony.com>

If a Perforce server is configured to automatically set +l (exclusive lock) on add of certain file types, git p4 submit will fail during getP4OpenedType, as the regex doesn't expect the trailing '*exclusive*' from p4 opened:

//depot/file.png#1 - add default change (binary+l) *exclusive*
Signed-off-by: Blair Holloway <blair_holloway@playstation.sony.com>
Acked-by: Luke Diamand <luke@diamand.org>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index ff132b2..d43482a 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -368,7 +368,7 @@ def getP4OpenedType(file):
     # Returns the perforce file type for the given file.
 
     result = p4_read_pipe(["opened", wildcard_encode(file)])
-    match = re.match(".*\((.+)\)\r?$", result)
+    match = re.match(".*\((.+)\)( \*exclusive\*)?\r?$", result)
     if match:
         return match.group(1)
     else:
-- 
2.3.0.rc1.30.g76afe74
Previous: Luke DiamandNext: Luke Diamand
Message 5 of 8 in “[PATCHv2 0/4] git-p4: fix filetype detection on files opened exclusively”
  1. Luke DiamandApr 3, 2015
  2. 1/4 git-p4: fix small bug in locked test scriptsLuke Diamand, Apr 3, 2015
  3. Eric SunshineApr 3, 2015
  4. 2/4 git-p4: small fix for locked-file-move-testLuke Diamand, Apr 3, 2015
  5. 3/4 git-p4: fix filetype detection on files opened exclusivelyLuke Diamand, Apr 3, 2015
  6. 4/4 git-p4: update locked test caseLuke Diamand, Apr 3, 2015
  7. Eric SunshineApr 3, 2015
  8. Junio C HamanoApr 3, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.