Implement git pull --rebase --autostash in sync-vps-repos.sh and run-vps-data-production.sh for non-destructive bidirectional telemetry reconciliation
This commit is contained in:
1 parent
5625e287f5
commit
51f4a59e26
3 files changed
+5
-15
No files matched your search
@@ -111,20 +111,9 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
|
||||
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then
|
||||
remote_name="downstream"
|
||||
fi
|
||||
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch})..."
|
||||
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch}) with autostash rebase..."
|
||||
prev_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
|
||||
run_checked "git fetch ${repo}" git -C "${REPOS_ROOT}/${repo}" fetch --force "${remote_name}" "${branch}" --tags
|
||||
git -C "${REPOS_ROOT}/${repo}" reset HEAD -- README.md || true
|
||||
git -C "${REPOS_ROOT}/${repo}" checkout -- README.md || true
|
||||
if [[ -n "$(git -C "${REPOS_ROOT}/${repo}" ls-files financial-aq-harvest-latest.json)" ]]; then
|
||||
if ! git -C "${REPOS_ROOT}/${repo}" diff --quiet -- financial-aq-harvest-latest.json 2>&1; then
|
||||
git -C "${REPOS_ROOT}/${repo}" checkout -- financial-aq-harvest-latest.json || true
|
||||
fi
|
||||
fi
|
||||
if [[ "${repo}" == "${CI_REPO_DIR}" || "${repo}" == "ingglish-hyperdope-gematria" || "${repo}" == "encyclopedia-knowledge-graph" ]] && ! git -C "${REPOS_ROOT}/${repo}" diff --quiet 2>&1; then
|
||||
git -C "${REPOS_ROOT}/${repo}" checkout -- . || true
|
||||
fi
|
||||
run_checked "git merge ${repo}" git -C "${REPOS_ROOT}/${repo}" merge --ff-only "${remote_name}/${branch}"
|
||||
run_checked "git pull --rebase --autostash ${repo}" git -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}"
|
||||
new_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
|
||||
if [[ "${repo}" == "hyperstitionstudio-core" && "${prev_head}" != "${new_head}" && -z "${HYPERSTITION_SYNC_REEXEC:-}" ]]; then
|
||||
echo "[1/5] hyperstitionstudio-core updated (${prev_head:0:7} -> ${new_head:0:7}); re-executing updated sync-vps-repos.sh..."
|
||||
|
||||
Reference in new issue
Block a user