@@ -29,6 +29,7 @@ cd "${KUBE_ROOT}"
2929declare -r STARTINGBRANCH=$( git symbolic-ref --short HEAD)
3030declare -r REBASEMAGIC=" ${KUBE_ROOT} /.git/rebase-apply"
3131DRY_RUN=${DRY_RUN:- " " }
32+ REGENERATE_DOCS=${REGENERATE_DOCS:- " " }
3233UPSTREAM_REMOTE=${UPSTREAM_REMOTE:- upstream}
3334FORK_REMOTE=${FORK_REMOTE:- origin}
3435
@@ -54,6 +55,9 @@ if [[ "$#" -lt 2 ]]; then
5455 echo " This is useful for creating patches to a release branch without making a PR."
5556 echo " When DRY_RUN is set the script will leave you in a branch containing the commits you cherry-picked."
5657 echo
58+ echo " Set the REGENERATE_DOCS environment var to regenerate documentation for the target branch after picking the specified commits."
59+ echo " This is useful when picking commits containing changes to API documentation."
60+ echo
5761 echo " Set UPSTREAM_REMOTE (default: upstream) and FORK_REMOTE (default: origin)"
5862 echo " To override the default remote names to what you have locally."
5963 exit 2
@@ -184,12 +188,14 @@ done
184188gitamcleanup=false
185189
186190# Re-generate docs (if needed)
187- echo
188- echo " Regenerating docs..."
189- if ! hack/generate-docs.sh; then
191+ if [[ -n " ${REGENERATE_DOCS} " ]]; then
190192 echo
191- echo " hack/generate-docs.sh FAILED to complete."
192- exit 1
193+ echo " Regenerating docs..."
194+ if ! hack/generate-docs.sh; then
195+ echo
196+ echo " hack/generate-docs.sh FAILED to complete."
197+ exit 1
198+ fi
193199fi
194200
195201if [[ -n " ${DRY_RUN} " ]]; then
0 commit comments