public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
	Ian Lance Taylor <iant@golang.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	Jonathan Wakely <jwakely.gcc@gmail.com>
Subject: Re: Patch RFA: Support non-ASCII file names in git-changelog
Date: Mon, 4 Jan 2021 12:01:58 +0100	[thread overview]
Message-ID: <8beaddc2-402d-b90c-6d53-2903f92275a2@suse.cz> (raw)
In-Reply-To: <20201224121638.GL353421@adacore.com>

On 12/24/20 1:16 PM, Joel Brobecker wrote:
>>> I have no idea who that is (if it is a single user at all,
>>> if it isn't any user with git write permissions).
>>
>> CCing Joel, he should help us how to set a git config
>> that will be used by the server hooks.
> 
> I am not sure that requiring both the server and the user to agree
> on a non-default configuration value would be a practical idea.

I agree with that but I was unable to find a way how to "decode"
the filenames:

> 
>  From what I understand of the problem, I think the proper fix
> is really to adapt the git-changelog script to avoid the need
> for any assumption about the user's configuration. In particular,
> how does the script get the list of files?

On server we use:
git diff HEAD~ --name-status

which works really fine with -z option:
Mcontrib/gcc-changelog/git_repository.pyAšpatně.txt

without it, the patch is quoted as well:

git diff HEAD~ --name-status | cat
M	contrib/gcc-changelog/git_repository.py
A	"\305\241patn\304\233.txt"

> Poking around, it looks like
> you guys are using the GitPython module, which I'm not familiar with,
> unfortunately.  But as a reference point, the git-hooks simply use
> the -z option to get the information in raw format, and thus avoids
> the problem of filename quoting entirely. Does GitPython support
> something similar? For instance, browing the GitPython documentation,
> I found attributes a_raw_path and b_raw_path. Could that be the
> solution (instead of using a_path and b_path?

Thanks for looking into it. Unfortunately, for a file called "špatně.txt"
I get for a_rawpath and b_rawpath:
b'"\\305\\241patn\\304\\233.txt"' b'"\\305\\241patn\\304\\233.txt"'

> 
> Either way, the solution will be independent of the git-hooks,
> as I don't think they are actually involved, here.
> 

Anyway, I'm going to update server hook first and I'll create an issue for GitPython.

Thanks for help,
Martin

  reply	other threads:[~2021-01-04 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  4:26 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 [this message]
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

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=8beaddc2-402d-b90c-6d53-2903f92275a2@suse.cz \
    --to=mliska@suse.cz \
    --cc=brobecker@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@golang.org \
    --cc=jakub@redhat.com \
    --cc=jwakely.gcc@gmail.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 read-only IMAP folder(s) and NNTP newsgroup(s).