Subject: Re: bug#78987: 30.1; Unable to create new Git repository in Dired mode

From: Stephen Berman <[email-masked]>
Date: Sat, 12 Jul 2025 11:07:28 +0200

On Fri, 11 Jul 2025 19:13:59 +0100 Sean Whitton <[email-masked]> wrote:

> Hello,
>
> On Fri 11 Jul 2025 at 11:33am +02, Stephen Berman via "Bug reports for GNU
> Emacs, the Swiss army knife of text editors" wrote:
>
>> When I test with -Q, a Git repository is created and either the file at
>> point or the marked files in Dired are added to it, although
>> `vc-deduce-fileset' calls `(dired-vc-deduce-fileset
>> state-model-only-files not-state-changing)', i.e., without passing
>> `allow-unregistered'; so why do you think it must be passed (and
>> non-nil)?
>
> It should be passed because the corresponding code path for vc-dir
> passes allow-unregistered down.  dired-vc-deduce-fileset is meant to be
> just a dired version of the vc-dir code path in vc-deduce-fileset.

I admit that I find the VC code hard to follow, but I don't see where
`vc-dir' uses ALLOW-UNREGISTERED.  The docstring of `vc-deduce-fileset'
says:

  If the current buffer is in `vc-dir' or Dired mode, FILESET is the
  list of marked files, or the file under point if no files are
  marked.
  [...]
  Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file
  is unregistered, FILESET is a single-file list containing the
  name of the visited file.

This seems to say that the code path using ALLOW-UNREGISTERED bypasses
the code path using Dired.  Anyway, I'm sure you understand the VC
better than I do, so you should make the change you think is required.

Steve Berman