Repository navigation
Conversation
|
Thanks for your pull request! Unfortunately, it doesn't meet the minimum requirements for review:
Please update your PR to address the above. Requirements:
This PR will be automatically closed in 7 days if these requirements are not met. |
There was a problem hiding this comment.
Pull request overview
This PR updates gh repo fork behavior when run inside an existing local clone so that, when adding a fork remote, the original/parent repo remote (e.g., origin or renamed upstream) is marked as the directory’s default (“base”) repository for gh context resolution, and the TTY UX mirrors the clone-path messaging.
Changes:
- Set
remote.<parent>.gh-resolved=basewhen adding a fork remote in an existing clone (including afterorigin→upstreamrename). - Print the “default repository set” message in TTY mode for this existing-clone remote-add path.
- Update/extend
repo forktests to assert the new git config call and updated stderr output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/cmd/repo/fork/fork.go | Tracks the parent remote name, updates it on rename, sets gh-resolved base, and prints the default-repo message in TTY. |
| pkg/cmd/repo/fork/fork_test.go | Updates command stubs and expected output to cover the new gh-resolved base config and TTY messaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When forking from an existing clone with --remote, gh now marks the parent remote as the base repository automatically. This mirrors clone behavior so users can run repo commands immediately without a separate repo set-default step. Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Assisted-by: openai/gpt-5.3-codex on opencode
95e811c to
4d4413b
Compare
|
Hi @scarf005, thank you for this. I'm a little confused though — I don't think this closes #3724 as linked. That issue is about I think aligning with the clone path makes mostly sense, but I'd like to understand where the motivation comes from — like what pain you're seeing — before changing this behavior, since one could argue it's a sort of breaking change for users who have existing expectations around the current fork-in-existing-repo behavior. |
to summarize: i've cloned a repo, then decided to fork it, but even after on other thoughts, i think i've linked the PR to less relevant issue; will try updating the PR this weekends. |
Ask for confirmation before writing gh-resolved base in existing-clone fork flows, and add --yes for explicit non-interactive opt-in. This addresses reviewer concerns about implicit behavior changes while preserving automation support. Assisted-by: openai/gpt-5.3-codex on opencode Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Summary
Fixes #12833