aboutsummaryrefslogtreecommitdiff
path: root/dev/tools/merge-pr.sh
AgeCommit message (Collapse)Author
2020-05-23[dev/tools] Fix #12314: do not die silently if branch has no remote.Théo Zimmermann
2020-05-20[merge-pr] Use a simpler method to get all pagesJason Gross
h/t SkySkimmer at https://github.com/coq/coq/pull/12316#issuecomment-630952659
2020-05-20[merge-pr.sh] Follow next links insteadJason Gross
As per PR review request
2020-05-20Use pagination in fetching the number of reviewsJason Gross
Fixes #12300 Note that I currently only paginate the API call for the number of reviews, not the main API call, because (a) the main API call doesn't seem subject to pagination (it returns a dict, not an array), and (b) because fetching the total number of pages incurs an extra API call for each one that we want to paginate, even if there is only one page. We could work around (b) with a significantly more complicated `curl_paginate` function which heuristically recognizes the end of the header/beginning of the body, such as ```bash curl_paginate() { # as per https://developer.github.com/v3/guides/traversing-with-pagination/#changing-the-number-of-items-received, GitHub will never give us more than 100 url="$1?per_page=100" # We need to process the header to get the pagination. We have two # options: # # 1. We can make an extra API call at the beginning to get the total # number of pages, search for a rel="last" link, and then loop # over all the pages. # # 2. We can ask for the header info with every single curl request, # search for a rel="next" link to follow to the next page, and # then parse out the body from the header. # # Although (1) is simpler, we choose to do (2) to save an extra API # call per invocation of curl. while [ ! -z "${url}" ]; do response="$(curl -si "${url}")" # we search for something like 'link: <https://api.github.com/repositories/1377159/pulls/12129/reviews?page=2>; rel="next", <https://api.github.com/repositories/1377159/pulls/12129/reviews?page=2>; rel="last"' and take the first 'next' url url="$(echo "${response}" | grep -m 1 -io '^link: .*>; rel="next"' | grep -o '<[^>]*>; rel="next"' | grep -o '<[^>]*>' | sed s'/[<>]//g')" echo "Response: ${response}" >&2 echo "${response}" | { is_header="yes" while read line; do if [ "${is_header}" == "yes" ]; then if echo "${line}" | grep -q '^\s*[\[{]'; then # we treat lines beginning with [ or { as the beginning of the response body is_header="no" echo "${line}" fi else echo "${line}" fi done } done } ```
2020-02-24Remove hard to read blue color in merge-prGaëtan Gilbert
2020-02-21[merge-script] Improve warning in case of batch merging.Théo Zimmermann
2020-01-07[merge script] Never bypass outdated branch sanity check.Théo Zimmermann
The message was confusing and the prompt let one reviewer think the merge script would take care of doing the pull, which it doesn't.
2019-07-09merge-pr.sh: filter reviews to remove the PR authorGaëtan Gilbert
This removes spurious Ack-by lines
2019-02-21Merge PR #9388: merge-pr.sh: fix #9387: quick_conf doesn't work in emacs ↵Emilio Jesus Gallego Arias
shell buffer Reviewed-by: ejgallego
2019-02-04Remove AppVeyor: superseded by Azure.Théo Zimmermann
2019-01-23merge-pr.sh: fix #9387: quick_conf doesn't work in emacs shell bufferGaëtan Gilbert
2019-01-22Remove travisGaëtan Gilbert
The azure OSX job replaces the first travis job, and the second always fails and so is useless.
2019-01-17Fix merge-pr.sh when multiple review commentsGaëtan Gilbert
It used to output duplicate trailers.
2019-01-08merge-pr: add reviewer info to commit messageGaëtan Gilbert
This produces a commit message like ~~~ Merge PR #9250: coqchk: fix check for kelim with functors Reviewed-by: ppedrot Ack-by: mattam92 ~~~
2018-11-18merge-pr: Improve overlay checkGaëtan Gilbert
2018-06-09[merge script] Check if the CI that was run is outdated.Théo Zimmermann
[ci skip]
2018-04-11merge script support https + typos in docPierre Courtieu
2018-04-09Merge script: adds a way for confirmation to expect a newline.Théo Zimmermann
This fulfils Gaetan's wish.
2018-04-09Add sanity check in merge script: local branch is up-to-date.Théo Zimmermann
In case the local branch is ahead of upstream, we only print a warning because it could be that we are merging several PRs in a row.
2018-04-08Document requirement to have git >= 2.7 to use the merge script.Théo Zimmermann
As reported in https://github.com/coq/coq/issues/7097#issuecomment-378632415
2018-04-08Merge script does not warn when the remote is set to HTTPS.Théo Zimmermann
This should solve Emilio's problem.
2018-04-08Merge script: use fetch URL for the remote.Théo Zimmermann
In case the push URL has been overriden to make it fetch-only.
2018-04-05Improve shell scriptszapashcanon
2018-04-03merge-pr.sh: cache github API callsGaëtan Gilbert
2018-03-23improve merge-pr scriptEnrico Tassi
The script now performs many more checks and reports errors in a more intelligible way.
2018-01-16merge-pr.sh: use git diff --quietGaëtan Gilbert
2018-01-16Cleanup shell expansions and quoting.Gaëtan Gilbert
2017-11-29This script apparently uses bash-specific features.Théo Zimmermann
2017-11-29Fix PR merge script.Théo Zimmermann
Was still relying on the existence of user-configured /pr/.
2017-11-28Add PR merge script.Maxime Dénès