GNU bug report logs - #77306
31.0.50; C-x v L from *vc-change-log* buffer leaves wrong default-directory

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Thu, 27 Mar 2025 11:15:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sean Whitton <spwhitton <at> spwhitton.name>
Subject: bug#77306: closed (Re: bug#77306: 31.0.50; C-x v L from
 *vc-change-log* buffer leaves wrong default-directory)
Date: Thu, 03 Apr 2025 08:36:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#77306: 31.0.50; C-x v L from *vc-change-log* buffer leaves wrong default-directory

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 77306 <at> debbugs.gnu.org.

-- 
77306: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77306
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Sean Whitton <spwhitton <at> spwhitton.name>
To: 77306-done <at> debbugs.gnu.org
Cc: dmitry <at> gutov.dev, monnier <at> iro.umontreal.ca
Subject: Re: bug#77306: 31.0.50; C-x v L from *vc-change-log* buffer leaves
 wrong default-directory
Date: Thu, 03 Apr 2025 16:35:25 +0800
Version: 31.1

Hello,

No-one has had any better ideas yet here so I've installed another
run-with-timer workaround, with an explanatory comment.
Hopefully we can improve on this, but the bug is worth fixing now
-- I run into it daily, somehow.

-- 
Sean Whitton

[Message part 3 (message/rfc822, inline)]
From: Sean Whitton <spwhitton <at> spwhitton.name>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; C-x v L from *vc-change-log* buffer leaves wrong
 default-directory
Date: Thu, 27 Mar 2025 19:13:40 +0800
X-debbugs-cc: dmitry <at> gutov.dev, monnier <at> iro.umontreal.ca

A similar problem to #53626 crops up with C-x v L, too.

1. emacs -q
2. Visit a version controlled file.
3. C-x v L
4. Without switching buffer, C-x p p ~/some/other/repo RET o C-x v L
5. RET to toggle display of the log message.

Result, in the case of git, is "fatal: bad revision" because
default-directory is still the first VC repository's root.

This problem is caused by the let binding of default-directory
established by vc-print-root-log.  vc-setup-buffer wants to set
default-directory in the *vc-change-log* buffer to the new repository's
root, but ends up just adjusting the let binding's value.

The same thing probably occurs with C-x v D.

Could we reformulate the command definitions so that they didn't need to
bind default-directory?  Should vc-setup-buffer use the same
run-with-timer trick implemented in xref--ensure-default-directory?

CCing Stefan since this is a dynamic binding issue.

-- 
Sean Whitton



This bug report was last modified 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.