8000 Add --upstream-remote-name flag to gh replo clone by ahmedadan · Pull Request #5619 · cli/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add --upstream-remote-name flag to gh replo clone #5619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 24, 2022

Conversation

ahmedadan
Copy link
Contributor
@ahmedadan ahmedadan commented May 12, 2022

Fixes #5467

First take on the issue here, also newer to Go and the project so any guidance would be greatly appreciated.

  • Added --upstream-remote-name flag
  • Added @owner decorator

image

image

@ahmedadan ahmedadan marked this pull request as ready for review May 12, 2022 21:21
@ahmedadan ahmedadan requested a review from a team as a code owner May 12, 2022 21:21
@ahmedadan ahmedadan requested review from samcoe and removed request for a team May 12, 2022 21:21
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label May 12, 2022
@samcoe samcoe self-assigned this May 16, 2022
@ahmedadan ahmedadan changed the title Add --upstream-remote-name flag to replo clone Add --upstream-remote-name flag to gh replo clone May 20, 2022
Copy link
Contributor
@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahmedadan Thanks for the contribution and patients while we got this reviewed. The code looks good to me. I pushed a small change that clarified some of the help documentation, added a test, and did a small refactor of AddUpstreamRemote to make it more generalized which allowed me to simplify the overall logic a bit.

@mislav What do you think of the @owner functionality introduced here?

Copy link
Contributor
@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for adding this feature

@@ -367,12 +367,12 @@ func RunClone(cloneURL string, args []string) (target string, err error) {
return
}

func AddUpstreamRemote(upstreamURL, cloneDir string, branches []string) error {
args := []string{"-C", cloneDir, "remote", "add"}
func AddNamedRemote(url, name, dir string, branches []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now has large overlap with the existing git.AddRemote() function, but it's fine for now as we can clean that up as part of #4900

@samcoe samcoe merged commit 31bee2e into cli:trunk May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external pull request originating outside of the CLI core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gh repo clone: optionally name the upstream remote with the owner name instead of upstream
4 participants
0