git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tao Klerks <tao@klerks.biz>
Cc: Kilian Kilger via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Kilian Kilger <kkilger@gmail.com>,
	Kilian Kilger <kilian.kilger@sap.com>
Subject: Re: [PATCH] git-p4: fix bug with encoding of p4 client name
Date: Fri, 08 Jul 2022 08:05:09 -0700	[thread overview]
Message-ID: <xmqqmtdjwspm.fsf@gitster.g> (raw)
In-Reply-To: <CAPMMpohwP1U4pr-G=fDDu_AHTY-2mn8hn8zBf-pAsmm=w0mSzw@mail.gmail.com> (Tao Klerks's message of "Fri, 8 Jul 2022 13:28:51 +0200")

Tao Klerks <tao@klerks.biz> writes:

>
>
> On Fri, Jul 8, 2022 at 10:01 AM Kilian Kilger via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Kilian Kilger <kilian.kilger@sap.com>
>>
>> The Perforce client name can contain arbitrary characters
>> which do not decode to UTF-8. Use the fallback strategy
>> implemented in metadata_stream_to_writable_bytes() also
>> for the client name.
>>
>> Signed-off-by: Kilian Kilger <kkilger@gmail.com>
>> ---
>> ...
>>
>> @@ -871,6 +871,8 @@ def p4CmdList(cmd, stdin=None, stdin_mode='w+b', cb=None, skip_info=False,
>>                      continue
>>              if 'desc' in entry:
>>                  entry['desc'] = metadata_stream_to_writable_bytes(entry['desc'])
>> +            if 'client' in entry:
>> +                entry['client'] = metadata_stream_to_writable_bytes(entry['client'])
>>              if 'FullName' in entry:
>>                  entry['FullName'] = metadata_stream_to_writable_bytes(entry['FullName']

We had two repetitions and now we have three, which is a good time
to see if it makes sense to reduce the temptation for future
developers to add the fourth repetition in the next round, e.g.

	for e in ["client", "desc", "FullName"]:
		if e in entry:
			entry[e] = metadata_stream_to_writable_bytes(entry[e])

or something like that?

> This makes sense to me, and I don't see anything wrong with the "form"
> (and nor does GitGitGadget).

One thing that is a bit problematic is that in-body From does not
match the sign-off.  Kilian, which identity do you want to use in
your contribution to this project? 

> Not sure whether formal review sign-off is used on this list, I don't
> tend to see it, but do I see "Reviewed-by" on patches, so FWIW:
>
> Reviewed-by: Tao Klerks <tao@klerks.biz>

Thanks.


  reply	other threads:[~2022-07-08 15:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  8:01 [PATCH] git-p4: fix bug with encoding of p4 client name Kilian Kilger via GitGitGadget
2022-07-08 11:28 ` Tao Klerks
2022-07-08 15:05   ` Junio C Hamano [this message]
2022-07-18  8:57 ` [PATCH v2] " Kilian Kilger via GitGitGadget
2022-07-18 16:36   ` Junio C Hamano
2022-07-21  9:07   ` [PATCH v3 0/2] git-p4: Fix bug with encoding of P4 " Kilian Kilger via GitGitGadget
2022-07-21  9:07     ` [PATCH v3 1/2] git-p4: fix bug with encoding of p4 " Kilian Kilger via GitGitGadget
2022-07-21  9:07     ` [PATCH v3 2/2] git-p4: refactoring of p4CmdList() Kilian Kilger via GitGitGadget
2022-07-21 16:46     ` [PATCH v3 0/2] git-p4: Fix bug with encoding of P4 client name 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmtdjwspm.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=kilian.kilger@sap.com \
    --cc=kkilger@gmail.com \
    --cc=tao@klerks.biz \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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