git-remote-entire: Missing Cluster Host Dialog · Entire

let's say we do "git clone entire://gh/entire.io/cli" then the host is missing, could now the entire git helper provide a dialog letting you pick the right mirror?

Short answer

A picker dialog inside the git helper is technically possible but the wrong layer — and you don't need it, because that picker already exists in entire repo clone. The right fix is to make the helper's error point there.

What actually happens with entire://gh/entire.io/cli today

It's worth being precise, because it's not quite the "missing host" branch. net/url parses that as:

So gh lands in the cluster-host slot. The helper (cmd/git-remote-entire/main.go:92) only rejects a literally empty host, so this sails past and fails later at cluster discovery — it tries to fetch https://gh/.well-known/entire-cluster.json and dies with an opaque discovery error. The clean "missing host" case is actually entire:///gh/entire.io/cli (three slashes). Either way the user omitted the cluster host.

Why a dialog in the helper is the wrong tool

Three hard constraints, in order of how damning they are:

  1. The helper can't persist your choice. Git records the remote URL in .git/config verbatim and re-invokes the helper for every future git fetch/git pull/git push. If the stored URL is under-specified, a picker would re-prompt on every operation forever — the helper has no way to rewrite the stored remote. entire repo clone, by contrast, resolves the cluster once and clones a fully-qualified entire://<cluster>/gh/owner/repo, so .git/config is correct and nothing re-prompts. This alone rules the helper out.

  2. stdin/stdout are reserved. The helper's stdout/stdin are git's pkt-line protocol stream. A picker would have to go the askConfirmTTY route — write options to stderr, read the selection from /dev/tty directly. Doable, but fiddly and against the "dumb, scriptable transport" design.

  3. It'd need control-plane auth just to list candidates. The candidate mirrors come from the coreapi.ListMirrors API, which needs a resolved login context — the same resolution that's failing when the cluster host is unknown.

The picker you want already exists

entire repo clone /gh/entire.io/cli does exactly this:

Recommended change

Keep the helper dumb, but detect this specific mistake and route the user to the existing picker — mirroring the pattern that's already there for the server's invalid_target "lives on <host>" correction:

case gitremote.IsSupportedForge(parsedURL.Host):
    fmt.Fprintf(os.Stderr,
        "fatal: %q is a forge id, not a cluster host. entire:// URLs need the cluster host.\n"+
        "To pick a mirror interactively, run:\n\n    entire repo clone /%s%s\n",
        parsedURL.Host, parsedURL.Host, parsedURL.Path)
    return 128

For entire://gh/entire.io/cli that prints entire repo clone /gh/entire.io/cli — which then shows the picker. Cheap, safe, keeps the transport a transport, and reuses the actionable-error idiom already in the file.

Want me to implement that error-pointer change (with a test in main_test.go)?

Overview: how the entire:// remote helper works

The helper is a standalone binary git-remote-entire (not part of the cobra command tree). Git resolves git clone entire://.../... by exec'ing this binary on PATH as git-remote-entire &lt;remote-name&gt; &lt;url&gt;, then speaks the git remote-helper protocol over stdin/stdout.

1. Where the remote helper is implemented

2. How the URL is parsed

The helper parses the raw URL with Go's net/url in main.go (lines 83–95):

rawURL := args[2]
parsedURL, err := url.Parse(rawURL)
switch {
case err != nil:
    fmt.Fprintf(os.Stderr, "fatal: invalid URL %q: %v\n", rawURL, err)
    return 128
case parsedURL.Scheme != "entire":
    fmt.Fprintf(os.Stderr, "fatal: unsupported URL scheme %q (expected 'entire')\n", parsedURL.Scheme)
    return 128
case parsedURL.Host == "":
    fmt.Fprintf(os.Stderr, "fatal: missing host in URL %q\n", rawURL)
    return 128
}

So the helper cares about three parts: Scheme, Host, and Path (the repo path). The canonical form is entire://<cluster-host>/gh/<owner>/<repo>.

3. How the helper resolves the actual host / mirror / cluster

Two layers:

4. Interactive context / TTY

The git-remote-entire helper never prompts and does no TTY detection. There is no interaction.

Summary

The PR is updated. Key changes are implemented for actionable hints when the cluster host is missing.