Open haikyuu opened 9 years ago
It would be cool. However that would mean that your keystrokes would be triggering API requests and that you would have to wait for them to finish, making those autocompletions relatively slow? Are you sure this would be a good experience?
Yes, that's true. I think we should add a proper command for discovery.
For example hub discover github
would print all the repos of Github and store their names in cache for proper auto-completion:
hub . . . . . . . . . . . . Hub helps you win at git. . . . . . . . . . . . . . . . . :star: 6,165 fork
554 source
/fork
gitignore . . . . . . . . A collection of useful .gitignore templates . . . . :star: 23,840 fork
8738 source
/fork
...
^ discovery command would be great.
So is anyone currently working on the discover command? If not, I can take it on! I'd really love that feature. Thanks :)
@isundaylee Not to my knowledge. Please explore how such a command could work. Note that our API library is go-octokit right now and that it might need contributing to as well to facilitate the feature of searching for repos.
@isundaylee i'd love to help. Let me know when you start working on it. Thanks
@haikyuu That'd be really great! I just spent some time learning Go and went ahead and added the basic functionality of listing all the repos of a given user (https://github.com/isundaylee/hub/commit/df93604bcba6e29f6891870f934ac6a1d7d96f3c). We should probably discuss a bit about how we want to present the information, as well as possibly caching the information somewhere so that we can later reuse them for completion.
So what information would we want in such a view? I'd assume repo name, # of forks, and # of stars. Anything else we might want?
Also do we have a standard way of outputting tabular output in hub
?
@isundaylee I foresee that this shell completion feature would have two parts of implementation:
hi, did anything come of this discussion? i'd be keen on seeing this implemented. @isundaylee did you ever submit a pull request for this? I do realize this was a year ago, btw!
@minademian Hi! No I never ended up submitting a pull request for this. This was mostly because that at some point I stopped using hub
as much as I used to. Sorry for that ):
It would be cool to auto-complete or show suggestions. For example:
hub clone github/
+ 2 *tab
would list all the public repos of Github. Andhub clone github/hu
+tab
would completegithub/hub