Tags: patch C-u M-x vc-root-diff will prompt for the old revision to use for the diff. The prompt will have a default calculated by vc-diff-build-argument-list-internal. The default is either the working revision of the current fileset or the revision before that. vc-diff-build-argument-list-internal contained a check (added in c0d66cb21bac57f5ec0378e8a04aac8f35c3eb5c) which explicitly avoided setting a default if the current fileset was a directory. This check was added in 1997 when vc only worked for single files. This prevents a backend from choosing to return a non-nil value from 'working-revision when passed a directory. (The vc-hg and vc-git backends, at least, will do this) Allow this by moving the file-directory-p check, so that we try calling 'working-revision when the fileset is a single directory. The call is in inside ignore-errors, so if a backend errors when passed a directory, we'll just get no default, as before. (Most backends will just return nil for a directory, rather than erroring) Also, while we're here, explicitly pass the backend to vc-working-revision rather than having vc-working-revision recompute it. Concretely this has the effect that for the vc-git and vc-hg backends, running C-u M-x vc-root-diff in vc-dir will have the same behavior as running C-u M-x vc-root-diff in a clean file: The "Previous revision:" prompt's default will be the revision before HEAD. * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move file-directory-p check. In GNU Emacs 29.2.50 (build 17, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2024-09-06 built on igm-qws-u22796a Repository revision: e6d04c06a7eb6ce932b52a346368d02b7a811a00 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.10 (Green Obsidian) Configured using: 'configure --with-x-toolkit=lucid --without-gpm --without-gconf --without-selinux --without-imagemagick --with-modules --with-gif=no --with-cairo --with-rsvg --without-compress-install --with-native-compilation=aot --with-tree-sitter PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/'