diff --git a/ydb/ci/rightlib/increment.sh b/ydb/ci/rightlib/increment.sh index 6d799e48b688..7d0fc038d90c 100755 --- a/ydb/ci/rightlib/increment.sh +++ b/ydb/ci/rightlib/increment.sh @@ -1,26 +1,18 @@ -# Usage: cherrypick.sh -# Expects previous github SHA in /library_import.txt -# Will loop through the commits in the source repo after previous SHA, and cherry-pick is to the target. +# Usage: cherrypick.sh +# Expects previous github SHA in /library_import.txt +# Reads new commits from the 'rightlib' branch, cheery-picks them to a new branch, and creates PR set -e set -o pipefail -LIB_ROOT=$1 -if [ -z "${LIB_ROOT}" ]; then - echo "Source lib root must be provided as a first free arg" +ROOT=$1 +if [ -z "${ROOT}" ]; then + echo "YDB repo root must be provided as a first free arg" exit 1 fi -echo "Source library root: ${LIB_ROOT}" -newsha=$(cd ${LIB_ROOT} && git rev-parse HEAD) -echo "Source current commit sha: $newsha" +echo "YDB repo root: ${ROOT}" -MAIN_ROOT=$2 -if [ -z "${MAIN_ROOT}" ]; then - echo "Target main root must be provided as a second free arg" - exit 1 -fi -echo "Target Main root: ${MAIN_ROOT}" -shapath="${MAIN_ROOT}/library_import.txt" +shapath="${ROOT}/library/rightlib_sha.txt" prevsha=$(cat ${shapath}) || true if [ -z "${prevsha}" ]; then echo "File ${shapath} not found, which must contain previous completed import commit SHA" @@ -28,10 +20,13 @@ if [ -z "${prevsha}" ]; then fi echo "Previous sha: ${prevsha}" -list=$(cd ${LIB_ROOT} && git log ${prevsha}..HEAD --pretty=oneline --no-decorate | awk '{print $1}') +newsha=$(cd ${ROOT} && git rev-parse rightlib) +echo "Rightlib current commit sha: $newsha" + +list=$(cd ${ROOT} && git log ${prevsha}..rightlib --reverse --pretty=oneline --no-decorate | awk '{print $1}') for sha in $list;do echo $sha - (cd ${MAIN_ROOT} && git --git-dir=${LIB_ROOT}/.git format-patch -k -1 --stdout $sha | git am -3 -k) + (cd ${ROOT} && git cherry-pick $sha) echo "---" done diff --git a/ydb/ci/rightlib/squash.sh b/ydb/ci/rightlib/squash.sh index 0309a6f50ab5..bf87950d2fce 100755 --- a/ydb/ci/rightlib/squash.sh +++ b/ydb/ci/rightlib/squash.sh @@ -1,4 +1,4 @@ -# Usage: increment.sh +# Usage: squash.sh set -e set -o pipefail