Skip to content

Creating fork during gh pr create hangs for several minutes #2716

@maco

Description

@maco

Describe the bug

Submitting a PR for an unforked repo hangs without any feedback to the user, while it figures out the forking stuff in the background.

gh version 1.1.0 (2020-10-06)

Steps to reproduce the behavior

  1. Click the code clone button on a third-party repo and copy the GH CLI command for cloning
  2. Paste that command in terminal
  3. Make changes
  4. Commit
  5. gh pr create
  6. When asked where to push the master branch, just hit at the "create a fork..." suggestion
  7. Fill in the PR form in the terminal
  8. Submit

Expected vs actual behavior

Actual

For several minutes, there are no updates at all in the terminal. It looks dead. After...maybe 5 minutes, maybe longer? ... it dumps out the rest of the output (see below) including that fatal: Could not read from remote repository but then says it successfully created the PR.

I checked in the browser, and it turns out it completed successfully.

Expected

  1. Spitting out that "fatal error" shouldn't happen when it's working just fine. That's confusing. Maybe hold it and spit it out later if things actually don't end up working out?
  2. Ideally, no long wait.
  3. If there has to be long wait, then a progress bar or spinner would be good at the bare minimum. It would be better if it kept the user in the loop on what's going on. For example:
Creating fork {spinner}
Pushing code to fork {spinner}
Creating pull request {spinner}
Done!

(Sure, continue to include the full verbose git output like in the log, but you clearly know how to make bold text in the terminal, so little headings would be nice.)

Logs

Paste the activity from your command line. Redact if needed.

❯ gh pr create
? Where should we push the 'master' branch? Create a fork of womenwhocodedc/organization

Creating pull request for maco:master into master in womenwhocodedc/organization

? Title add protocols to meetup and medium links so clicking works
? Body <Received>
? What's next? Submit
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Connection to github.com closed by remote host.
waiting 2 seconds before retrying...
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 337 bytes | 337.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To github.com:maco/organization.git
   1283d8b..2ecacbb  HEAD -> master
Branch 'master' set up to track remote branch 'master' from 'fork'.
https://github.com/womenwhocodedc/organization/pull/77

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions