Subject: bug#79024: 31.0.50; Multiple working trees support for VC

From: Eli Zaretskii <[email-masked]>
Date: Wed, 13 Aug 2025 14:17:13 +0300

> From: Sean Whitton <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Tue, 12 Aug 2025 20:47:49 +0100
> 
> Reading #23076, it is not clear to me why you implemented both: encoding
> command line arguments using the system code page, and passing the
> commit message through a file.
> 
> Your message to the bug first proposing these fixes suggests choosing
> between them.  But we have both.  Can you explain?

It is impossible on Windows to use anything but the system codepage
for encoding command-line arguments of Emacs subprocesses.  At least
not without some serious changes in how Emacs on Windows supports
sub-processes.  So, since Git prefers UTF-8 as encoding of log
messages, we cannot use that encoding for command-line arguments,
because most Windows users don't set their system codepage to UTF-8
(UTF-8 is still in diapers on Windows and produces some subtle
problems and unexpected failures).  With the log message written to a
file, the problem with command-line arguments is smaller, since the
actual text is in the file, but the temporary file's name could still
include non-ASCII characters (e.g., if the user's name includes them).

So we need to encode both, and each one needs to use what will usually
be a different encoding, for the reasons explained above.

> Another question would be: do we need both for Mercurial, or is passing
> the commit message via a file sufficient?

I think we need the same for Mercurial, for the same reasons.