Skip to content

Commit d84c874

Browse files
Cherry-pick commits from right lib (#1176)
1 parent 3660e0d commit d84c874

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

ydb/ci/rightlib/increment.sh

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
# Usage: cherrypick.sh <source_ydblib_repo_root> <target_ydb_repo_root>
2-
# Expects previous github SHA in <target_ydb_repo_root>/library_import.txt
3-
# Will loop through the commits in the source repo after previous SHA, and cherry-pick is to the target.
1+
# Usage: cherrypick.sh <ydb_repo_root>
2+
# Expects previous github SHA in <ydb_repo_root>/library_import.txt
3+
# Reads new commits from the 'rightlib' branch, cheery-picks them to a new branch, and creates PR
44

55
set -e
66
set -o pipefail
77

8-
LIB_ROOT=$1
9-
if [ -z "${LIB_ROOT}" ]; then
10-
echo "Source lib root must be provided as a first free arg"
8+
ROOT=$1
9+
if [ -z "${ROOT}" ]; then
10+
echo "YDB repo root must be provided as a first free arg"
1111
exit 1
1212
fi
13-
echo "Source library root: ${LIB_ROOT}"
14-
newsha=$(cd ${LIB_ROOT} && git rev-parse HEAD)
15-
echo "Source current commit sha: $newsha"
13+
echo "YDB repo root: ${ROOT}"
1614

17-
MAIN_ROOT=$2
18-
if [ -z "${MAIN_ROOT}" ]; then
19-
echo "Target main root must be provided as a second free arg"
20-
exit 1
21-
fi
22-
echo "Target Main root: ${MAIN_ROOT}"
23-
shapath="${MAIN_ROOT}/library_import.txt"
15+
shapath="${ROOT}/library/rightlib_sha.txt"
2416
prevsha=$(cat ${shapath}) || true
2517
if [ -z "${prevsha}" ]; then
2618
echo "File ${shapath} not found, which must contain previous completed import commit SHA"
2719
exit 1
2820
fi
2921
echo "Previous sha: ${prevsha}"
3022

31-
list=$(cd ${LIB_ROOT} && git log ${prevsha}..HEAD --pretty=oneline --no-decorate | awk '{print $1}')
23+
newsha=$(cd ${ROOT} && git rev-parse rightlib)
24+
echo "Rightlib current commit sha: $newsha"
25+
26+
list=$(cd ${ROOT} && git log ${prevsha}..rightlib --reverse --pretty=oneline --no-decorate | awk '{print $1}')
3227
for sha in $list;do
3328
echo $sha
34-
(cd ${MAIN_ROOT} && git --git-dir=${LIB_ROOT}/.git format-patch -k -1 --stdout $sha | git am -3 -k)
29+
(cd ${ROOT} && git cherry-pick $sha)
3530
echo "---"
3631
done
3732

ydb/ci/rightlib/squash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Usage: increment.sh <source_ydblib_repo_root> <target_ydb_repo_root>
1+
# Usage: squash.sh <source_ydblib_repo_root> <target_ydb_repo_root>
22

33
set -e
44
set -o pipefail

0 commit comments

Comments
 (0)