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

Tab completion for repo names in hub clone #1978

Closed
wants to merge 2 commits into from
Closed

Tab completion for repo names in hub clone #1978

wants to merge 2 commits into from

Conversation

apjanke
Copy link
Contributor

@apjanke apjanke commented Dec 22, 2018

How about some tab completion for the shorthand repo names in the hub clone command?

This PR adds support for tab completion of repo names in git clone <repo>. It supports both un-qualified repo names for the current user, and <user>/<repo> qualified names.

Examples:

hub clone <TAB>

will list all the current user's own repos.

hub clone foo<TAB>

will complete this user's repos starting with "foo".

hub clone defunkt/<TAB>

will list all repos for user defunkt.

screen shot 2018-12-22 at 12 58 46 am

screen shot 2018-12-22 at 12 59 07 am

Limitations:

Does not complete user names, because there's just too darn many of them. (Maybe if the GitHub API exposed a prefix-filtered user listing endpoint, we could do that too.)

It's pretty slow right now. If this PR is accepted, I'll add some caching to it.

@apjanke apjanke changed the title Tab completion for repo names in 'hub clone' Tab completion for repo names in hub clone Dec 22, 2018
@mislav
Copy link
Owner

mislav commented Jan 26, 2019

@apjanke There is a hub api command now for low-level API access! You could consider re-implementing this using GraphQL calls (they're going to be faster) instead of adding a new internal endpoint. https://github.com/github/hub/releases/tag/v2.8.3 #2016

Ref. #871

@apjanke
Copy link
Contributor Author

apjanke commented Mar 5, 2019

Yep, that's a good idea. Don't pull this; I'll rewrite.

@apjanke apjanke closed this by deleting the head repository May 18, 2024
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.

2 participants