diff --git a/.ci/create-changes-html.sh b/.ci/create-changes-html.sh index d061c725a68..80335ea1613 100755 --- a/.ci/create-changes-html.sh +++ b/.ci/create-changes-html.sh @@ -8,8 +8,6 @@ fi BASE_DOC_COMMIT="$1" DOC_REPOSITORY="$2" -# Wipe out chronic diffs between old doc and new doc -(cd $DOC_REPOSITORY && find . -name "*.html" | xargs sed -i -e '\;; d') # Create CHANGES.html echo '' > CHANGES.html echo '' >> CHANGES.html diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 2b75d84c97c..0e35de3ce09 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -150,7 +150,7 @@ jobs: git init && \ (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \ (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \ - git add -A && git commit --quiet -m "old") + git add -A && git commit --quiet -m 'old') - name: Build doc id: docbuild @@ -175,13 +175,16 @@ jobs: docker cp --follow-link BUILD:/sage/local/share/doc/sage/html doc docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html doc (cd doc && git commit -a -m 'new') - # Wipe out chronic diffs of new doc against old doc + # Wipe out chronic diffs of new doc against old doc before creating CHANGES.html (cd doc && \ find . -name "*.html" | xargs sed -i -e '/This is documentation for/ s/ built with GitHub PR .*. Doc/. Doc/' \ - -e '/;,\;; d' \ + && git commit -a -m 'wipe-out') + # Since HEAD is at commit 'wipe-out', HEAD~1 is commit 'new' (new doc), HEAD~2 is commit 'old' (old doc) + .ci/create-changes-html.sh $(cd doc && git rev-parse HEAD~2) doc + # Restore the new doc with changes made in create-changes-html.sh but dropping changes by "wipe out" + (cd doc && git stash -q && git checkout -q -f HEAD~1 && git stash pop -q) # Sometimes rm -rf .git errors out because of some diehard hidden files # So we simply move it out of the doc directory (cd doc && mv .git ../git && mv .gitattributes ../gitattributes)