GNU bug report logs -
#65049
29.1; vc-do-command fails in windows emacs 29.1
Previous Next
Reported by: Maxim Kim <habamax <at> gmail.com>
Date: Fri, 4 Aug 2023 07:51:01 UTC
Severity: normal
Found in version 29.1
Done: Dmitry Gutov <dmitry <at> gutov.dev>
Bug is archived. No further changes may be made.
Full log
Message #113 received at 65049 <at> debbugs.gnu.org (full text, mbox):
On 27/08/2023 08:36, Eli Zaretskii wrote:
>> Date: Sun, 27 Aug 2023 04:14:11 +0300
>> Cc: juri <at> linkov.net, habamax <at> gmail.com, 65049 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dmitry <at> gutov.dev>
>>
>> On 26/08/2023 11:50, Eli Zaretskii wrote:
>>
>> I'm guessing that if we try hard enough with files encoded in an "alien"
>> coding system, we will see a similar difference between vc-diff and
>> vc-root-diff.
>
> We could. The 'undecided-unix' value is a good default, but if the
> fileset includes files with different incompatible encodings, there's
> no single coding-system that could satisfy that, and what Emacs
> guesses will probably be okay for the first file, but not necessarily
> for the rest.
And it only guesses when passed a file or list of them (e.g. from a
selection in vc-dir).
>>> . The line you suggest to remove should IMO stay, because your
>>> suggestion is based on what you see with plain-ASCII files. If
>>> the files have some non-trivial text encoding, failing to use the
>>> right encoding for the diffs will produce mojibake. The EOL
>>> conversion produced by vc-coding-system-for-diff is indeed
>>> problematic, see above; but the text-conversion part is not, and
>>> should stay.
>>>
>>> Therefore, I propose the patch below, which incorporates the above
>>> change, for the emacs-29 branch. I think it is safe to use the 'unix
>>> EOL conversion on all systems, in the vc-git.el part of the changeset,
>>> but if you feel uneasy about that on the release branch, we could make
>>> it Windows-specific on emacs-29 and remove the condition on master.
>>
>> LGTM for emacs-29, thank you. In case anybody reports a problem, we can
>> add that OS limitation later.
>
> Thanks, installed on the emacs-29 branch.
Thanks for the fix.
>> Regarding your paragraph above about mojibake, though. That makes a lot
>> of sense, but I feel I have to stress: this mechanism doesn't work for
>> vc-root-diff (C-x v D).
>
> Not sure I understand. Can you show a recipe for "doesn't work"?
It's the same recipe as what you proposed I test (a file with dos line
ending on unix). But you don't even have to test that.
Try edebug-instrumenting vc-diff-internal and then calling vc-root-diff
anywhere (C-x v D). When the execution reaches the line that we have
been discussing, you'll see that (vc-coding-system-for-diff (car files))
evaluates to 'undecided because (car files) is a directory.
So this mechanism is always unused in vc-root-diff.
This bug report was last modified 232 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.