Subject: Re: bug#78819: 31.0.50; Inconsistent behavior of vc commands in various major modes

From: Sean Whitton <[email-masked]>
Date: Sat, 28 Jun 2025 10:48:05 +0100

Hello,

On Tue 17 Jun 2025 at 03:19pm -07, Kristoffer Balintona wrote:

> The difference in vc-dir buffers is that `vc-deduce-backend’ considers
> the backend associated with the current vc-dir buffer, whereas
> `vc-responsible-backend’ takes in a file and infers the backend
> associated with it. Most of the time these two should be the same, but
> not always: sometimes users may call `vc-dir’ with a universal argument
> to choose which backend a new vc-dir buffer should use. In this case,
> the backend returned by `vc-deduce-backend’ will differ from that of
> `vc-responsible-backend’.
>
> At least the following commands behave correctly, using
> `vc-deduce-backend’: `vc-print-root-log’, `vc-print-log’,
> `vc-log-outgoing’, `vc-log-incoming’, `vc-log-mergebase’, and
> `vc-diff-mergebase’ work. Other commands behave incorrectly:
> `vc-switch-branch’ and `vc-retrieve-tag’. Perhaps there are more.

I believe your analysis is correct.  We should be consistently using
vc-deduce-backend, which defers to vc-responsible-backend where
appropriate.

-- 
Sean Whitton