Subject: Re: bug#42145: vc-git file order mismatch between vc-dir and vc-diff

From: Sean Whitton <[email-masked]>
Date: Sat, 08 Mar 2025 11:08:05 +0800

Hello,

On Thu 02 Jul 2020 at 01:44am +03, Dmitry Gutov wrote:

> On 02.07.2020 00:44, Juri Linkov wrote:
>>> 'git diff' has a '-O' argument, which accepts <orderfile>. Maybe
>>> it'll help, but I kind of doubt that. Ideas welcome.
>
>> Maybe it's possible to write a diff-mode function to sort file hunks
>> in
>> vc-diff output buffer?  Maybe by just giving the right file-beginning
>> regexp to sort-subr?
>
> Which sort-subr?

Juri, could you specify the name of the sorting function?

> Overall, it sounds possible. But I would be careful about making the
> display of long diffs slower.

We could have it disable itself if the size of the diff-mode buffer to
sort was already very large.

I think this would be a nice UI improvement.  It would have the
advantage over Juri's advice of not being Git-specific, and also
depending on the implementation, revert-buffer wouldn't mess up the
order again.

-- 
Sean Whitton