-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry pick commits sorting by position
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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" | ||
|