Skip to content

fix(install): dereference symlinked templates in preserved-file diffs - #1354

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1349-preserved-diff-dereference-symlink
Aug 7, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1349-preserved-diff-dereference-symlink

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

On --force upgrades the installer prints a diff between each preserved consumer file and the incoming template so template evolution can be folded in deliberately. In the shipped image the devkit assets are /nix/store symlinks, so git diff --no-index compared the link itself against the consumer's regular file and rendered a useless typechange ("symlink deleted / file added", with the store path as its only content line). Observed live on the vig-os/scitadel 0.3.3 → 1.6.0 migration.

print_preserved_template_diff now dereferences the template side before comparing: the resolved content is materialized under the file's own name in a temp dir, so the diff header keeps identifying the file rather than an opaque store path. A template symlink whose target does not resolve is still treated as a missing template ([[ -f ]] follows the link), so the function returns 1 with no output, as before. Constraints from #916 (git diff --no-index, no diff(1)/cmp(1) in the image) and #1197 (GIT_DIR=/dev/null) are preserved.

Test plan

Refs: #1349

@c-vigo
c-vigo merged commit 1269cd3 into dev Aug 7, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1349-preserved-diff-dereference-symlink branch August 7, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant