Re: [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths

2015-09-21 Thread Junio C Hamano
Luke Diamand  writes:

> On 21/09/15 09:49, larsxschnei...@gmail.com wrote:
>> From: Lars Schneider 
>>
>> I broke a test in "[PATCH v2] git-p4: improve path encoding verbose
>> output" on the next branch.
>> This patch on top of next (3dd15c0) fixes the issue.
>>
>> Thanks to Luke for finding the issue!
>
> Looks good to me, apart from using a UTF-8 char in the comment itself,
> which seems a bit unnecessary. Imagine what will happen to someone
> using git-p4 to mirror git-p4 itself into p4!

;-)  Thanks.

>
>
>>
>> Cheers,
>> Lars
>>
>> Lars Schneider (1):
>>git-p4: use replacement character for non UTF-8 characters in paths
>>
>>   git-p4.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --
>> 2.5.1
>>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths

2015-09-21 Thread Luke Diamand

On 21/09/15 09:49, larsxschnei...@gmail.com wrote:

From: Lars Schneider 

I broke a test in "[PATCH v2] git-p4: improve path encoding verbose output" on 
the next branch.
This patch on top of next (3dd15c0) fixes the issue.

Thanks to Luke for finding the issue!


Looks good to me, apart from using a UTF-8 char in the comment itself, 
which seems a bit unnecessary. Imagine what will happen to someone using 
git-p4 to mirror git-p4 itself into p4!





Cheers,
Lars

Lars Schneider (1):
   git-p4: use replacement character for non UTF-8 characters in paths

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

--
2.5.1



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths

2015-09-21 Thread larsxschneider
From: Lars Schneider 

If non UTF-8 characters are detected in paths then replace them with �
instead of throwing a UnicodeDecodeError exception. This restores the
original (implicit) implementation that was broken in 00a9403.

Signed-off-by: Lars Schneider 
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index e7510a9..215f556 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2226,7 +2226,7 @@ class P4Sync(Command, P4UserMap):
 encoding = 'utf8'
 if gitConfig('git-p4.pathEncoding'):
 encoding = gitConfig('git-p4.pathEncoding')
-relPath = relPath.decode(encoding).encode('utf8', 'replace')
+relPath = relPath.decode(encoding, 'replace').encode('utf8', 
'replace')
 if self.verbose:
 print 'Path with non-ASCII characters detected. Used %s to 
encode: %s ' % (encoding, relPath)
 
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths

2015-09-21 Thread larsxschneider
From: Lars Schneider 

I broke a test in "[PATCH v2] git-p4: improve path encoding verbose output" on 
the next branch.
This patch on top of next (3dd15c0) fixes the issue.

Thanks to Luke for finding the issue!

Cheers,
Lars

Lars Schneider (1):
  git-p4: use replacement character for non UTF-8 characters in paths

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

--
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html