X Tutup
Skip to content

Support issue/PR URLs & PR branch names passed as arguments#129

Merged
mislav merged 5 commits intomasterfrom
pr-arg-selector
Dec 4, 2019
Merged

Support issue/PR URLs & PR branch names passed as arguments#129
mislav merged 5 commits intomasterfrom
pr-arg-selector

Conversation

@mislav
Copy link
Copy Markdown
Contributor

@mislav mislav commented Dec 3, 2019

Now equivalent:

  • issue view:

    • gh issue view 123
    • gh issue view https://github.com/OWNER/REPO/issues/123
  • pr view:

    • gh pr view 123
    • gh pr view https://github.com/OWNER/REPO/pull/123
    • gh pr view BRANCH (for same-repo PRs)
    • gh pr view OWNER:BRANCH (for cross-repo PRs)
  • pr checkout:

    • gh pr checkout 123
    • gh pr checkout https://github.com/OWNER/REPO/pull/123
    • gh pr checkout BRANCH (for same-repo PRs)
    • gh pr checkout OWNER:BRANCH (for cross-repo PRs)

Furthermore, the validity of the argument is always checked before opening the URL. This incurs a small API fetch overhead before the URL is passed to the browser, but this allows us to abort with a helpful message in case of non-existent issues/PR rather than opening a 404 web page:

$ gh issue view 9999
graphql error: 'Could not resolve to an Issue with the number of 9999.'

Fixes #71, fixes #88

Copy link
Copy Markdown

@ampinsk ampinsk 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 from my perspective!

Copy link
Copy Markdown
Contributor

@probablycorey probablycorey left a comment

Choose a reason for hiding this comment

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

This is a nice additional functionality with good tests! 🥇

@mislav mislav merged commit 64bfd0d into master Dec 4, 2019
@mislav mislav deleted the pr-arg-selector branch December 4, 2019 21:03
mislav pushed a commit that referenced this pull request Sep 28, 2021
Adds a confirmation dialog on `ghcs delete` if the codespace in question
has unpushed or uncommited changes.

This confirmation can be skipped using the `--force` or `-f` flag.

Closes: #84
Closes: #10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn on nonexistent issues in issue/pr view <number> Ensure we're using selectors consistently

3 participants

X Tutup