Commit 26fbbb03 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Jim Harris
Browse files

backport.sh: filter commits to backport from -rc1 to latest master



*-rc1 patch shall always be the splitting point for
the release branch - tip of the branch. No need to include it,
thus '^' was removed.

Meanwhile the reason to fetch right before, was to make sure
that we have list of commits up to latest master. Use origin/master
instead of HEAD. Although it is doubtful to make a difference,
we pulled at the begining of the script anyway.

Change-Id: I2dd5cd162440fefa11abf3b78208af24ad607295
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26062


Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
parent 2dcabc7c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -38,13 +38,14 @@ function display_help() {
	./scripts/backport.sh -u gerrit_user -t 23.05 -d ./backports"
}

# Reorder commits in their merge order, filter the list starting after *-rc1 commit to latest
function reorder_commits() {
	local unordered_list=$1
	local from="v${HASHTAG}-rc1"

	git -C "$SPDK_DIR" fetch origin
	# Reorder commits to how they were merged to master
	git -C "$SPDK_DIR" show -s --format="%H" "$from^..HEAD" | tac > "$TMP_DIR/ordered_commits"
	git -C "$SPDK_DIR" show -s --format="%H" "$from..origin/master" | tac > "$TMP_DIR/ordered_commits"

	mapfile -t u < "$unordered_list"
	mapfile -t o < "$TMP_DIR/ordered_commits"