From b1744003cb4a0eac5fbea609c52007d334141dd6 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:52:14 +0200 Subject: [PATCH] inline functions (#44) --- ci/clang-report.sh | 1 - ci/common/doc.sh | 19 ------------------- ci/doc-index.sh | 1 - ci/pvs-report.sh | 1 - ci/truncate-history.sh | 19 ++++++++++++++++++- ci/user-docu.sh | 1 - ci/vimpatch-report.sh | 1 - 7 files changed, 18 insertions(+), 25 deletions(-) delete mode 100644 ci/common/doc.sh diff --git a/ci/clang-report.sh b/ci/clang-report.sh index e10fa2a689e3..eb6a696a71d9 100755 --- a/ci/clang-report.sh +++ b/ci/clang-report.sh @@ -4,7 +4,6 @@ set -o pipefail BUILD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source "$BUILD_DIR/ci/common/common.sh" -source "$BUILD_DIR/ci/common/doc.sh" source "$BUILD_DIR/ci/common/html.sh" source "$BUILD_DIR/ci/common/badge.sh" diff --git a/ci/common/doc.sh b/ci/common/doc.sh deleted file mode 100644 index 6d4c9a8c6054..000000000000 --- a/ci/common/doc.sh +++ /dev/null @@ -1,19 +0,0 @@ -# Functions for automating the https://github.com/neovim/doc/ repository. - -require_environment_variable BUILD_DIR "${BASH_SOURCE[0]}" ${LINENO} - -DOC_DIR=${DOC_DIR:-${BUILD_DIR}/build/doc} -DOC_REPO=${DOC_REPO:-neovim/doc} -DOC_BRANCH=${DOC_BRANCH:-gh-pages} - -# Trim the https://github.com/neovim/doc/ repository history, els it gets huge -# and slow to clone. We don't care about the history of the `gh-pages` branch. -try_truncate_history() { - cd "${DOC_DIR}" || { log_error "try_truncate_history: cd failed"; exit 1; } - local branch=gh-pages - if NEW_ROOT=$(2>/dev/null git rev-parse "$branch"~101) ; then - git_truncate "$branch" "$branch"~100 - else - log_info "try_truncate_history: branch ${branch} has too few commits, skipping truncate" - fi -} diff --git a/ci/doc-index.sh b/ci/doc-index.sh index 4e243ac56d4f..61107aba754a 100755 --- a/ci/doc-index.sh +++ b/ci/doc-index.sh @@ -6,7 +6,6 @@ set -u readonly BUILD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source "${BUILD_DIR}/ci/common/common.sh" -source "${BUILD_DIR}/ci/common/doc.sh" generate_doc_index() { echo "Updating doc folder from file-list.txt" diff --git a/ci/pvs-report.sh b/ci/pvs-report.sh index f7d6ba282afe..3b2f62b486e7 100755 --- a/ci/pvs-report.sh +++ b/ci/pvs-report.sh @@ -10,7 +10,6 @@ shopt -s dotglob readonly BUILD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source "$BUILD_DIR/ci/common/common.sh" -source "$BUILD_DIR/ci/common/doc.sh" source "$BUILD_DIR/ci/common/html.sh" source "$BUILD_DIR/ci/common/badge.sh" diff --git a/ci/truncate-history.sh b/ci/truncate-history.sh index 08cd9de3e4dc..78bb7f6f8714 100755 --- a/ci/truncate-history.sh +++ b/ci/truncate-history.sh @@ -4,6 +4,23 @@ set -o pipefail BUILD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source "$BUILD_DIR/ci/common/common.sh" -source "$BUILD_DIR/ci/common/doc.sh" + +require_environment_variable BUILD_DIR "${BASH_SOURCE[0]}" ${LINENO} + +DOC_DIR=${DOC_DIR:-${BUILD_DIR}/build/doc} +DOC_REPO=${DOC_REPO:-neovim/doc} +DOC_BRANCH=${DOC_BRANCH:-gh-pages} + +# Trim the https://github.com/neovim/doc/ repository history, els it gets huge +# and slow to clone. We don't care about the history of the `gh-pages` branch. +try_truncate_history() { + cd "${DOC_DIR}" || { log_error "try_truncate_history: cd failed"; exit 1; } + local branch=gh-pages + if NEW_ROOT=$(2>/dev/null git rev-parse "$branch"~101) ; then + git_truncate "$branch" "$branch"~100 + else + log_info "try_truncate_history: branch ${branch} has too few commits, skipping truncate" + fi +} try_truncate_history diff --git a/ci/user-docu.sh b/ci/user-docu.sh index 54cbdf2c4c66..f81a6bfcd185 100755 --- a/ci/user-docu.sh +++ b/ci/user-docu.sh @@ -3,7 +3,6 @@ set -e BUILD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source ${BUILD_DIR}/ci/common/common.sh -source ${BUILD_DIR}/ci/common/doc.sh generate_user_docu() { require_environment_variable BUILD_DIR "${BASH_SOURCE[0]}" ${LINENO} diff --git a/ci/vimpatch-report.sh b/ci/vimpatch-report.sh index 29f87ce2f7f6..5295de2be6b7 100755 --- a/ci/vimpatch-report.sh +++ b/ci/vimpatch-report.sh @@ -4,7 +4,6 @@ set -e BUILD_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" export BUILD_DIR source ${BUILD_DIR}/ci/common/common.sh -source ${BUILD_DIR}/ci/common/doc.sh source ${BUILD_DIR}/ci/common/html.sh generate_vimpatch_report() {