GNU bug report logs -
#68377
Cannot commit parts of *vc-diff* on Microsoft Windows
Previous Next
Reported by: sds <at> gnu.org
Date: Thu, 11 Jan 2024 02:08:02 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Cc: 68377 <at> debbugs.gnu.org
> Date: Thu, 11 Jan 2024 14:28:49 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > # work-around 1
> >
> > Add
> > ```
> > (setq coding-system-for-write 'utf-8-unix)
> > ```
> > inside `(with-temp-file patch-file ...)` in `vc-git-checkin`
>
> The code in question already does:
>
> (let ((patch-file (make-nearby-temp-file "git-patch"))
> ;; Temporarily countermand the let-binding at the
> ;; beginning of this function.
> (coding-system-for-write
> (coding-system-change-eol-conversion
> ;; On DOS/Windows, it is important for the patch file
> ;; to have the Unix EOL format, because Git expects
> ;; that, even on Windows.
> (or pcsw vc-git-commits-coding-system) 'unix)))
> (with-temp-file patch-file
> (insert vc-git-patch-string))
>
> So coding-system-for-write should already be -unix when with-temp-file
> runs. I guess there's more here than meets the eye, or maybe I'm
> missing something.
And sure enough, trying the recipe from "emacs -Q" fails to reproduce
the problem. So there's something else at work here.
Could you please try this in "emacs -Q"? If it doesn't work in
"emacs -Q", please step in Edebug through vc-git-checkin and tell
what you see as the value of coding-system-for-write when this code
is executed:
(with-temp-file patch-file
(insert vc-git-patch-string))
and also what is the EOL format of patch-file that Emacs creates
there, and let's take it from there.
If this does work in "emacs -Q", then some of your customizations
related to coding-systems probably get in the way.
FTR, in my case autocrlf is also false (as it should be).
This bug report was last modified 1 year and 104 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.