add a command for listing all open pull requests #351

Closed
wants to merge 1 commit into
from

5 participants

@radamant

You can run:

hub pulls

And get output like:

jm3 - Add correct hub alias for fish shell (fixes #248)
https://github.com/defunkt/hub/pull/350

pchw - add pull-request to open-browser option
https://github.com/defunkt/hub/pull/344

mmozuras - Figure out default branch for the project instead of just using master
https://github.com/defunkt/hub/pull/326

timmow - Add info on using with Github Enterprise
https://github.com/defunkt/hub/pull/297

jianli - browse -b flag
https://github.com/defunkt/hub/pull/258
@radamant radamant add a command for listing all open pull requests
You can run:

`hub pulls`

And get output like:

```
jm3 - Add correct hub alias for fish shell (fixes #248)
github#350

pchw - add pull-request to open-browser option
github#344

mmozuras - Figure out default branch for the project instead of just using master
github#326

timmow - Add info on using with Github Enterprise
github#297

jianli - browse -b flag
github#258
```
dd927c2
@mislav
GitHub member

Hi @radamant

This looks good, although I'd like to have this with caching. I realize this complicates implementation a bit, but would lead to a much better experience.

I would cache pull requests from every GitHub API response and the next time I'm requesting pulls, I would only request changes after the timestamp when cache was last made.

Also, I'm not writing new unit tests anymore. All new tests should go under features/ as Cucumber stories.

I was thinking of working on this myself. I'll keep this open until I either merge it or implement something equivalent. Thanks for your help!

@radamant

@mislav is there anything I can do to help get this merged? This feature is something my current team would use frequently and they are currently using my fork rather than canonical hub.

@mislav
GitHub member

To ship this feature, it needs:

  1. Pagination to fetch all pull requests, not just the first 30 (API default)
  2. Caching to disk because paginating every time for large repos is going to be wasteful
  3. Conditional GET of only pull requests that have changed since last time they were fetched
  4. Serving pulls from disk cache if requesting them from API fails (offline mode)
  5. Changing the format of the output:

    {PULL ID}: This is the pull request title - Author's Full Name ({USERNAME})
    
  6. Not outputting URLs in the output. It doesn't make sense.

  7. Testing the functionality with Cucumber stories instead of unit tests.

Bonus features:

  1. Possibly making the output format configurable, similar to git log format
  2. Indicating whether a pull request has green status on CI.

I don't expect you to do all this work. I'm going to do as much as I can, but I'll leave your contribution unmerged and open until I decide just how much (if any) of your code I will use. Your coworkers should in the meantime use your fork.

@leoj3n

@radamant I have no affiliation, but you might be interested in https://github.com/eduardolundgren/node-gh

@davidlt

ping.

@mislav
GitHub member

No sense in pinging me :) I still didn't have time to implement this, but I will at some point. Everyone is welcome to beat me to it, if they take in consideration my thoughts above

@bantu

Consider adding an option for limiting the list to those pull requests that need conflict resolution on merge. Not sure whether and how this can be detected using the Github API.

This was referenced Feb 5, 2014
@mislav
GitHub member

Closing this PR as it won't apply anymore since we nuked the Ruby implementation and replaced it with Go: #642. It's on our roadmap to provide a feature for listing issues/pulls, though. Stay tuned.

@mislav mislav closed this Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment