git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths
@ 2015-09-21  8:49 larsxschneider
  2015-09-21  8:49 ` larsxschneider
  2015-09-21 19:34 ` Luke Diamand
  0 siblings, 2 replies; 4+ messages in thread
From: larsxschneider @ 2015-09-21  8:49 UTC (permalink / raw)
  To: git; +Cc: luke, Lars Schneider

From: Lars Schneider <larsxschneider@gmail.com>

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

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

* [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths
  2015-09-21  8:49 [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths larsxschneider
@ 2015-09-21  8:49 ` larsxschneider
  2015-09-21 19:34 ` Luke Diamand
  1 sibling, 0 replies; 4+ messages in thread
From: larsxschneider @ 2015-09-21  8:49 UTC (permalink / raw)
  To: git; +Cc: luke, Lars Schneider

From: Lars Schneider <larsxschneider@gmail.com>

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 <larsxschneider@gmail.com>
---
 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

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

* Re: [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths
  2015-09-21  8:49 [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths larsxschneider
  2015-09-21  8:49 ` larsxschneider
@ 2015-09-21 19:34 ` Luke Diamand
  2015-09-21 20:23   ` Junio C Hamano
  1 sibling, 1 reply; 4+ messages in thread
From: Luke Diamand @ 2015-09-21 19:34 UTC (permalink / raw)
  To: larsxschneider, git

On 21/09/15 09:49, larsxschneider@gmail.com wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> 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
>

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

* Re: [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths
  2015-09-21 19:34 ` Luke Diamand
@ 2015-09-21 20:23   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2015-09-21 20:23 UTC (permalink / raw)
  To: Luke Diamand; +Cc: larsxschneider, git

Luke Diamand <luke@diamand.org> writes:

> On 21/09/15 09:49, larsxschneider@gmail.com wrote:
>> From: Lars Schneider <larsxschneider@gmail.com>
>>
>> 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
>>

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

end of thread, other threads:[~2015-09-21 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21  8:49 [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths larsxschneider
2015-09-21  8:49 ` larsxschneider
2015-09-21 19:34 ` Luke Diamand
2015-09-21 20:23   ` Junio C Hamano

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).