Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow intelligent hub browse wiki/issue determine of the exact repository page to go #1147

Closed
EthanLin-TWer opened this issue Mar 23, 2016 · 2 comments

Comments

@EthanLin-TWer
Copy link

Currently when you run hub browse it will open the browse and go to the page of the repo under which the command is run at, and this is cool. But when you try hub browse wiki/issue/commit the command cannot determine the exact repo page to go for you automatically. You can do hub browse username/reponame commit to get it work but it's annoying and unproductive, and you can't even config them in a file since you could probably run that command under different repos.

Ideal it should make the decision for you, is this something hard to implement? Really hope to have this feature 😄

@hkdobrev
Copy link

@linesh-simplicity Here's how hub browse work as far as I know:

  • hub browse - open current repository
  • hub browse a/b - open a/b repository
  • hub browse a/b issues- open issues in a/b repository
  • hub browse -- issues - open issues in current repository

So the first argument after hub browse is the repository you want to browse. It defaults to the current one. However if you want to browse a specific section within the current repository you need to pass -- as repository name so the command will know to skip the repository argument. This is a common convention in various Unix commands including Git and it is documented in the hub manual.

git browse [-u] [[USER/]REPOSITORY] [SUBPAGE]
Open repository's GitHub page in the system's default web browser using open(1) or the BROWSER env variable. If the repository isn't specified, browse opens the page of the repository found in the
current directory. If SUBPAGE is specified, the browser will open on the specified subpage: one of "wiki", "commits", "issues" or other (the default is "tree"). A specific commit in the default repos-
itory can be opened with git browse -- commit/<COMMIT>. With -u, outputs the URL rather than opening the browser.

@EthanLin-TWer
Copy link
Author

Thank you very much on the update! I thought there was no space between -- and wiki and have no much idea that is *nix-like command.

Tried hub browse -- wiki and works well.

👍

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

No branches or pull requests

2 participants