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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 14 Aug 2025 18:30:37 +0300

> From: Sean Whitton <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 14 Aug 2025 15:03:37 +0100
> 
> Do you know of any reason we couldn't refactor things in vc-git.el like
> this?  It would reduce complexity a fair bit.

The problem here is that coding-system-for-write is used for two
purposes: (1) to encode the command-line arguments of a program we are
about to run, and (2) to encode any text we send to the program.  And
on Windows we must use two different encodings: command-line arguments
must be encoded with the system codepage, whereas Git prefers its
input and output to be encoded in UTF-8.

Binding coding-system-for-write to locale-coding-system in
vc-git-command basically overrides any encoding forced by the callers,
including by users (if the type "C-x RET c SOMETHING RET" when
invoking VC commands).

So unfortunately, I think this complexity is needed.