Skip to content

Commit

Permalink
cherry pick commits sorting by position
Browse files Browse the repository at this point in the history
  • Loading branch information
ivvist committed Jan 19, 2025
1 parent 7291950 commit 53ebedf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/cp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ if [ $lengthsha -eq 0 ]; then # Means pb3 wans to update voedger version
git config --local user.email "[email protected]"
git config --local user.name "upload-robot"
git config --global url.https://$github_token@github.com/.insteadOf https://github.com/

# if [[ "$branch" == "rc" ]]; then
# go get github.com/voedger/voedger@rc
# else
# go get github.com/voedger/voedger@release
# fi

go mod tidy
git commit -am "Cherry-pick auto-create" --allow-empty
git push origin $rc
Expand All @@ -89,11 +82,18 @@ fi
sorted_commits=""
# Loop through the hashes, get their commit dates, and sort them
# Capture the sorted hashes into a string variable
# sorted_commits=$(for commit in $commit_hashes; do
# # Get the commit date using %ci, output with commit hash
# commit_info=$(git show -s --format=%ci $commit)
# echo "$commit_info $commit"
# done | sort | awk '{print $4}')

sorted_commits=$(for commit in $commit_hashes; do
# Get the commit date using %ci, output with commit hash
commit_info=$(git show -s --format=%ci $commit)
echo "$commit_info $commit"
done | sort | awk '{print $4}')
# Get the commit date and position (line number in rev-list) for each commit
commit_date=$(git show -s --format=%ci $commit)
commit_position=$(git rev-list --reverse $SOURCE_BRANCH | grep -n "^$commit$" | cut -d: -f1)
echo "$commit_date $commit_position $commit"
done | sort -k1,2 | awk '{print $3}')

SCRIPT_DIR="$(dirname "$(realpath "$0")")"
echo "The script directory is: $SCRIPT_DIR"
Expand Down

0 comments on commit 53ebedf

Please sign in to comment.