Skip to content

Fix browse issue with leading hashtag#6144

Merged
samcoe merged 1 commit intocli:trunkfrom
nsmag:fix-browse-hashtag
Aug 29, 2022
Merged

Fix browse issue with leading hashtag#6144
samcoe merged 1 commit intocli:trunkfrom
nsmag:fix-browse-hashtag

Conversation

@nsmag
Copy link
Contributor

@nsmag nsmag commented Aug 25, 2022

Fixes #6095.

@nsmag nsmag requested a review from a team as a code owner August 25, 2022 11:32
@nsmag nsmag requested review from samcoe and removed request for a team August 25, 2022 11:32
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Aug 25, 2022
@LangLangBart
Copy link

Thank you for picking up the issue.

  1. I noticed that generated links to PRs would display the word issues rather than pull.
❯ bin/gh pr view '#8' -wR cli/cli
Opening github.com/cli/cli/pull/8 in your browser.

❯ bin/gh issue view '#8' -wR cli/cli
Opening github.com/cli/cli/pull/8 in your browser.

❯ bin/gh browse '#8' -wR cli/cli
Opening github.com/cli/cli/issues/8 in your browser.

❯ bin/gh browse '#8' -wR cli/cli -n
https://github.com/cli/cli/issues/8
  1. quotation marks are missing from the examples with the hashtag? Without goose bumps, it would not generate the correct link for me.
  $ gh browse 217
  #=> Open issue or pull request 217

  $ gh browse #217
  #=> Open issue or pull request 217
❯ bin/gh browse #217
Opening github.com/cli/cli in your browser.

❯ bin/gh browse '#217'
Opening github.com/cli/cli/issues/217 in your browser.

@nsmag
Copy link
Contributor Author

nsmag commented Aug 25, 2022

About issues/pull url, I think GitHub will redirect to the correct link anyway. Not sure if I should change this behavior.

@nsmag
Copy link
Contributor Author

nsmag commented Aug 26, 2022

In this PR, I just handle the leading # in the argument so gh issue view '#8' -wR cli/cli and gh browse '#8' -R cli/cli will eventually open the same issue/pull request on a browser. I didn't change the parsing logic of browse command.

I think I need an opinion from the team.

@samcoe samcoe self-assigned this Aug 29, 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.

@nsmag This looks great to me, thanks for the contribution.

@samcoe samcoe enabled auto-merge (squash) August 29, 2022 07:50
@samcoe samcoe merged commit ac036c1 into cli:trunk Aug 29, 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 browse hashtag issue

4 participants