Skip to content

Commit

Permalink
scripts: allow explicit downstream carries
Browse files Browse the repository at this point in the history
We have code in this repository that is explicitly added as long-term
carries in the staging directory. This commit allows labeling those
carries and not failing on them.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
  • Loading branch information
stevekuznetsov committed Aug 15, 2023
1 parent 6559b84 commit 4127d28
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/verify_commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ function verify_downstream_only() {
local inside_staging
inside_staging="$(git show --name-only "${downstream_commit}" -- staging)"
if [[ -n "${inside_staging}" ]]; then
err "downstream non-staging commit ${downstream_commit} changes staging"
if git log -n 1 "${downstream_commit}" --pretty=%s | grep -q '[CARRY]'; then
return 0
fi
err "downstream non-staging commit ${downstream_commit} changes staging and is not labeled [CARRY]"
err "${inside_staging}"
err "only staging commits (i.e. from an upstream cherry-pick) may change staging"
err "only staging commits (i.e. from an upstream cherry-pick) or commits labeled as downstream carries with [CARRY] may change staging"
return 1
fi
}
Expand Down

0 comments on commit 4127d28

Please sign in to comment.