sigma / magit-gh-pulls

Magit plugin for dealing with GitHub pull requests
254 stars 48 forks source link

`magit-gh-pulls-pull-detail-limit` is far too limiting, and not easy to find out about at all #120

Open robohack opened 6 years ago

robohack commented 6 years ago

So, I'm experimenting with magit-gh-pulls and it appears to be very useful.

However in a clone of a forked repository I'm having trouble seeing all of the (currently 70) pull requests I've fetched from the original repository.

The first ten appear in normal font and I can "visit" them (<RET>) and see their diff (# d).

However all the remainder appear with italic text and trying to view their diff gives the message Please fetch pull request commits first and trying to visit them appears to run the fetch but then does nothing. ($ shows the git fetch command as successful, and expanding it shows the new ref.)

The thing is they're all fetched already (I have fetch = +refs/pull/*/head:refs/pull/upstream/* for the original remote in the .git/config file). I can see them with git log --all. I can visit their diff from the magit log buffer (i.e. after l a) (or from the command line) Fetching them again with # f "works" too, but doesn't change anything.

So I get this far, then I read the source and I immediately see magit-gh-pulls-pull-detail-limit when I search to see if the magic number 10 appears anywhere. That's not how I want to go about solving such mysterious behaviour!

Why is there no hint of this limit in error messages, and instead a bold-faced lie misdirecting the blame?

It seems like magit-gh-pulls-pull-detail-limit was quickly added to work around performance problems, but without much thought as to the consequences. I can't even change it with set-variable. When I do change it with setq (and then refresh with g) I have access to the previously inaccessible pull requests of course, though accessing PRs seems far slower than it should be given they are all fetched and their diffs are infinitely faster to visit via the log buffer.

I think while the magit-gh-pulls-pull-detail-limit hack exists it should be prominently mentioned in the top readme file, and be referenced by an error message printed immediately by any attempted action on any PR below the current limit. If I get some chance soon I'll try patching the error handling at least and use that as my test to send a PR here.

I'm using emacs 25.2 and magit-gh-pulls 0.5.3 with git version 2.14.0