Subject: bug#79126: vc-switch-working-tree does not work if there is no matching file

From: Dmitry Gutov <[email-masked]>
Date: Tue, 5 Aug 2025 15:30:21 +0300

On 05/08/2025 13:45, Sean Whitton wrote:
>>> The last resort fallback could possibly be to call project-switch-project?
>> Probably not - it would show the prompt a second time, right?
> No, I mean calling project-switch-project non-interactively and passing
> it the root directory.  Then the user would get some options of exactly
> what to do.

Adhering to project-switch-commands might be a fine idea, indeed. 
Although I'd probably prefer to just use Dired, myself.

>> And the last step in the algorithm from the previous paragraph would visit the
>> worktree root, I think, so there shouldn't be a scenario of a complete
>> failure.
> True, but maybe failing all the way up to the root should be a special
> case.

Semantically, just going by the command's name, it seems to me that 
switching to a different directory is the key part of its behavior, and 
finding a corresponding file - a secondary one.

Perhaps we'll want to add a command called 'vc-worktree-find-matching-file'?