diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:47:08 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:47:08 +0000 |
commit | 29b5ab554790bb57337a3b6ab9dcd963cf69d22e (patch) | |
tree | be1456d2bc6c1fb078695fad7bc8f6b212062d3c /script/backport.sh | |
parent | Initial commit. (diff) | |
download | libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.tar.xz libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.zip |
Adding upstream version 1.7.2+ds.upstream/1.7.2+ds
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'script/backport.sh')
-rwxr-xr-x | script/backport.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/script/backport.sh b/script/backport.sh new file mode 100755 index 0000000..3c2f899 --- /dev/null +++ b/script/backport.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if test $# -eq 0 +then + echo "USAGE: $0 <#PR> [<#PR>...]" + exit +fi + +commits= + +for pr in $* +do + mergecommit=$(git rev-parse ":/Merge pull request #$pr" || exit 1) + mergebase=$(git merge-base "$mergecommit"^1 "$mergecommit"^2 || exit 1) + + commits="$commits $(git rev-list --reverse "$mergecommit"^2 ^"$mergebase")" +done + +echo "Cherry-picking the following commits:" +git rev-list --no-walk --oneline $commits +echo + +git cherry-pick $commits |