{"thread":{"id":"54873","subject":"[PATCH] git-p4: fix syncing file types with pattern","startedAt":"2020-12-23T12:49:52Z","lastAt":"2020-12-23T14:38:12Z","messageCount":2,"participants":["Daniel Levin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"412919","messageId":"pull.823.git.1608727731733.gitgitgadget@gmail.com","threadId":"54873","inReplyTo":null,"subject":"[PATCH] git-p4: fix syncing file types with pattern","fromName":"Daniel Levin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-12-23T12:48:51Z","receivedAt":"2020-12-23T12:49:52Z","isPatch":true,"sender":{"key":"name:Daniel Levin","avatar":null},"body":"From: Daniel Levin <dlevin@roku.com>\n\nExample of pattern file type: text+k\n\nText filtered through the p4 pattern regexp must be converted from\nstring back to bytes, otherwise 'data' command for the fast-import\nwill receive extra invalid characters, followed by the fast-import\nprocess error.\n\nCC: Yang Zhao <yang.zhao@skyboxlabs.com>\nSigned-off-by: Daniel Levin <dendy.ua@gmail.com>\n---\n    git-p4: fix syncing file types with pattern\n    \n    Example of pattern file type: text+k\n    \n    Text filtered through the p4 pattern regexp must be converted from\n    string back to bytes, otherwise 'data' command for the fast-import will\n    receive extra invalid characters, followed by the fast-import process\n    error.\n    \n    Signed-off-by: Daniel Levin dendy.ua@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-823%2Fdendy%2Fp4-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-823/dendy/p4-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/823\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 4433ca53de7..90b02f6b22c 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -3031,7 +3031,7 @@ def streamOneP4File(self, file, contents):\n             regexp = re.compile(pattern, re.VERBOSE)\n             text = ''.join(decode_text_stream(c) for c in contents)\n             text = regexp.sub(r'$\\1$', text)\n-            contents = [ text ]\n+            contents = [ encode_text_stream(text) ]\n \n         if self.largeFileSystem:\n             (git_mode, contents) = self.largeFileSystem.processContent(git_mode, relPath, contents)\n\nbase-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6\n-- \ngitgitgadget\n"},{"id":"412928","messageId":"pull.823.v2.git.1608734248194.gitgitgadget@gmail.com","threadId":"54873","inReplyTo":"pull.823.git.1608727731733.gitgitgadget@gmail.com","subject":"[PATCH v2] git-p4: fix syncing file types with pattern","fromName":"Daniel Levin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-12-23T14:37:27Z","receivedAt":"2020-12-23T14:38:12Z","isPatch":true,"sender":{"key":"name:Daniel Levin","avatar":null},"body":"From: Daniel Levin <dendy.ua@gmail.com>\n\nExample of pattern file type: text+k\n\nText filtered through the p4 pattern regexp must be converted from\nstring back to bytes, otherwise 'data' command for the fast-import\nwill receive extra invalid characters, followed by the fast-import\nprocess error.\n\nCC: Yang Zhao <yang.zhao@skyboxlabs.com>\nSigned-off-by: Daniel Levin <dendy.ua@gmail.com>\n---\n    git-p4: fix syncing file types with pattern\n    \n    Example of pattern file type: text+k\n    \n    Text filtered through the p4 pattern regexp must be converted from\n    string back to bytes, otherwise 'data' command for the fast-import will\n    receive extra invalid characters, followed by the fast-import process\n    error.\n    \n    Signed-off-by: Daniel Levin dendy.ua@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-823%2Fdendy%2Fp4-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-823/dendy/p4-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/823\n\nRange-diff vs v1:\n\n 1:  109fdb6df91 ! 1:  78729f51f3b git-p4: fix syncing file types with pattern\n     @@\n       ## Metadata ##\n     -Author: Daniel Levin <dlevin@roku.com>\n     +Author: Daniel Levin <dendy.ua@gmail.com>\n      \n       ## Commit message ##\n          git-p4: fix syncing file types with pattern\n\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 4433ca53de7..90b02f6b22c 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -3031,7 +3031,7 @@ def streamOneP4File(self, file, contents):\n             regexp = re.compile(pattern, re.VERBOSE)\n             text = ''.join(decode_text_stream(c) for c in contents)\n             text = regexp.sub(r'$\\1$', text)\n-            contents = [ text ]\n+            contents = [ encode_text_stream(text) ]\n \n         if self.largeFileSystem:\n             (git_mode, contents) = self.largeFileSystem.processContent(git_mode, relPath, contents)\n\nbase-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6\n-- \ngitgitgadget\n"}]}