sync: auto-sync from GURU-KALI at 2026-05-31 07:40:31
Author: Mike Swanson Machine: GURU-KALI Timestamp: 2026-05-31 07:40:31
This commit is contained in:
@@ -269,7 +269,12 @@ echo "=== Phase 2: Fetch + inspect ==="
|
|||||||
LOCAL_BEFORE=$(git rev-parse HEAD)
|
LOCAL_BEFORE=$(git rev-parse HEAD)
|
||||||
|
|
||||||
echo -e "${GREEN}[OK]${NC} Fetching from origin..."
|
echo -e "${GREEN}[OK]${NC} Fetching from origin..."
|
||||||
git fetch origin --quiet
|
# --no-recurse-submodules: parent fetch must NOT implicitly recurse. A transient
|
||||||
|
# dead gitlink in incoming parent history (force-pushed-out submodule commit)
|
||||||
|
# would otherwise abort the whole sync under `set -e`. Phase 1a already advanced
|
||||||
|
# submodules to their remote tips; a post-rebase `git submodule update` reconciles
|
||||||
|
# them to the new parent pointers.
|
||||||
|
git fetch origin --quiet --no-recurse-submodules
|
||||||
|
|
||||||
LOCAL=$(git rev-parse HEAD)
|
LOCAL=$(git rev-parse HEAD)
|
||||||
REMOTE=$(git rev-parse origin/main 2>/dev/null || git rev-parse origin/master 2>/dev/null || echo "$LOCAL")
|
REMOTE=$(git rev-parse origin/main 2>/dev/null || git rev-parse origin/master 2>/dev/null || echo "$LOCAL")
|
||||||
@@ -330,12 +335,25 @@ fi
|
|||||||
if [ "$INCOMING_COUNT" -gt 0 ]; then
|
if [ "$INCOMING_COUNT" -gt 0 ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== Phase 3: Pull (rebase) ==="
|
echo "=== Phase 3: Pull (rebase) ==="
|
||||||
if git pull origin main --rebase; then
|
# --no-recurse-submodules: same reason as the fetch above — don't let a
|
||||||
|
# dead submodule ref in incoming history kill the parent rebase.
|
||||||
|
if git pull origin main --rebase --no-recurse-submodules; then
|
||||||
echo -e "${GREEN}[OK]${NC} Pulled successfully."
|
echo -e "${GREEN}[OK]${NC} Pulled successfully."
|
||||||
else
|
else
|
||||||
echo -e "${RED}[ERROR]${NC} Pull failed (likely conflicts). Resolve and re-run sync."
|
echo -e "${RED}[ERROR]${NC} Pull failed (likely conflicts). Resolve and re-run sync."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Submodules may have advanced via the parent's gitlinks. Update them to match,
|
||||||
|
# but tolerate per-submodule failures (e.g., transient dead refs in history) —
|
||||||
|
# the working tree is still useful even if one submodule can't catch up.
|
||||||
|
set +e
|
||||||
|
git submodule update --init --recursive --quiet 2>&1 | grep -v '^$' || true
|
||||||
|
SUB_RC=${PIPESTATUS[0]}
|
||||||
|
set -e
|
||||||
|
if [ "$SUB_RC" -ne 0 ]; then
|
||||||
|
echo -e "${YELLOW}[WARNING]${NC} One or more submodules failed to update — likely a transient dead ref. Parent repo is current; investigate the submodule manually if a pointer is wrong."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Phase 4: Push (if needed)
|
# Phase 4: Push (if needed)
|
||||||
@@ -460,7 +478,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
VAULT_LOCAL_BEFORE=$(git rev-parse HEAD)
|
VAULT_LOCAL_BEFORE=$(git rev-parse HEAD)
|
||||||
git fetch origin --quiet
|
# --no-recurse-submodules: vault doesn't use submodules today, but stay
|
||||||
|
# consistent with the main-repo fetch so this script remains robust if that
|
||||||
|
# ever changes.
|
||||||
|
git fetch origin --quiet --no-recurse-submodules
|
||||||
|
|
||||||
VAULT_REMOTE_BRANCH="origin/main"
|
VAULT_REMOTE_BRANCH="origin/main"
|
||||||
if ! git rev-parse origin/main >/dev/null 2>&1; then
|
if ! git rev-parse origin/main >/dev/null 2>&1; then
|
||||||
@@ -473,7 +494,7 @@ else
|
|||||||
if [ "$VAULT_INCOMING" -gt 0 ]; then
|
if [ "$VAULT_INCOMING" -gt 0 ]; then
|
||||||
echo -e "${CYAN}--- Vault: $VAULT_INCOMING incoming commit(s) ---${NC}"
|
echo -e "${CYAN}--- Vault: $VAULT_INCOMING incoming commit(s) ---${NC}"
|
||||||
git log --oneline --format=' %C(yellow)%h%Creset %C(cyan)%an%Creset %s %C(dim)(%ar)%Creset' HEAD..$VAULT_REMOTE_BRANCH | head -10
|
git log --oneline --format=' %C(yellow)%h%Creset %C(cyan)%an%Creset %s %C(dim)(%ar)%Creset' HEAD..$VAULT_REMOTE_BRANCH | head -10
|
||||||
if git pull origin main --rebase; then
|
if git pull origin main --rebase --no-recurse-submodules; then
|
||||||
echo -e "${GREEN}[OK]${NC} Vault pulled."
|
echo -e "${GREEN}[OK]${NC} Vault pulled."
|
||||||
else
|
else
|
||||||
echo -e "${RED}[ERROR]${NC} Vault pull failed — resolve conflicts manually in $VAULT_PATH."
|
echo -e "${RED}[ERROR]${NC} Vault pull failed — resolve conflicts manually in $VAULT_PATH."
|
||||||
|
|||||||
Reference in New Issue
Block a user