[Update] bulk update

This commit is contained in:
2026-09-17 20:45:06 +02:00
committed by Coja
parent 3ec2503f38
commit ed7e34552d
158 changed files with 3258 additions and 2419 deletions
+42 -10
View File
@@ -9,18 +9,27 @@
#
# dotsync pull, then relink only if the file set changed
# dotsync -n preview incoming changes (fetch only; no pull, no relink)
# dotsync <host> as above, forcing the host package (normally unnecessary: install.sh
# reuses the host recorded in ~/.config/dots-host)
set -uo pipefail
DOTS="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." && pwd)"
cd "$DOTS" || exit 1
if [ "${1:-}" = "-n" ] || [ "${1:-}" = "--dry-run" ]; then
git fetch -q 2>/dev/null || { echo "fetch failed (offline?)"; exit 1; }
up="$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null)" || { echo "no upstream set"; exit 1; }
git fetch -q 2>/dev/null || {
echo "fetch failed (offline?)"
exit 1
}
up="$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null)" || {
echo "no upstream set"
exit 1
}
# rev-list, not diff: a plain diff also fires when the LOCAL side is ahead, mislabelling
# your own unpushed commits as incoming. Count commits that exist only on the upstream.
n="$(git rev-list --count "HEAD..$up")"
if [ "$n" -eq 0 ]; then echo "already up to date with $up."; else
echo "incoming from $up ($n commit(s)):"; git --no-pager diff --stat "HEAD...$up"
echo "incoming from $up ($n commit(s)):"
git --no-pager diff --stat "HEAD...$up"
fi
exit 0
fi
@@ -40,7 +49,7 @@ fi
# Services that read config ONCE at startup don't pick up pulled edits — nudge loudly.
# (Symlinked edits are live for everything else; these are the exceptions that bit us.)
if git diff --name-only "$before" "$after" | grep -q '\.config/llamacpp/' \
&& systemctl cat llama.service &>/dev/null; then
&& systemctl cat llama.service &>/dev/null; then
echo ""
echo "⚠⚠ llamacpp presets changed — the router reads them only at startup. Apply with:"
echo " sudo systemctl restart llama.service"
@@ -49,18 +58,41 @@ fi
# A unit file is read from /etc, not through the stow symlink — needs daemon-reload as well.
if git diff --name-only "$before" "$after" | grep -q '\.config/whisper/' \
&& systemctl cat whisper.service &>/dev/null; then
&& systemctl cat whisper.service &>/dev/null; then
echo ""
echo "⚠⚠ whisper unit changed — apply with:"
echo " sudo systemctl daemon-reload && sudo systemctl restart whisper.service"
echo ""
fi
# Modified files (M) are already live through the symlinks. Only Added/Deleted/Renamed
# need (un)linking, which is the only case that justifies the churny re-stow.
if git diff --name-status "$before" "$after" | grep -qE '^(A|D|R)'; then
echo "files added/removed/renamed — re-linking via install.sh (this may reload some apps)…"
exec "$DOTS/install.sh"
# Modified files (M) are live only through INTACT symlinks — a live file severed by an
# atomic rewrite (the recurring claude/settings.json class) swallows pulled edits silently,
# so verify that premise per modified file instead of assuming it. Added/Deleted/Renamed
# always need (un)linking. The diff is captured once, not piped into `grep -q`: its early
# exit can SIGPIPE git under pipefail and turn the whole condition falsely negative.
changes="$(git diff --name-status "$before" "$after")"
need_restow=""
if printf '%s\n' "$changes" | grep -qE '^(A|D|R)'; then
need_restow="files added/removed/renamed"
else
# map each modified repo path (package/.dotpath) to its live counterpart; a real file
# (not a symlink) sitting there means the pulled edit did NOT land
while IFS= read -r rel; do
live="$HOME/$rel"
if [ -e "$live" ] && [ ! -L "$live" ]; then
echo "note: ~/$rel is a real file, not a symlink into the repo — the pulled edit has NOT landed there."
need_restow="severed symlink(s)"
fi
done < <(printf '%s\n' "$changes" | awk -F'\t' '$1 ~ /^M/ && $2 ~ /^[^\/]+\/\./ { sub(/^[^\/]+\//, "", $2); print $2 }')
fi
if [ -n "$need_restow" ]; then
echo "$need_restow — re-linking via install.sh (this may reload some apps)…"
# Normally called with no argument, so install.sh resolves the host from ~/.config/dots-host —
# the one recorded by the last install.sh run here. That is exactly why the host must not be
# derived from `hostname -s`: this path is automatic and has nothing to pass. An explicit
# `dotsync <host>` is forwarded through for the rare override.
exec "$DOTS/install.sh" "$@"
else
echo "edits only — already live through the symlinks; no re-stow, no reload needed."
fi