Skip to content

feat(clone): add --public-fork for legacy mirrors - #110

Merged
cabljac merged 1 commit into
noninteractive/04-no-tty-fail-fastfrom
noninteractive/05-clone-public-fork
Oct 17, 2026
Merged

cabljac merged 1 commit into
noninteractive/04-no-tty-fail-fastfrom
noninteractive/05-clone-public-fork

Conversation

@cabljac

@cabljac cabljac commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

On a legacy mirror with no venfork-config branch, clone guessed the public fork and, without a TTY, failed naming the wrong flag. This adds clone --public-fork <url> (URL or owner/repo). It replaces the guess and the prompt. With a config branch it must name the recorded fork, and it is refused with --no-public. Clone prompt cancels exit 130, and empty answers are rejected. The parent lookup passed its jq filter to gh with literal quotes, so auto-detection never worked; that is fixed.

setup: only the flag --org <own username> counts as consent for the personal account, compared without case. VENFORK_ORG set to your username still needs --yes without a TTY.

Red-first: an integration test that deletes the fixture's config branch and clones through a gh stub, a no-TTY test for exit 2 naming --public-fork, and "VENFORK_ORG set to own username still needs --yes without a TTY".

bun run verify exits 0. Drove clone.md. Count gate: unit 999 to 1021, integration 323 to 325.

Not verified: e2e tiers.

Part of the 0.13.0 non-interactive and portable stack.

@cabljac
cabljac added this pull request to stack #116 October 14, 2026 14:22
@cabljac
cabljac force-pushed the noninteractive/05-clone-public-fork branch from 6749ea0 to 01049cd Compare October 14, 2026 23:16
@cabljac
cabljac force-pushed the noninteractive/05-clone-public-fork branch from 01049cd to cf416f0 Compare October 15, 2026 01:10
@cabljac
cabljac marked this pull request as ready for review October 16, 2026 08:55
clone gains --public-fork <url> (URL or owner/repo) for mirrors without a
venfork-config branch. It replaces the public fork guess and prompt, and
the upstream parent lookup then runs on that fork, not on the mirror owner.
With a config branch the flag must name the recorded fork, like --upstream;
both now compare by repository, so another URL form of the same repo is
accepted. --public-fork with --no-public, or on a no-public config, is
refused.

The public fork prompt without a TTY now names --public-fork <url>. Every
clone prompt cancel exits 130, and the fork and upstream prompts reject an
empty answer through validate.

The parent lookup passed --jq '.parent.url' with literal quotes to gh, so
upstream auto-detection always fell through to the prompt. Fixed.

setup: --org set to your own gh username (compared ignoring case) counts
as consent and skips the personal-account confirm. VENFORK_ORG set to your
username is ambient, so it does not.
@cabljac
cabljac force-pushed the noninteractive/05-clone-public-fork branch from cf416f0 to c325392 Compare October 17, 2026 17:07
@cabljac
cabljac merged commit abfce06 into main Oct 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant