Subject: Re: bug#65049: Minor update to the repro steps

From: Eli Zaretskii <[email-masked]>
Date: Mon, 28 Aug 2023 19:57:38 +0300

> Date: Mon, 28 Aug 2023 19:51:25 +0300
> Cc: [email-masked], [email-masked], [email-masked]
> From: Dmitry Gutov <[email-masked]>
> 
> On 28/08/2023 19:12, Eli Zaretskii wrote:
> >> Date: Mon, 28 Aug 2023 16:45:23 +0300
> >> Cc:[email-masked],[email-masked],[email-masked]
> >> From: Dmitry Gutov<[email-masked]>
> >>
> >> On 28/08/2023 15:12, Eli Zaretskii wrote:
> >>>> 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.
> >>> OK, but in that case 'undecided' is the best guess we can come up
> >>> with.  It basically lets Emacs guess when it actually sees the stuff
> >>> in the diffs, while reading it into a buffer.
> >> Yes, and if it's good enough for the (possibly?) most-frequently used
> >> out of the vc-*-diff commands, then perhaps we don't need the additional
> >> detection logic?
> >>
> >> Since its introduction 30 years ago indeed the situation has changed a
> >> lot, with UTF-8 and its ubiquity. Removing the extra complication would
> >> make code a little easier to read, and reduce variability when
> >> reproducing problems. But there's no hurry, of course.
> > I'm not sure I understand which part do you want to remove.
> 
> The part that currently looks like this:
> 
> 	 (coding-system-for-read
>            ;; Force the EOL conversion to be -unix, in case the files
>            ;; to be compared have DOS EOLs.  In that case, EOL
>            ;; conversion will produce a patch file that will either
>            ;; fail to apply, or will change the EOL format of some of
>            ;; the lines in the patched file.
>            (coding-system-change-eol-conversion
> 	   (if files (vc-coding-system-for-diff (car files)) 'undecided)
>             'unix))
> 
> As we've established, the only part that's used in vc-root-diff (and 
> only now) is binding coding-system-change-eol-conversion to 
> 'undecided-unix'. We could leave it there, though it doesn't seem to 
> change the behavior in my tests.

Remove that?  What will happen to non-vc-root-diff clients of that?

Or do you mean remove the vc-coding-system-for-diff call, and use
undecided-unix instead?

If the latter, then it is sub-optimal when vc-coding-system-for-diff
does produce non-undecided value for some reason.