From: Junio C Hamano Date: Fri, 07 Mar 2025 21:45:14 GMT Subject: Re: [PATCH 3/3] completion: fix bugs with slashes in remote names Message-ID: In-Reply-To: <1192682c-b68d-429d-9852-15ab627d711f@mandelberg.org> David Mandelberg 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" 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.