Subject: Re: [PATCH 3/3] completion: fix bugs with slashes in remote names

From: Junio C Hamano <[email-masked]>
Date: Fri, 07 Mar 2025 13:45:14 -0800

David Mandelberg <[email-masked]> writes:

>> As a remote name, we still do use "is that a
>> file on the filesystem?" to see if it is a local file:// URL
>> (i.e. "git fetch github/dseomn" may be fetching from a subdirectory
>> two levels down)
>
> Btw, I just tested it, and I think this is an issue for remote names
> without slashes too:

Yes, and that is an intended way local repositories are discovered
and used.

The problem with slashes is that the mistake surface becomes a lot
larger.  "ls<RETURN>" would show you "origin" immediately in the
current working directory, but you wouldn't know if origin has
origin/foo or origin/bar unless you look.  Limiting the local
filesystem reference to something like "only the ones that has no
slashes, or begin with ../ or /" would make it less likely that you
meant to push to somewhere and instead push to a local directory.