When calling :Octo pr without further argument, open the pr associated with the current branch
Does this pull request fix one issue?
Fixes #492
Describe how you did it
Add a __call property to the command metatable, to allow command to be called without action arguments
Use gh pr view instead of gh pr status to get pr info since it defaults to current branch pr
Describe how to verify it
Checkout a branch in with an open PR in a repo, run :Octo pr
Special notes for reviews
I realized when opening the PR that when the PR is cross repo, the gh cli does not give you the owner of the target repo, so I had to manually parse the url which is quite painful to do in lua.
Let me know if there is something smarter to do, either for parsing or with another query for the graphql.
Since we get the pr id from the gh pr view, maybe we could retrieve the repo owner/name info through the graphql request done just after?
Describe what this PR does / why we need it
When calling
:Octo pr
without further argument, open the pr associated with the current branchDoes this pull request fix one issue?
Fixes #492
Describe how you did it
Add a
__call
property to the command metatable, to allow command to be called without action arguments Usegh pr view
instead ofgh pr status
to get pr info since it defaults to current branch prDescribe how to verify it
Checkout a branch in with an open PR in a repo, run
:Octo pr
Special notes for reviews
I realized when opening the PR that when the PR is cross repo, the gh cli does not give you the owner of the target repo, so I had to manually parse the url which is quite painful to do in lua. Let me know if there is something smarter to do, either for parsing or with another query for the graphql.
Since we get the pr id from the
gh pr view
, maybe we could retrieve the repo owner/name info through the graphql request done just after?