GNU bug report logs - #79952
31.0.50; vc-dired regression with git worktree

Previous Next

Package: emacs;

Reported by: Eric Gillespie <epg <at> pretzelnet.org>

Date: Sat, 6 Dec 2025 00:28:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

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

To reply to this bug, email your comments to 79952 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79952; Package emacs. (Sat, 06 Dec 2025 00:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Gillespie <epg <at> pretzelnet.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 06 Dec 2025 00:28:02 GMT) Full text and rfc822 format available.

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

From: Eric Gillespie <epg <at> pretzelnet.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; vc-dired regression with git worktree
Date: Fri, 05 Dec 2025 18:27:15 -0600
Steps:
1. have a git worktree e.g. ~/worktree-bug
1a. cd /some/git/checkout ; git worktree add ~/worktree-bug
2. emacs -Q ~/worktree-bug
3. C-x v d RET

Expected:
vc-dired displays without git fetch, as it has done since the
dawn of vc-git .

Actual:
vc-dired runs git fetch!
You may not be able to tell if you do not get prompted;
try 'ssh-add -D' or local equivalent to force a prompt.

bisected to:

34331ae6f9c1e05160526b3ff661fb4863b7225d is the first bad commit
commit 34331ae6f9c1e05160526b3ff661fb4863b7225d
Author: Sean Whitton <spwhitton <at> spwhitton.name>
Date:   Wed Dec 3 05:19:12 2025

    Pass the VC backend down through fns called by vc--count-revisions
    
    * lisp/vc/vc-hooks.el (vc--repo-setprop, vc--repo-getprop)
    (vc--repo-clearprops):
    * lisp/vc/vc.el (vc-root-dir): New BACKEND parameter.
    (vc--incoming-revision, vc-push): Pass it.
    (vc-default-log-incoming, vc-default-log-outgoing): Pass down
    BACKEND provided by caller, instead of ignoring it and always
    calling vc-deduce-backend (bug#79929).

 lisp/vc/vc-hooks.el | 12 ++++++------
 lisp/vc/vc.el       | 54 ++++++++++++++++++++++++++++--------------------------
 2 files changed, 34 insertions(+), 32 deletions(-)


In GNU Emacs 31.0.50 (build 12, x86_64-pc-linux-gnu, cairo version
 1.18.4) of 2025-12-05 built on dogato
Repository revision: 022facd986191364a6487ab2a434238dea536ed3
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101021
System Description: openSUSE Tumbleweed

Configured using:
 'configure -C --prefix=/opt/emacs-master --disable-silent-rules
 --with-x-toolkit=no --without-gsettings --with-native-compilation=no
 CC=gcc-14'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LCMS2
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY OLDXMENU PDUMPER
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XDBE
XIM XINERAMA XINPUT2 XPM XRANDR ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  editorconfig-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  minibuffer-nonselected-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message yank-media puny rfc822
mml mml-sec epa epg rfc6068 epg-config gnus-util time-date mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
dired-aux dired dired-loaddefs vc-cvs vc-rcs log-view log-edit add-log
pcvs-util vc-dir vc rust-utils rust-mode derived rust-rustfmt
rust-playpen rust-compile rust-cargo rx eglot tree-widget wid-edit
external-completion jsonrpc xref flymake thingatpt project diff ert pp
ewoc debug backtrace help-mode find-func filenotify compile
text-property-search comint ansi-osc ansi-color ring imenu pcase vc-git
diff-mode track-changes easy-mmode files-x vc-dispatcher url-cache url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf mailcap url-util url-parse auth-source
cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt
gv bytecomp byte-compile url-vars editorconfig editorconfig-core
editorconfig-core-handle editorconfig-fnmatch warnings icons cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting font-render-setting cairo
xinput2 x multi-tty move-toolbar make-network-process tty-child-frames
emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79952; Package emacs. (Sat, 06 Dec 2025 16:09:02 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eric Gillespie <epg <at> pretzelnet.org>
Cc: 79952 <at> debbugs.gnu.org
Subject: Re: bug#79952: 31.0.50; vc-dired regression with git worktree
Date: Sat, 06 Dec 2025 16:08:18 +0000
Hello,

On Fri 05 Dec 2025 at 06:27pm -06, Eric Gillespie wrote:

> Steps:
> 1. have a git worktree e.g. ~/worktree-bug
> 1a. cd /some/git/checkout ; git worktree add ~/worktree-bug

(You might like to try 'C-x v w c'.)

> 2. emacs -Q ~/worktree-bug
> 3. C-x v d RET
>
> Expected:
> vc-dired displays without git fetch, as it has done since the
> dawn of vc-git .
>
> Actual:
> vc-dired runs git fetch!
> You may not be able to tell if you do not get prompted;
> try 'ssh-add -D' or local equivalent to force a prompt.

This was an intentional change in how VC-Dir works.  The result is
cached, so a fetch should happen only the first time you open VC-Dir for
that worktree in the current Emacs session.

At the same time, for the Git backend in particular,
vc-git-incoming-revision is meant to minimise how often it chooses to
fetch, and I think that this particular case is one in which it doesn't
need to.

For branches with upstreams, vc-git-incoming-revision avoids running
'git fetch' by looking at the remote-tracking branch that you already
have locally, instead.  But a new worktree has no upstream.  It should
figure out by itself that fetching will not, therefore, achieve
anything, and not try.

I've installed a change that I think will fix this kind of case.
Please test it.

For the sake of the other backends, I think we probably need a defcustom
escape hatch to disable fetching for repos where it's just too slow.
I'll work on that.  For Git, though, it shouldn't come up.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79952; Package emacs. (Mon, 08 Dec 2025 15:57:01 GMT) Full text and rfc822 format available.

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

From: Eric Gillespie <epg <at> pretzelnet.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 79952 <at> debbugs.gnu.org
Subject: Re: bug#79952: 31.0.50; vc-dired regression with git worktree
Date: Mon, 08 Dec 2025 09:55:55 -0600
Sean Whitton <spwhitton <at> spwhitton.name> writes:

> I've installed a change that I think will fix this kind of case.
> Please test it.

Confirmed as of commit 39f34f647024812adcef0258ea3c055559660165
the bogus git fetch is gone.

Thank you!

-- 
Eric Gillespie <*> epg <at> pretzelnet.org




Reply sent to Sean Whitton <spwhitton <at> spwhitton.name>:
You have taken responsibility. (Mon, 08 Dec 2025 16:01:02 GMT) Full text and rfc822 format available.

Notification sent to Eric Gillespie <epg <at> pretzelnet.org>:
bug acknowledged by developer. (Mon, 08 Dec 2025 16:01:02 GMT) Full text and rfc822 format available.

Message #16 received at 79952-done <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eric Gillespie <epg <at> pretzelnet.org>
Cc: 79952-done <at> debbugs.gnu.org
Subject: Re: bug#79952: 31.0.50; vc-dired regression with git worktree
Date: Mon, 08 Dec 2025 16:00:42 +0000
Version: 31.1

Hello,

On Mon 08 Dec 2025 at 09:55am -06, Eric Gillespie wrote:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>> I've installed a change that I think will fix this kind of case.
>> Please test it.
>
> Confirmed as of commit 39f34f647024812adcef0258ea3c055559660165
> the bogus git fetch is gone.
>
> Thank you!

No problem.  Closing the bug.

-- 
Sean Whitton




This bug report was last modified 2 days ago.

Previous Next


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