node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Broken "gh pr --remote" on several subcommands #396

Closed arboliveira closed 6 years ago

arboliveira commented 9 years ago

gh pr --remote

gh pr 69 --remote arboliveira

Fetching pull request #69 into branch pr-69
remote: Counting objects: 112, done.
remote: Total 112 (delta 68), reused 68 (delta 68), pack-reused 44
Receiving objects: 100% (112/112), 11.75 KiB | 0 bytes/s, done.
Resolving deltas: 100% (72/72), completed with 29 local objects.
From github.com:juliocamarero/liferay-portal
 * [new branch]      pr-3785    -> pr-69
Switched to branch 'pr-69'
[hook] gh pr 69 --comment 'Just started reviewing :)'
Adding comment on pull request #69
fatal: Can't comment on pull request 69.

Problem seems to be, --remote not being carried across hooked --comment call. Luckily, the --comment subcommand does work perfectly afterwards: gh pr 69 --comment 'Just started reviewing :)' --remote arboliveira

gh pr --submit --remote

gh pr --submit mhan810 --remote arboliveira

Submitting pull request to @mhan810
Counting objects: 17, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (17/17), 1.45 KiB | 0 bytes/s, done.
Total 17 (delta 10), reused 0 (delta 0)
To file:////Users/arbo/git-cron/liferay-portal-scheduled-pull

The file:////... path you see above is actually the mapping for the origin remote. The arboliveira remote is mapped to GitHub, should be used as specified in the --remote argument.

 * [new branch]      LPS-56690-Elasticsearch-getClient-unsynced -> LPS-56690-Elasticsearch-getClient-unsynced
fatal: Can't submit pull request. undefined

In this case it looks like --remote is just plainly ignored upon calling GitHub.

protoEvangelion commented 6 years ago

--remote corresponds to your remote alias like upstream or origin.

Also --remote is not an available flag for gh pr --submit.

Please let me know if I am missing something :smile: