unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: William Casarin <jb55@jb55.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: notmuch@notmuchmail.org
Subject: Re: Washing GitHub emails to include inline patch?
Date: Thu, 12 Oct 2017 23:03:12 -0700	[thread overview]
Message-ID: <87bmlbwpnj.fsf@jb55.com> (raw)
In-Reply-To: <87mv4vd3ia.fsf@kyleam.com>

Kyle Meyer <kyle@kyleam.com> writes:

> 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.

Oh, good call.

>> -    (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.

Indeed, thanks again.

The last piece of the puzzle is the origin/master branch isn't always
the base branch it's merging into. I believe the proper way to do this
is like so. First we add another set of refs to fetch in our .git/config:

    [remote "origin"]
      fetch = +refs/pull/*/merge:refs/merge/origin/*

Now we can use this to get the base branch for the PR:

    refs/merge/origin/100^..refs/pull/origin/100

Which returns the proper set of commits.


Cheers,


-- 
https://jb55.com

  reply	other threads:[~2017-10-13  6:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-21 16:34 William Casarin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmlbwpnj.fsf@jb55.com \
    --to=jb55@jb55.com \
    --cc=kyle@kyleam.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).