From 1ac952c09464f46711eeeb64fc8c7e2d72cfdbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 4 May 2026 18:56:33 +0200 Subject: [PATCH 1/4] sync_client_software: fetch depth=1 and clean untracked files on upgrade Replace the broken `git rebase HEAD^` with a proper shallow fetch: - `git fetch --depth=1` limits local history to one commit, regardless of server history - `git reset --hard FETCH_HEAD` syncs the working tree to the fetched tip - `git clean -fd` removes untracked non-ignored files left by old versions - `git gc --prune=now` immediately purges unreachable history objects Co-Authored-By: Claude Sonnet 4.6 --- system_setup/sync_client_software.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index bc19f3f..ca4f685 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -51,8 +51,8 @@ if [[ ! -z "${REPO_URL}" ]]; then else # Doing upgrade, discarding all local changes frist (is more save than forced pull) echo "Checks have passed, we are now upgrading via git." - #Fetch latest Updates and remove all history - git fetch origin && git reset --hard origin/${REPO_BRANCH} && git rebase HEAD^ + #Fetch latest commit only (depth=1), reset working tree, purge old history and untracked files + git fetch --depth=1 origin ${REPO_BRANCH} && git reset --hard FETCH_HEAD && git clean -fd && git gc --prune=now --quiet if [[ $? -ne 0 ]]; then echo "Error: Failure while updating, will continue as is." fi From a3c95ab146a3c5f4a9ee716e09c818b10cb53236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 4 May 2026 19:22:56 +0200 Subject: [PATCH 2/4] sync_client_software: run git clean from repo root git clean -fd scopes to the current directory and below, so running it from the system_setup/ subdirectory missed untracked files in sibling dirs like config/. Use -C "${SYSCONFIGPATH}" to always clean from the repo root regardless of invocation directory. Co-Authored-By: Claude Sonnet 4.6 --- system_setup/sync_client_software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index ca4f685..7a44ed1 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -52,7 +52,7 @@ if [[ ! -z "${REPO_URL}" ]]; then # Doing upgrade, discarding all local changes frist (is more save than forced pull) echo "Checks have passed, we are now upgrading via git." #Fetch latest commit only (depth=1), reset working tree, purge old history and untracked files - git fetch --depth=1 origin ${REPO_BRANCH} && git reset --hard FETCH_HEAD && git clean -fd && git gc --prune=now --quiet + git fetch --depth=1 origin ${REPO_BRANCH} && git reset --hard FETCH_HEAD && git -C "${SYSCONFIGPATH}" clean -fd && git gc --prune=now --quiet if [[ $? -ne 0 ]]; then echo "Error: Failure while updating, will continue as is." fi From d62d0038e667c605db7074cb2b40f62660917d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 4 May 2026 19:35:38 +0200 Subject: [PATCH 3/4] gitignore: removed double line --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index e1390fd..c26c394 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ config/setup_system.conf config/setup_system.conf.bak config/skel.tar.zst config/.sync_*.db -config/.sync_*.db config.d/*.conf config.d/*.sys ks_pc_prof/* From 83c25cd45dbdfc18391e4924b8e863db1c904b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 4 May 2026 19:40:42 +0200 Subject: [PATCH 4/4] include *.bak in config dirs to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c26c394..ea0f5de 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,11 @@ client_software/.sync_*.db client_software/setup_system.conf config/setup_system.conf -config/setup_system.conf.bak +config/*.bak config/skel.tar.zst config/.sync_*.db config.d/*.conf config.d/*.sys +config.d/*.bak ks_pc_prof/* ks.cfg