diff --git a/.github/workflows/vib-scheduled-verify.yaml b/.github/workflows/vib-scheduled-verify.yaml index d530fa780045..71fc918d39c1 100644 --- a/.github/workflows/vib-scheduled-verify.yaml +++ b/.github/workflows/vib-scheduled-verify.yaml @@ -45,6 +45,8 @@ jobs: matrix: flavor: ${{ fromJSON(needs.get-container.outputs.flavors) }} steps: + - name: Install dependencies + run: pip install git-filter-repo==2.34.0 - uses: actions/checkout@v2 name: Checkout Repository with: diff --git a/scripts/sync.sh b/scripts/sync.sh index 65462e0f2502..72d87cb5d283 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -64,12 +64,12 @@ findCommitsToSync() { local max=100 # If we need to sync more than 100 commits there must be something wrong since we run the job on a daily basis # Get all commits IDs on the origin local commits=() - while IFS='' read -r line; do commits+=("$line"); done < <(git rev-list "${origin_name}/master" -- .) + # Get the revision list in topological order ignoring merge commits + while IFS='' read -r line; do commits+=("$line"); done < <(git rev-list --topo-order --no-merges "${origin_name}/master" -- .) for commit in "${commits[@]}"; do if [[ "$commit" != "$last_synced_commit_id" ]] && [[ "$max" -gt "0" ]]; then - actual_commit_id="$(plainCommit "${commit}")" - if [[ "$commit" != "$SKIP_COMMIT_ID" ]] && [[ ! $commits_to_sync =~ (^|[[:space:]])$actual_commit_id($|[[:space:]]) ]]; then - commits_to_sync="${actual_commit_id} ${commits_to_sync}" + if [[ "$commit" != "$SKIP_COMMIT_ID" ]]; then + commits_to_sync="${commit} ${commits_to_sync}" fi else # We reached the last commit synced @@ -82,16 +82,6 @@ findCommitsToSync() { echo "$commits_to_sync" } -plainCommit() { - local commit="${1:?Missing commit}" - local result="$commit" - actual_merge_commit_id="$(git log --pretty=%P -n 1 "$commit" | awk '{print $2}')" - if [[ -n "$actual_merge_commit_id" ]]; then - result="$(plainCommit "${actual_merge_commit_id}")" - fi - echo "$result" -} - syncCommit() { local -r commit_id="${1:?Missing commit id}" local -r app="${2:?Missing app name}" @@ -178,5 +168,4 @@ syncRepos() { pushChanges } -pip install git-filter-repo==2.34.0 syncRepos \ No newline at end of file