
#104: accept only backports into stable branches ---------------------+------------------------ Reporter: danken | Owner: infra@… Type: task | Status: new Priority: major | Milestone: oVirt 3.4 Component: Jenkins | Version: Severity: High | Resolution: Keywords: | Blocked By: Blocking: | ---------------------+------------------------ Comment (by ekohl): It is slightly inconvenient that at least for ovirt-engine there are branches and tags with the same name. That said, a start: {{{ #!sh CHANGE_ID=$(git show | awk '/Change-Id:/ { print $2 }') if [ -n "$CHANGE_ID" ] ; then CONTROLLER=$(git symbolic-ref --short HEAD | sed 's|^heads/\(.\+\)\.[0-9]\+|\1|') CONTROLLER_BRANCH=$(git rev-parse --verify --verify origin/$CONTROLLER 2> /dev/null) OUTPUT=$(git log ${CONTROLLER_BRANCH:-master} --oneline --grep ="Change-Id: $CHANGE_ID") if [ -n "$OUTPUT" ] ; then echo "Change-Id $CHANGE_ID found in $OUTPUT" else echo "Change-Id $CHANGE_ID not found in ${CONTROLLER_BRANCH:-master}!" exit 1 fi else echo "No Change-Id found" fi }}} It needs a check for {{{Label: $BRANCH-only}}} and I'm not yet sure how we reliably check all commits are valid without checking all commits every time. Maybe we can use {{{git log master..HEAD}}}, or was it {{{...}}} for the strictly only in HEAD but not in master? -- Ticket URL: <https://fedorahosted.org/ovirt/ticket/104#comment:1> ovirt <http://www.ovirt.org/> oVirt - virtualization made easy.