Washing GitHub emails to include inline patch?

Kyle Meyer kyle at kyleam.com
Thu Oct 12 22:24:13 PDT 2017


William Casarin <jb55 at jb55.com> writes:

> This worked pretty well, I've modified it a bit to support a generic
> github repo location which is parsed from the subject,

Great, glad you were able to tweak that test function into something
that works well with your setup.

> and origin/master instead of master:

Yep, that's better.

>  (defun km/notmuch-visit-pr-in-magit (&optional dont-fetch)
> @@ -39,4 +41,4 @@
>      ;; passing a more explicit refspec to the fetch call.
>      (unless dont-fetch
>        (magit-call-git "fetch" "origin"))

Looking at what I wrote again, I'd change DONT-FETCH to FORCE-FETCH and
then do something like

    (when (or force-fetch
              (not (magit-ref-exists-p local-ref)))
      (magit-call-git "fetch" "origin"))

where local-ref is bound to "refs/pull/origin/<pr>".  That way, "git
fetch" is only called if the ref doesn't already exist locally or when a
prefix argument is given, which would be useful for forced updates.

> -    (magit-log (list (concat "master..refs/pull/origin/" pr)))))
> +    (magit-log (list (concat "origin/master..refs/pull/origin/" pr)))))

Anyway, it's nice to see that you've been able to modify this into
something that might be useful to you.

-- 
Kyle


More information about the notmuch mailing list