public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch RFA: Support non-ASCII file names in git-changelog
@ 2020-12-17  4:26 Ian Lance Taylor
  2020-12-18 10:28 ` Martin Liška
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Lance Taylor @ 2020-12-17  4:26 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

As discussed at
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561995.html ,
the ChangeLog checker does not correctly handle files with non-ASCII
file names.

This patch fixes the problem.  I have little experience with Python,
so I may have made some foolish mistakes here.

OK to commit?

Thanks.

Ian

* gcc-changelog/git_repository.py: Ignore quotation marks added by git
for non-ASCII file names.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 774 bytes --]

diff --git a/contrib/gcc-changelog/git_repository.py b/contrib/gcc-changelog/git_repository.py
index 8edcff91ad6..86b470b0881 100755
--- a/contrib/gcc-changelog/git_repository.py
+++ b/contrib/gcc-changelog/git_repository.py
@@ -55,7 +55,10 @@ def parse_git_revisions(repo_path, revisions, strict=True):
                     t = 'A'
                 else:
                     t = 'M'
-                modified_files.append((file.b_path, t))
+                path = file.b_path
+                if path.startswith('"') and path.endswith('"'):
+                    path = path[1:len(path)-1]
+                modified_files.append((path, t))
 
             date = datetime.utcfromtimestamp(c.committed_date)
             author = '%s  <%s>' % (c.author.name, c.author.email)

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

end of thread, other threads:[~2021-01-07 19:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  4:26 Patch RFA: Support non-ASCII file names in git-changelog Ian Lance Taylor
2020-12-18 10:28 ` Martin Liška
2020-12-18 18:30   ` Ian Lance Taylor
2020-12-21  9:39     ` Martin Liška
2020-12-21  9:48       ` Jakub Jelinek
2020-12-21  9:57         ` Martin Liška
2020-12-24 12:16           ` Joel Brobecker
2021-01-04 11:01             ` Martin Liška
2021-01-04 11:47               ` Martin Liška
2021-01-06  7:25                 ` Martin Liška
2021-01-06 13:37                   ` Martin Liška
2021-01-07 19:03                     ` Ian Lance Taylor

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