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: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: Eshel Yaron <me <at> eshelyaron.com>, 79126 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: bug#79126: vc-switch-working-tree does not work if there is no matching file
Date: Thu, 7 Aug 2025 04:35:12 +0300
On 06/08/2025 19:06, Spencer Baugh wrote:
> (This is maybe overengineering, but: we could even make it take*either*
> a root file name or a project object, so that callers can pass whatever
> is most convenient for them.

Not sure there will be other callers for it. Or not many anyway.

> Then the code inside could use some new
> helper function which when passed a file name, returns (project-current
> nil file-name), and when passed anything else, returns that thing.  That
> might be simple enough, and this function would be fairly useful I
> think)

If the value needs to be passed through a helper, we could just pass it 
through 'project-root'. The project values must be available in the 
caller already, so let's just standardize on those.

(We're probably coming from different schools of design: you're thinking 
in ADTs where it's normal to have something like "Thing | String" as a 
parameter type, and I'm thinking more in OOP where you pass a type, or a 
supertype - like a general protocol - but rarely a union of disjoint 
types, and if that happens, they are usually all primitive types).




This bug report was last modified 5 days ago.

Previous Next


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