Re: [PATCH 3/3] completion: fix bugs with slashes in remote names
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 7, 2025, 21:45 UTC
- Message-ID
- <xmqq4j04cy6t.fsf@gitster.g>
- In-Reply-To
- <1192682c-b68d-429d-9852-15ab627d711f@mandelberg.org>
David Mandelberg <david@mandelberg.org> writes:
Show 7 quoted lines
>> 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.