unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 65049@debbugs.gnu.org, habamax@gmail.com, juri@linkov.net
Subject: bug#65049: Minor update to the repro steps
Date: Fri, 25 Aug 2023 09:18:42 +0300	[thread overview]
Message-ID: <83ttsnoda5.fsf@gnu.org> (raw)
In-Reply-To: <2f6986e7-f96b-98bd-4581-7503bb01b111@gutov.dev> (message from Dmitry Gutov on Fri, 25 Aug 2023 00:44:58 +0300)

> Date: Fri, 25 Aug 2023 00:44:58 +0300
> From: Dmitry Gutov <dmitry@gutov.dev>
> Cc: juri@linkov.net, habamax@gmail.com, 65049@debbugs.gnu.org
> 
> On 25/08/2023 00:35, Dmitry Gutov wrote:
> > On 25/08/2023 00:06, Dmitry Gutov wrote:
> >>
> >>> But before I do, could you
> >>> please try the recipe here:
> >>>
> >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65049#68
> >>>
> >>> but with the following change in step 4:
> >>>
> >>>    4. C-x RET f utf-8-dos RET
> >>>
> >>> That is, try the recipe on a Posix host with a file whose EOL format
> >>> is CRLF.  If that works without any changes in the current VC code, I
> >>> will be happy to make the first hunk Windows-specific.
> >>
> >> That works with the current emacs-29. Also tried with the patch 
> >> applied -- still works.
> > 
> > But here's a modification of the scenario that fails (again: both with 
> > and without the patch): replace step 9 with
> > 
> >    9. C-x v =
> > 
> > The non-root diff looks a little different to begin with: it doesn't 
> > show those ^M chars at the end of lines (whereas the result of 
> > vc-root-diff shows them). That is likely the reason: buffer set up in a 
> > different way.
> 
> Looks like it's this line:
> 
> 	 (coding-system-for-read
> 	  (if files (vc-coding-system-for-diff (car files)) 'undecided))
> 
> near the beginning of vc-diff-internal that creates the difference. 
> Commenting it out makes the scenario work with both 'C-x v =' and 'C-x v D'.

That code fragment is very old, so just removing it is scary, even if
only in master.

What if you change that fragment to say

	 (coding-system-for-read
	  (if files (vc-coding-system-for-diff (car files)) 'undecided-unix))

instead?  If that doesn't work, please tell to what value does
vc-diff-internal set coding-system-for-read in your case there, and I
will try to figure out what would needs to be done there.

(In general, I believe that using Git on Posix hosts with files that
have DOS EOLs could have such problems in other use cases, where diffs
are generated and then applied as patches.  We just don't know about
those cases because they are extremely rare in Real Life.)





  reply	other threads:[~2023-08-25  6:18 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  7:50 bug#65049: 29.1; vc-do-command fails in windows emacs 29.1 Maxim Kim
2023-08-04  8:02 ` bug#65049: Minor update to the repro steps Maxim Kim
2023-08-04 11:05   ` Eli Zaretskii
2023-08-04 11:24     ` Maxim Kim
2023-08-04 17:56     ` Juri Linkov
2023-08-06 23:04       ` Maxim Kim
2023-08-07  1:09     ` Maxim Kim
2023-08-07 16:24       ` Eli Zaretskii
2023-08-07 23:17         ` Maxim Kim
2023-08-20 16:49         ` Juri Linkov
2023-08-20 18:25           ` Eli Zaretskii
2023-08-21  6:53             ` Juri Linkov
2023-08-21 11:00               ` Eli Zaretskii
2023-08-21 11:39                 ` Maxim Kim
2023-08-21 12:18                   ` Eli Zaretskii
2023-08-21 23:10             ` Maxim Kim
2023-08-22 12:52               ` Eli Zaretskii
2023-08-22 13:12                 ` Maxim Kim
2023-08-22 13:17                   ` Eli Zaretskii
2023-08-22 23:43                     ` Maxim Kim
2023-08-23  4:28                     ` Maxim Kim
2023-08-23 16:21                       ` Eli Zaretskii
2023-08-23 17:42                         ` Juri Linkov
2023-08-23 18:43                           ` Eli Zaretskii
2023-08-23 20:13                         ` Dmitry Gutov
2023-08-24  4:54                           ` Eli Zaretskii
2023-08-24 21:06                             ` Dmitry Gutov
2023-08-24 21:35                               ` Dmitry Gutov
2023-08-24 21:44                                 ` Dmitry Gutov
2023-08-25  6:18                                   ` Eli Zaretskii [this message]
2023-08-26  0:45                                     ` Dmitry Gutov
2023-08-26  8:50                                       ` Eli Zaretskii
2023-08-27  1:14                                         ` Dmitry Gutov
2023-08-27  5:36                                           ` Eli Zaretskii
2023-08-27 22:32                                             ` Dmitry Gutov
2023-08-28 12:12                                               ` Eli Zaretskii
2023-08-28 13:45                                                 ` Dmitry Gutov
2023-08-28 16:12                                                   ` Eli Zaretskii
2023-08-28 16:51                                                     ` Dmitry Gutov
2023-08-28 16:57                                                       ` Eli Zaretskii
2023-08-28 17:39                                                         ` Dmitry Gutov
2023-08-28 18:26                                                           ` Eli Zaretskii
2023-08-31  2:07                                                             ` Richard Stallman
2023-08-31  2:14                                                               ` Dmitry Gutov
2023-08-31  6:00                                                                 ` Eli Zaretskii
2023-08-23 23:46                         ` Maxim Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ttsnoda5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=65049@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=habamax@gmail.com \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).