git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-p4: fix syncing file types with pattern
@ 2020-12-23 12:48 Daniel Levin via GitGitGadget
  2020-12-23 14:37 ` [PATCH v2] " Daniel Levin via GitGitGadget
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Levin via GitGitGadget @ 2020-12-23 12:48 UTC (permalink / raw)
  To: git; +Cc: Yang Zhao, Daniel Levin, Daniel Levin

From: Daniel Levin <dlevin@roku.com>

Example of pattern file type: text+k

Text filtered through the p4 pattern regexp must be converted from
string back to bytes, otherwise 'data' command for the fast-import
will receive extra invalid characters, followed by the fast-import
process error.

CC: Yang Zhao <yang.zhao@skyboxlabs.com>
Signed-off-by: Daniel Levin <dendy.ua@gmail.com>
---
    git-p4: fix syncing file types with pattern
    
    Example of pattern file type: text+k
    
    Text filtered through the p4 pattern regexp must be converted from
    string back to bytes, otherwise 'data' command for the fast-import will
    receive extra invalid characters, followed by the fast-import process
    error.
    
    Signed-off-by: Daniel Levin dendy.ua@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-823%2Fdendy%2Fp4-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-823/dendy/p4-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/823

 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index 4433ca53de7..90b02f6b22c 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -3031,7 +3031,7 @@ def streamOneP4File(self, file, contents):
             regexp = re.compile(pattern, re.VERBOSE)
             text = ''.join(decode_text_stream(c) for c in contents)
             text = regexp.sub(r'$\1$', text)
-            contents = [ text ]
+            contents = [ encode_text_stream(text) ]
 
         if self.largeFileSystem:
             (git_mode, contents) = self.largeFileSystem.processContent(git_mode, relPath, contents)

base-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] git-p4: fix syncing file types with pattern
  2020-12-23 12:48 [PATCH] git-p4: fix syncing file types with pattern Daniel Levin via GitGitGadget
@ 2020-12-23 14:37 ` Daniel Levin via GitGitGadget
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Levin via GitGitGadget @ 2020-12-23 14:37 UTC (permalink / raw)
  To: git; +Cc: Yang Zhao, Daniel Levin, Daniel Levin

From: Daniel Levin <dendy.ua@gmail.com>

Example of pattern file type: text+k

Text filtered through the p4 pattern regexp must be converted from
string back to bytes, otherwise 'data' command for the fast-import
will receive extra invalid characters, followed by the fast-import
process error.

CC: Yang Zhao <yang.zhao@skyboxlabs.com>
Signed-off-by: Daniel Levin <dendy.ua@gmail.com>
---
    git-p4: fix syncing file types with pattern
    
    Example of pattern file type: text+k
    
    Text filtered through the p4 pattern regexp must be converted from
    string back to bytes, otherwise 'data' command for the fast-import will
    receive extra invalid characters, followed by the fast-import process
    error.
    
    Signed-off-by: Daniel Levin dendy.ua@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-823%2Fdendy%2Fp4-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-823/dendy/p4-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/823

Range-diff vs v1:

 1:  109fdb6df91 ! 1:  78729f51f3b git-p4: fix syncing file types with pattern
     @@
       ## Metadata ##
     -Author: Daniel Levin <dlevin@roku.com>
     +Author: Daniel Levin <dendy.ua@gmail.com>
      
       ## Commit message ##
          git-p4: fix syncing file types with pattern


 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index 4433ca53de7..90b02f6b22c 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -3031,7 +3031,7 @@ def streamOneP4File(self, file, contents):
             regexp = re.compile(pattern, re.VERBOSE)
             text = ''.join(decode_text_stream(c) for c in contents)
             text = regexp.sub(r'$\1$', text)
-            contents = [ text ]
+            contents = [ encode_text_stream(text) ]
 
         if self.largeFileSystem:
             (git_mode, contents) = self.largeFileSystem.processContent(git_mode, relPath, contents)

base-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-23 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 12:48 [PATCH] git-p4: fix syncing file types with pattern Daniel Levin via GitGitGadget
2020-12-23 14:37 ` [PATCH v2] " Daniel Levin via GitGitGadget

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).