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

From: Junio C Hamano <[email-masked]>
Date: Thu, 06 Mar 2025 12:46:32 -0800

"David Mandelberg via GitGitGadget" <[email-masked]> writes:

> This made completions like:
>
> git push github/dseomn :com<Tab>
>
> Result in:
>
> git push github/dseomn :dseomn/completion-remote-slash

Apparently I am late to the party, but I have to wonder how
prevalent it is to use such a name for remotes.

Back in 2005 when I designed the remote namespaces and
remote-tracking branches, the code may have been loose not to
complain, but it certainly was not an intended way the remote names
and remote-tracking hiearchies were to be used.  Being able to say
"refs/remote/*/master" and learn where everybody's 'master' branch
points at with a single globbing was a powerful thing, but with
refs/remotes/github/dseomn/master thrown into the mix, that would
break down miserably.  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); in retrospect, we might have been better off if we
said "well with a slash it must be a local directory and not remote
nickname" to prevent such usage pattern.

Anyway, this is not something we'd do lightly, but we may want to
see if we should tighten the naming rules for remote nicknames and
the mapping from nicknames to remote-tracking hiearchy, at Git 3.0
version boundary.