|
26 | 26 |
|
27 | 27 | set -o errexit
|
28 | 28 | set -o pipefail
|
29 |
| -#set -x |
30 | 29 |
|
31 | 30 | ROOT_DIR=$(dirname "${BASH_SOURCE[@]}")/..
|
32 | 31 | # shellcheck disable=SC1091
|
@@ -63,6 +62,7 @@ function pop() {
|
63 | 62 | rc="${rcs[2]}"
|
64 | 63 | printf 'popping: %s\n' "${rc}"
|
65 | 64 |
|
| 65 | + # Cherrypick the commit |
66 | 66 | if ! git cherry-pick --allow-empty --keep-redundant-commits -Xsubtree="${subtree_dir}" "${rc}"; then
|
67 | 67 | # Always blast away the vendor directory given OLM/registry still commit it into source control.
|
68 | 68 | git rm -rf "${subtree_dir}"/vendor 2>/dev/null || true
|
@@ -122,34 +122,54 @@ function pop() {
|
122 | 122 | popd
|
123 | 123 | fi
|
124 | 124 |
|
125 |
| - # 1. Pop next commit off cherrypick set |
126 |
| - # 2. Cherry-pick |
127 |
| - # 3. Ammend commit |
128 |
| - # 4. Remove from cherrypick set |
| 125 | + # Update commit with make vendor |
129 | 126 | if ! make vendor; then
|
130 | 127 | echo ""
|
131 |
| - echo -e "Pausing script: ${RED}fix make vendor{$RESET}" |
| 128 | + echo -e "Pausing script: ${RED}fix (or ignore) make vendor{$RESET}" |
132 | 129 | echo "Use another terminal window"
|
133 |
| - echo -n '<ENTER> to continue, ^C to quit: ' |
| 130 | + echo -n '<ENTER> to update commit and continue, ^C to quit: ' |
134 | 131 | read
|
135 | 132 | fi
|
136 | 133 | git add "${subtree_dir}" "${ROOT_GENERATED_PATHS[@]}"
|
137 |
| - git status |
138 |
| - git commit --amend --allow-empty --no-edit --trailer "Upstream-repository: ${remote}" --trailer "Upstream-commit: ${rc}" |
139 |
| - if ! make manifests; then |
| 134 | + git commit --amend --allow-empty --no-edit |
| 135 | + |
| 136 | + # Update commit with make verify-manifests, this uses the proper OLM_VERSION |
| 137 | + if ! make verify-manifests; then |
140 | 138 | echo ""
|
141 | 139 | echo -e "Pausing script: ${RED}fix (or ignore) make manifests${RESET}"
|
142 | 140 | echo "Use another terminal window"
|
143 |
| - echo -n '<ENTER> to continue, ^C to quit: ' |
| 141 | + echo -n '<ENTER> to update commit and continue, ^C to quit: ' |
144 | 142 | read
|
145 | 143 | fi
|
146 | 144 | git add "${subtree_dir}" "${ROOT_GENERATED_PATHS[@]}"
|
147 |
| - git status |
148 | 145 | git commit --amend --allow-empty --no-edit
|
149 | 146 |
|
| 147 | + # Update commit with make verify-nested-vendor |
| 148 | + if ! make verify-nested-vendor; then |
| 149 | + echo "" |
| 150 | + echo -e "Pausing script: ${RED}fix make (or ignore) verify-nested-vendors${RESET}" |
| 151 | + echo "Use another terminal window" |
| 152 | + echo -n '<ENTER> to update commit and continue, ^C to quit: ' |
| 153 | + read |
| 154 | + fi |
| 155 | + git add "${subtree_dir}" "${ROOT_GENERATED_PATHS[@]}" |
| 156 | + git commit --amend --allow-empty --no-edit --trailer "Upstream-repository: ${remote}" --trailer "Upstream-commit: ${rc}" |
| 157 | + # need to add these trailers for make verify-commits |
| 158 | + |
| 159 | + # Remove from cherrypick set, now that the trailers are added, it's effectively complete |
150 | 160 | tmp_set=$(mktemp)
|
151 | 161 | tail -n +2 "${cherrypick_set}" > "${tmp_set}"; cat "${tmp_set}" > "${cherrypick_set}"
|
152 | 162 |
|
| 163 | + # Verify commit with make verify-commits - this should not error out |
| 164 | + if ! make verify-commits; then |
| 165 | + echo "" |
| 166 | + echo -e "Pausing script: ${RED}fix make verify-commits${RESET}" |
| 167 | + echo "Use another terminal window" |
| 168 | + echo -n '<ENTER> to continue, ^C to quit: ' |
| 169 | + read |
| 170 | + fi |
| 171 | + # At this point "make verify" would pass |
| 172 | + |
153 | 173 | # Note: handle edge case where there's zero remaining to avoid
|
154 | 174 | # returning a non-zero exit code.
|
155 | 175 | (( --remaining )) || true
|
|
0 commit comments