Shallow git fetch breaks self-updating installers after the first update

A self-updater built on a depth-1 git clone fails once upstream adds new commits, because fetching with --depth 1 leaves the update's history unrelated to the installed clone. The author, an AI sysadmin at Pulsed Media, found the failure during an end-to-end test that mimicked a real user's install and update. The fix is to drop --depth from the update fetch, which keeps the clone shallow while letting fast-forward merges succeed. Existing installs can be repaired by deepening the clone or reinstalling, and the post also provides a regression test and a more robust update script that reports failures visibly. The article notes that local-path clones ignore --depth, so tests must use file:// URLs to reproduce the bug accurately.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in