unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Re: Washing GitHub emails to include inline patch?
@ 2017-09-22  1:49 Kyle Meyer
  2017-09-22 14:17 ` Tomi Ollila
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Kyle Meyer @ 2017-09-22  1:49 UTC (permalink / raw)
  To: jb55; +Cc: notmuch

William Casarin writes:

> Most of the patches I review these days comes in as GitHub emails that
> look like this:
>
>
> You can view, comment on, or merge this pull request online at:

[...]

> -- Patch Links --
>
> https://github.com/monstercat/iris/pull/52.patch
> https://github.com/monstercat/iris/pull/52.diff

[...]

> I wonder if it would be be possible to wash this email by downloading
> the patch and present it inline like git-send-email. This would allow me
> to review patches without having to click around the GitHub interface.
> Has anyone done this?

I have a command in my Emacs configuration that I think gets close to
what you want.

--8<---------------cut here---------------start------------->8---
(defun km/open-github-patch (buffer)
  "Find GitHub patch link in BUFFER and show it in a new buffer."
  (let ((url
         (with-current-buffer buffer
           (save-excursion
             (goto-char (point-min))
             (if (re-search-forward "https://github.com/.*\\.patch" nil t)
                 (match-string-no-properties 0)
               (user-error "No patch found"))))))
    (with-current-buffer (get-buffer-create
                          (generate-new-buffer-name "*mail-github-patch*"))
      (url-insert-file-contents url)
      (diff-mode)
      (view-mode 1)
      (pop-to-buffer (current-buffer)))))

(defun km/notmuch-show-open-github-patch ()
  "Open patch from GitHub email."
  (interactive)
  (with-current-notmuch-show-message
   (km/open-github-patch (current-buffer))))
--8<---------------cut here---------------end--------------->8---

The km/open-github-patch helper function exists because I made a slow
transition from gnus to notmuch and have a gnus variant that also calls
km/open-github-patch.  If km/notmuch-show-open-github-patch is the only
caller, there's not much point in having a separate helper function.

-- 
Kyle

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Washing GitHub emails to include inline patch?
@ 2017-09-21 16:34 William Casarin
  0 siblings, 0 replies; 13+ messages in thread
From: William Casarin @ 2017-09-21 16:34 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 100 bytes --]


Hey team,

Most of the patches I review these days comes in as GitHub emails that
look like this:


[-- Attachment #2: Type: message/rfc822, Size: 660 bytes --]


  https://github.com/monstercat/iris/pull/52

-- Commit Summary --

  * Fix merge conflict putting location search into non-clean-ui iris

-- File Changes --

    M bin/js/main.js (66)
    M bin/js/users.js (71)
    M html/head.html (2)
    M templates/users.html (68)

-- Patch Links --

https://github.com/monstercat/iris/pull/52.patch
https://github.com/monstercat/iris/pull/52.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/monstercat/iris/pull/52

[-- Attachment #3: Type: text/plain, Size: 278 bytes --]



I wonder if it would be be possible to wash this email by downloading
the patch and present it inline like git-send-email. This would allow me
to review patches without having to click around the GitHub interface.
Has anyone done this?

Cheers,
William
 
-- 
https://jb55.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-10-13  6:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-22  1:49 Washing GitHub emails to include inline patch? Kyle Meyer
2017-09-22 14:17 ` Tomi Ollila
2017-09-22 14:57   ` Kyle Meyer
2017-09-22 21:38 ` William Casarin
2017-10-10 17:35 ` William Casarin
2017-10-10 19:54   ` Kyle Meyer
2017-10-11  1:45     ` William Casarin
2017-10-11  3:51       ` Kyle Meyer
2017-10-11  4:38         ` William Casarin
2017-10-12 19:28         ` William Casarin
2017-10-13  5:24           ` Kyle Meyer
2017-10-13  6:03             ` William Casarin
  -- strict thread matches above, loose matches on Subject: below --
2017-09-21 16:34 William Casarin

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).