git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Levin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Yang Zhao <yang.zhao@skyboxlabs.com>,
	Daniel Levin <dendy.ua@gmail.com>, Daniel Levin <dlevin@roku.com>
Subject: [PATCH] git-p4: fix syncing file types with pattern
Date: Wed, 23 Dec 2020 12:48:51 +0000	[thread overview]
Message-ID: <pull.823.git.1608727731733.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2020-12-23 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 12:48 Daniel Levin via GitGitGadget [this message]
2020-12-23 14:37 ` [PATCH v2] git-p4: fix syncing file types with pattern Daniel Levin via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.823.git.1608727731733.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=dendy.ua@gmail.com \
    --cc=dlevin@roku.com \
    --cc=git@vger.kernel.org \
    --cc=yang.zhao@skyboxlabs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).