This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new 650629faeed Add script to apply a change in versioned_docs to all
maintained docs
650629faeed is described below
commit 650629faeedf68e4438efe7c98ff8495480cc7e0
Author: Lari Hotari <[email protected]>
AuthorDate: Mon May 4 11:40:10 2026 +0300
Add script to apply a change in versioned_docs to all maintained docs
---
scripts/docs-tool.sh | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/scripts/docs-tool.sh b/scripts/docs-tool.sh
index 0258c4ca326..059c8806a49 100755
--- a/scripts/docs-tool.sh
+++ b/scripts/docs-tool.sh
@@ -90,6 +90,35 @@ function docs_apply_changes_to_versioned_docs() {
)
}
+function docs_apply_version_doc_change_to_docs() {
+ (
+ if [[ "$1" == "--desc" || "$1" == "--help" ]]; then
+ echo "Applies committed changes made to a versioned docs directory
between current branch and upstream main to docs/ and all maintained versioned
docs"
+ if [ "$1" == "--help" ]; then
+ echo "usage: $0 apply_version_doc_change_to_docs <version>"
+ echo " e.g. $0 apply_version_doc_change_to_docs 3.3.x"
+ fi
+ return 0
+ fi
+ local version="${1:?Version is required (e.g., 3.3.x)}"
+ shift
+ _cd_git_root
+ local source_dir="versioned_docs/version-${version}"
+ if [ ! -d "$source_dir" ]; then
+ echo "Source directory $source_dir does not exist"
+ return 1
+ fi
+ local patchfile
+ patchfile=$(mktemp)
+ git diff -u "$(git merge-base HEAD "$UPSTREAM/main")" -- "$source_dir" \
+ | sed "s|versioned_docs/version-${version}/|docs/|g" \
+ > "$patchfile"
+ echo "Applying patch to docs/"
+ (cd docs && patch -f -N -V none -p2 < "$patchfile") || echo "Failed to
apply patch to docs/"
+ docs_apply_patch_to_versioned_docs "$patchfile" "$@"
+ )
+}
+
function docs_delete_patch_backups() {
(
if [[ "$1" == "--desc" || "$1" == "--help" ]]; then