]> git.proxmox.com Git - libgit2.git/blame - script/backport.sh
Update upstream source from tag 'upstream/1.0.1+dfsg.1'
[libgit2.git] / script / backport.sh
CommitLineData
ac3d33df
JK
1#!/bin/sh
2
3if test $# -eq 0
4then
5 echo "USAGE: $0 <#PR> [<#PR>...]"
6 exit
7fi
8
9commits=
10
11for pr in $*
12do
13 mergecommit=$(git rev-parse ":/Merge pull request #$pr" || exit 1)
14 mergebase=$(git merge-base "$mergecommit"^1 "$mergecommit"^2 || exit 1)
15
16 commits="$commits $(git rev-list --reverse "$mergecommit"^2 ^"$mergebase")"
17done
18
19echo "Cherry-picking the following commits:"
20git rev-list --no-walk --oneline $commits
21echo
22
23git cherry-pick $commits