Subject: Re: [PATCH] git-p4: preserve utf8 BOM when importing from p4 to git

From: Junio C Hamano <[email-masked]>
Date: Thu, 15 Dec 2022 08:11:02 +0900

Tao Klerks <[email-masked]> writes:

> Again, I'm not attempting to defend the breakage - just outlining why
> I don't see how "using the Perforce variable P4CHARSET" would solve
> anything.
>
>> This new behavior has made it impossible for
>> me to submit changes to files of type "utf8"!  Any attempt fails with
>> "patch does not apply" and the erroneously added BOM is the cause.
>
> I will try to understand the "unicode enabled server" behavior today
> or tomorrow and see what options might make sense.
>
>> I propose rolling back the patch that introduced this behavior,
>
> Junio is the expert here and has noted it's a little late for that. I
> obviously defer to his expertise as to git's release and backout
> strategy.
>
> I would like to have a go at understanding what the options are (how
> we can get correct and functional behavior for all users), before
> proposing a specific course of action.

It sounds like, if your conjecture turns out to be correct in that
those P4 users who interact unicode enabled servers would have
P4CHARSET and others don't, we may not need an extra configuration
but pay attention to the P4CHARSET variable (or lack of it) and
switch the behaviour.

Thanks for a well reasoned response.