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

[PATCH] git-p4: fix filetype detection on files opened exclusively

From
HBHolloway, Blair <blair_holloway@playstation.sony.com>
Date
Mar 31, 2015, 21:54 UTC
Message-ID
<2D2A7688059E344DB86768405D63DEB42D3D75FC@USCULXMSG09.am.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>
---
 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:
-- 
1.8.3.msysgit.0
Next: Luke Diamand
Message 1 of 3 in “git-p4: fix filetype detection on files opened exclusively”
  1. git-p4: fix filetype detection on files opened exclusivelyHolloway, Blair, Mar 31, 2015
  2. Luke DiamandApr 2, 2015
  3. Junio C HamanoApr 2, 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.