Compare commits

..

5 Commits

Author SHA1 Message Date
obel1x cc10fb5b48 Merge pull request 'sync_client_software: depth=1 fetch, clean from repo root; gitignore cleanup' (#25) from unbrot/fedora-OEMDRV:main into main
Reviewed-on: #25
2026-05-04 19:49:39 +02:00
Daniel unbrot Pätzold 83c25cd45d include *.bak in config dirs to gitignore 2026-05-04 19:40:42 +02:00
Daniel unbrot Pätzold d62d0038e6 gitignore: removed double line 2026-05-04 19:35:38 +02:00
Daniel unbrot Pätzold a3c95ab146 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 <noreply@anthropic.com>
2026-05-04 19:29:08 +02:00
Daniel unbrot Pätzold 1ac952c094 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 <noreply@anthropic.com>
2026-05-04 19:29:08 +02:00
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -4,11 +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/.sync_*.db
config.d/*.conf
config.d/*.sys
config.d/*.bak
ks_pc_prof/*
ks.cfg
+2 -2
View File
@@ -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 -C "${SYSCONFIGPATH}" clean -fd && git gc --prune=now --quiet
if [[ $? -ne 0 ]]; then
echo "Error: Failure while updating, will continue as is."
fi