All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Feiyang via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Feiyang <github@feiyangxue.com>, Feiynag Xue <fxue@roku.com>
Subject: [PATCH] git-p4: remove deprecated function "encodeWithUTF8()"
Date: Wed, 03 Feb 2021 16:57:50 +0000	[thread overview]
Message-ID: <pull.862.git.1612371471347.gitgitgadget@gmail.com> (raw)

From: Feiynag Xue <fxue@roku.com>

commit d38208a297e76bbfbfa8e485632c217aaafa9486 introduced function "decode_path()" to replace "encodeWithUTF8()". This old function "encodeWithUTF8()" no longer has reference by any code in this file.

Signed-off-by: Feiynag Xue <fxue@roku.com>
---
    Remove deprecated function "encodeWithUTF8()"
    
    The function encodeWithUTF8() no longer has reference after
    d38208a297e76bbfbfa8e485632c217aaafa9486, which introduced decode_path()
    to replace encodeWithUTF8() for path encoding handling. I cannot think
    of a reason to keep encodeWithUTF8() in the codebase.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-862%2Ffeiyeung%2Fremove-encodeWithUTF8-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-862/feiyeung/remove-encodeWithUTF8-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/862

 git-p4.py | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/git-p4.py b/git-p4.py
index 09c9e93ac40..2c7e5498afa 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2939,18 +2939,6 @@ def writeToGitStream(self, gitMode, relPath, contents):
             self.gitStream.write(d)
         self.gitStream.write('\n')
 
-    def encodeWithUTF8(self, path):
-        try:
-            path.decode('ascii')
-        except:
-            encoding = 'utf8'
-            if gitConfig('git-p4.pathEncoding'):
-                encoding = gitConfig('git-p4.pathEncoding')
-            path = path.decode(encoding, 'replace').encode('utf8', 'replace')
-            if self.verbose:
-                print('Path with non-ASCII characters detected. Used %s to encode: %s ' % (encoding, path))
-        return path
-
     # output one file from the P4 stream
     # - helper for streamP4Files
 

base-commit: e6362826a0409539642a5738db61827e5978e2e4
-- 
gitgitgadget

             reply	other threads:[~2021-02-03 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 16:57 Feiyang via GitGitGadget [this message]
2021-02-03 20:06 ` [PATCH] git-p4: remove deprecated function "encodeWithUTF8()" Junio C Hamano

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.862.git.1612371471347.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=fxue@roku.com \
    --cc=git@vger.kernel.org \
    --cc=github@feiyangxue.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.