Subject: Re: bug#39380: 26.3: Opening files in vc-dir-mode with differing root and working dir fails

From: Dmitry Gutov <[email-masked]>
Date: Sat, 8 Feb 2020 12:36:46 +0300

On 08.02.2020 11:04, Eli Zaretskii wrote:

>> And people want to open vc-dir buffers in any directory, not just in
>> repository roots.
> 
> If I say "hg status" in a subdirectory, I by default get file names
> relative to the root.  Wouldn't Mercurial users be surprised that
> Emacs produces a different display?  (I understand that there's a
> recent tendency to make it easier to produce relative file names, and
> there's even a config option to make that the default, but I'm asking
> whether we should force this behavior on users even if their
> preference is not to.)

VC is intended to provide a unified interface across backends, even if 
it's at times different from the "native" behaviors.

Anyway, it's very easy to get the names against the root anyway: just 
open VC-Dir there. And it's the default input: M-x vc-dir RET.

>> We could force the file names to be absolute, and then pipe them through
>> file-relative-name, but that's just extra work.
> 
> I'm more bothered by the user-facing changes in this respect than by
> algorithmic details.  Would it work to set the default-directory of
> the buffer to the repository's root instead? would that solve the
> original problem?

Again, it's a bugfix. VC-Dir expects this, other backends work like 
this, and vc-hg worked like this until Emacs 24 or 25.

And the present behavior makes VC-Dir have broken behavior.

There are only two possible reasons the buggy behavior wasn't noticed: 
a) Hg users are a minority among our users, b) most people open VC-Dir 
in repository root anyway. IOW, the difference wasn't triggered/seen.

>>> This change should be in NEWS, IMO.
>>
>> It's a bugfix for an older, unintended change. It's not a new behavior.
> 
> It changes how files are presented to the user, so I think it has
> user-visible effects that should be mentioned in NEWS.

I don't mind adding some NEWS entry, but, like said above, the users 
likely didn't see the change.

> What about this question:
> 
>> you are saying that "C-x v d" in a subdirectory of the root of a
>> Mercurial repository became broken in Emacs 25.1?

Yes. :-(