git - Get result of merging a PR while it is already merged -
for pr number 1 github automatically creates ref refs/pulls/1/head
, refs/pulls/1/merge
. latter contains result of merge , useful e.g. ci (because want test result of merge).
after merging pr, refs/pulls/<number>/merge
no longer available (i suppose because pr no longer mergeable). want run test on version merged while ago. there easy way access result of merged pr, given pr number?
the following should trick though should aware there possibly multiple "children" of commit (someone else base work on pr , merge master again later):
$ git rev-list -n1 upstream/pull/<number>..upstream/master
this works getting first commit walking upstream/pull/<number>
upstream/master
. luckily github leaves upstream/pull/<number>
on last commit of pr.
here's example of https://github.com/rdflib/rdflib:
it's current history looks this:
* 371263f - (upstream/pull/486) removed debugging print statement ... * fe3fa52 - (upstream/master, upstream/head) merge pull request #482 |\ | * 354c352 - (upstream/pull/482) fix broken example |/ * f81e0b2 - merge pull request #480 ....
here test output:
$ git rev-list -n1 upstream/pull/482..upstream/master fe3fa522b48e787fa87dc1156e1a10bd6671b62c $ git rev-list -n1 upstream/pull/486..upstream/master (no output)
Comments
Post a Comment