From 319685958fd7e4475770f79828c5e4c220b76467 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 25 Feb 2020 17:14:24 +0100 Subject: Print the most recent PRs, but newest last --- git-merge-pr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-merge-pr b/git-merge-pr index cffde3a..2d11511 100755 --- a/git-merge-pr +++ b/git-merge-pr @@ -18,9 +18,9 @@ PROJECT=${PROJECT#//github.com/} if [ -z "$PR" ]; then wget -q -O- --header 'Accept: application/json' \ - "https://api.github.com/repos/${PROJECT}/pulls?direction=asc" | + "https://api.github.com/repos/${PROJECT}/pulls" | jq -r 'if length > 0 - then .[] | "\(.number) <\(.user.login)> \(.title)" + then reverse[] | "\(.number) <\(.user.login)> \(.title)" else "No open pull requests." end' exit $? else -- cgit 1.4.1