Review Github Pull Request from Emacs!
This project uses ghub, see its document for more details about how to setup the token.
Simply put, add the following line to ~/.authinfo
(replace <...>
accordingly):
machine api.github.com login <YOUR_USERNAME>^emacs-pr-review password <YOUR_GITHUB_PERSONAL_TOKEN>
You may customize username and api host (for github enterprise instances) using ghub,
or you can also set pr-review-ghub-username
and pr-review-ghub-host
for pr-review only.
This package provides the following entrypoint:
M-x pr-review
: open a PR with given URL.M-x pr-review-notification
: list github notifications in a buffer, and open PRs from itM-x pr-review-search-open
: search in github and select a PR from search result.M-x pr-review-search
: like above, but list results in a bufferSuggested config (especially for evil users):
(evil-ex-define-cmd "prr" #'pr-review)
(evil-ex-define-cmd "prs" #'pr-review-search)
(evil-ex-define-cmd "prn" #'pr-review-notification)
(add-to-list 'browse-url-default-handlers
'(pr-review-url-parse . pr-review-open-url))
Personally I suggest two possible workflows:
pr-review-notification
as your "dashboard" and enter PR review from it.pr-review
from the notmuch message buffer.
Running pr-review
in the email buffer will automatically find the PR url in the email.There's three most-used keybindings:
C-c C-c
: add a comment based on current context.
C-c C-s
: perform some "action" based on current context.
C-c C-e
: edit the content under point based on current context, the following items can be updated (if you have the right permission):
There's also buttons (clickable texts) for major actions (e.g. reply, submit review), you can just use them.
Some other keybindings:
C-c C-r
: refresh (reload) current bufferC-c C-v
: view current changed file under point (either HEAD or BASE version, based on current point) in a separated bufferC-c C-o
: open this pull request in browserC-c C-q
: request reviewersC-c C-l
: set labelsEvil users will also find some familiar keybindings. See describe-mode
for more details.
When you are adding or editing the comment, you will be editing in a new PrReviewInput buffer. Keybindings in this buffer:
C-c C-c
: Finish editing, confirm the contentC-c C-k
: Abort, drop the contentC-c @
: Mention some other (inserting @username
)RET
: Open the PR (While this buffer lists all types of notifications, only Pull Requests can be opened by this package)C-c C-n
/ C-c C-p
(gj
/ gk
for evil users): next/prev pagerevert-buffer
(gr
for evil users)C-c C-t
: toggle filtersActions in this buffer works like dired
: items are first marked, then executed:
C-c C-r
(r
for evil users): mark as read. Note that items are automatically marked as read when opened.C-c C-d
(d
for evil users): mark as unsubscribe (delete).C-c C-s
(x
for evil users): execute marksC-c C-u
(u
for evil users): unmark item