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


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 45 days ago.

Previous Next


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