GNU bug report logs - #79126
vc-switch-working-tree does not work if there is no matching file

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dmitry <at> gutov.dev>

Date: Wed, 30 Jul 2025 02:38:01 UTC

Severity: normal

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

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: 79126 <at> debbugs.gnu.org
Cc: spwhitton <at> spwhitton.name, sbaugh <at> janestreet.com
Subject: bug#79126: vc-switch-working-tree does not work if there is no matching file
Date: Wed, 30 Jul 2025 05:36:54 +0300
X-Debbugs-CC: spwhitton <at> spwhitton.name, sbaugh <at> janestreet.com

Hi!

If the current buffer does not visit a file (such as Dired, mentioned in 
a FIXME comment), or if the current file has no corresponding on the 
other worktree, we end up with an error.

Like

  file-relative-name: Wrong type argument: stringp, nil

or

  File ‘lisp/progmodes/abc.el’ not found in ‘~/vc/emacs-28/’

I guess some of these could be improved in project-find-matching-file 
(support for more major modes?) but semantically it seems like 
vc-switch-working-tree should try harder. Falling back to visiting the 
worktree root in Dired, if it doesn't find a better choice.




This bug report was last modified 6 days ago.

Previous Next


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