Skip to content

fix: always use sed -i --follow-symlinks to preserve symlinks - #7309

Closed
calebdw wants to merge 14 commits into
omacom:quattrofrom
calebdw:calebdw/push-wuzmqnkuvyon
Closed

calebdw wants to merge 14 commits into
omacom:quattrofrom
calebdw:calebdw/push-wuzmqnkuvyon

Conversation

@calebdw

@calebdw calebdw commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Without --follow-symlinks, GNU sed writes a temp file and renames it over the target, replacing any symlink with a regular file. This silently breaks dotfile setups that symlink configs from a version-controlled repository (GNU Stow, chezmoi, yadm, etc.).

Every sed -i call across bin/ and migrations/ now includes --follow-symlinks. The flag is harmless on regular files and critical on symlinks, so there is no reason to omit it.

An architectural test (test/shell.d/sed-follow-symlinks-test.sh) enforces the rule in CI — any new bare sed -i in bin/ or migrations/ will fail the build. Agent instructions in AGENTS.md and agents/skills/migrations.md are updated with the guidance.

Thanks!

Copilot AI balanced review requested due to automatic review settings August 17, 2026 19:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Enforces symlink-safe in-place edits by standardizing on sed -i --follow-symlinks and adding a CI-style shell test to prevent regressions.

Changes:

  • Added a shell test that flags sed -i usages missing --follow-symlinks in bin/ and migrations/ (with an allowlist).
  • Updated multiple scripts and migrations to use sed -i --follow-symlinks.
  • Documented the rule in contributor/agent guidance docs.

Reviewed changes

Copilot reviewed 11 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/shell.d/sed-follow-symlinks-test.sh New test to detect non-symlink-safe sed -i usage in relevant paths.
migrations/1786782461.sh Use --follow-symlinks when fixing foot.ini.
migrations/1786380259.sh Use --follow-symlinks for main.conf edit.
migrations/1785944594.sh Use --follow-symlinks for limine.conf edit.
migrations/1785273276.sh Use --follow-symlinks for mkinitcpio/modules config edits.
migrations/1784818437.sh Use --follow-symlinks when inserting PAM gate.
migrations/1784476564.sh Use --follow-symlinks when editing hooks config.
migrations/1784401744.sh Use --follow-symlinks for tmux config edits.
migrations/1780057136.sh Use --follow-symlinks for Alacritty/Ghostty config edits.
bin/omarchy-toggle-hybrid-gpu Preserve symlinks when editing /etc/supergfxd.conf.
bin/omarchy-setup-security-fingerprint Preserve symlinks when editing PAM files.
bin/omarchy-setup-security-fido2 Preserve symlinks when editing PAM files.
bin/omarchy-restart-audio Preserve symlinks when editing WirePlumber state files.
bin/omarchy-remove-service-sunshine Preserve symlinks when editing Hyprland autostart file.
bin/omarchy-remove-security-fingerprint Preserve symlinks when removing PAM entries.
bin/omarchy-remove-security-fido2 Preserve symlinks when removing PAM entries.
bin/omarchy-plugin-clone Preserve symlinks when rewriting plugin references.
bin/omarchy-install-gaming-retroarch Preserve symlinks when editing RetroArch config.
bin/omarchy-install-gaming-lutris Preserve symlinks when patching Lutris shebang.
bin/omarchy-install-dev-env Preserve symlinks when enabling PHP extensions.
bin/omarchy-hyprland-monitor-scaling Preserve symlinks when editing monitors.lua.
bin/omarchy-hibernation-setup Preserve symlinks when editing hibernation drop-in.
bin/omarchy-hibernation-remove Preserve symlinks when editing /etc/fstab.
bin/omarchy-font-set Preserve symlinks when editing terminal configs.
bin/omarchy-display-text-size Preserve symlinks when editing terminal configs.
agents/skills/migrations.md Documented sed -i --follow-symlinks requirement + referenced enforcing test.
AGENTS.md Added “Symlink-safe file editing” guidance and pointed to enforcing test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 17, 2026 19:08
@calebdw
calebdw force-pushed the calebdw/push-wuzmqnkuvyon branch from cf127ee to bf0f387 Compare August 17, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 27 changed files in this pull request and generated no new comments.

Suppressed comments (2)

test/shell.d/sed-follow-symlinks-test.sh:35

  • The grep -v -- '--follow-symlinks' filter is overly broad and can cause false negatives (e.g., a violating sed -i line that merely mentions --follow-symlinks in an inline comment or string literal will be excluded). Prefer doing the --follow-symlinks check inside the loop against the code portion of the line (e.g., strip inline comments first), and only add a violation when the actual sed invocation lacks the flag.
while IFS=: read -r file lineno line; do
  local_line="${line#"${line%%[![:space:]]*}"}"
  [[ $local_line == \#* ]] && continue
  is_allowlisted "$file" && continue
  violations+=("${file#$ROOT/}:$lineno")
done < <(grep -rEn 'sed[[:space:]]+-i([[:space:]]|$)' "$ROOT/bin" "$ROOT/migrations" | grep -v -- '--follow-symlinks' || true)

test/shell.d/sed-follow-symlinks-test.sh:15

  • The allowlist entries are currently undocumented, but the header comment implies these are safe because they operate on temp/staging directories. Adding a brief comment per allowlisted path explaining why bare sed -i is acceptable there will make future maintenance/audits much easier.
ALLOWLIST=(
  bin/omarchy-dev-pkg-test
  bin/omarchy-plymouth-set
  bin/omarchy-upgrade-to-quattro
)

@patrickdet

Copy link
Copy Markdown

Still reproduces on quattro @ e989b5b3, and there's a new argument for this PR: the tree has started converging on the same fix piecemeal.

#10605 (4cb9c75a, "Move Kitty defaults into the system config", 7 Sep) added sed --follow-symlinks — but only on the Kitty branch of the two font commands. The Alacritty, Ghostty and Foot branches sitting right next to it are still bare, so a Stow/chezmoi user currently gets symlink-safe edits for one terminal out of four:

bin/omarchy-font-set:30            sed -i ...                    ~/.config/alacritty/alacritty.toml
bin/omarchy-font-set:37            sed --follow-symlinks -i ...  ~/.config/kitty/kitty.conf     <- fixed by #10605
bin/omarchy-font-set:45            sed -i ...                    ~/.config/ghostty/config
bin/omarchy-font-set:50            sed -i ...                    ~/.config/foot/foot.ini
bin/omarchy-display-text-size:140  sed -i ...                    ~/.config/alacritty/alacritty.toml
bin/omarchy-display-text-size:146  sed --follow-symlinks -i ...  ~/.config/kitty/kitty.conf     <- fixed by #10605
bin/omarchy-display-text-size:154  sed -i ...                    ~/.config/ghostty/config
bin/omarchy-display-text-size:159  sed -i ...                    ~/.config/foot/foot.ini

That commit is also what put this PR into conflict. Merging current quattro into the branch conflicts in exactly three files:

  • bin/omarchy-font-set
  • bin/omarchy-display-text-size
  • bin/omarchy-toggle-hybrid-gpu

The first two are just the Kitty lines that this PR and #10605 both rewrote, so the resolution is mechanical.

Worth noting why this one bites harder than most: the failure is silent and points the wrong way. sed replaces the symlink with a regular file, so ~/.config gets the new value while the dotfiles repo keeps the old one and git status stays clean. Nothing looks wrong until a fresh machine stows the stale value back.

Minimal repro:

tmp=$(mktemp -d); mkdir -p "$tmp/repo" "$tmp/cfg"
printf 'family = "Old"\n' >"$tmp/repo/alacritty.toml"
ln -s "$tmp/repo/alacritty.toml" "$tmp/cfg/alacritty.toml"

# bin/omarchy-font-set:30, verbatim
sed -i 's/family = ".*"/family = "New"/g' "$tmp/cfg/alacritty.toml"

test -L "$tmp/cfg/alacritty.toml" && echo "link kept" || echo "link destroyed"
cat "$tmp/repo/alacritty.toml"   # still family = "Old"
link destroyed
family = "Old"

#7625 is the same bug reported from the user side against omarchy-hyprland-monitor-scaling and a symlinked monitors.lua.

Happy to push a rebase if that would help move this along.

Without --follow-symlinks, GNU sed writes a temp file and renames it
over the target, replacing any symlink with a regular file. This
silently breaks dotfile setups that symlink configs from a
version-controlled repository (GNU Stow, chezmoi, yadm, etc.).

Every sed -i call across bin/ and migrations/ now includes
--follow-symlinks. The flag is harmless on regular files and critical
on symlinks, so there is no reason to omit it.

An architectural test (test/shell.d/sed-follow-symlinks-test.sh)
enforces the rule in CI — any new bare sed -i in bin/ or migrations/
will fail the build. Agent instructions in AGENTS.md and
agents/skills/migrations.md are updated with the guidance.
@calebdw
calebdw force-pushed the calebdw/push-wuzmqnkuvyon branch from bf0f387 to 41b0498 Compare September 7, 2026 13:46
@calebdw

calebdw commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, I've rebased 👍

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
omarchybot and others added 5 commits September 28, 2026 06:52
omarchy-install-dev-env no longer edits php.ini on quattro (PHP moved to mise), so the conflict resolves to quattro's side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…anch

Six in-place edits landed on quattro after this branch was cut, and sed-follow-symlinks-test fails on each once the two are merged. The xcompose and mise edits touch files under the home directory, exactly where a dotfile manager's symlink lives.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ow-symlinks

Both tests pin the exact sed command line, so they reject the flag this branch adds everywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The removal only reaches sed when the host's PAM files carry pam_u2f.so, so the old four-argument pin passed on machines without FIDO2 and failed on those with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified at 13444f3 against quattro 324f0ba.

The bug is real. On a fresh Omarchy worker, with ~/.config/foot/foot.ini symlinked into a dotfiles directory, omarchy-font-set on quattro replaced the symlink with a regular file and the dotfile kept the old font. On this branch the link survived and the dotfile got the new font. With --follow-symlinks removed from that one script again, the link was replaced once more.

What I pushed to your branch (merge commits, no rebase or force push):

  • A merge of quattro. The one conflict was bin/omarchy-install-dev-env, which no longer edits php.ini on quattro, so it takes quattro's side.
  • --follow-symlinks on the six sed -i calls quattro gained after your branch point (bin/omarchy-toggle-hybrid-gpu and five migrations), which the new lint otherwise fails on.
  • The sudo stubs in test/shell.d/security-fido2-test.sh and security-fido2-remove-test.sh, and the ordering check in unowned-system-paths-test.sh, updated to the new sed argv. The removal stub only fails on a machine whose PAM files carry pam_u2f.so, so it passes on most machines and fails on the ones with FIDO2 set up.

Tests, on the worker: test/cli and the full test/shell.d suite have the same failures on this branch as on quattro itself: the vscode theme assertions in test/cli (#13131) and seven shell test files, none of which this branch touches. Nothing new fails. I also added a bare sed -i to a scratch script under bin/, and sed-follow-symlinks-test.sh caught it.

Second opinion: Codex Medium reviewed the branch over three rounds. It found the stale stub in security-fido2-remove-test.sh, which is fixed above, and its last round, at this head, found nothing open. It can read this session's working files, so its agreement is not guaranteed to be independent.

Some things are left as they are, for you or the maintainer to decide, because none of them breaks anything today:

  • sed-follow-symlinks-test.sh:35 misses sed -Ei, sed -E -i and sed -i.bak, and passes if grep itself errors.
  • Its allowlist calls bin/omarchy-upgrade-to-quattro a staging edit, but that script edits live /boot/limine.conf and /etc/pam.d/*. A symlinked /etc/pam.d/system-auth still gets replaced there, just as it does on quattro today.
  • AGENTS.md calls the flag harmless on regular files. That is true, but on a symlink it now writes through to the target, which for a shared PAM file means every service that links to it.

This now waits on the maintainer.

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 11, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro moved on and this stopped merging cleanly, so I brought it up to date again at a0ccbdd, tested against quattro e71a816. It merges cleanly now.

What I pushed to your branch (a merge commit and two small commits, no rebase or force push):

  • A merge of quattro. The one conflict was AGENTS.md, where quattro added a Background Work section in the same place as your Symlink-safe file editing section; both are kept.
  • --follow-symlinks on the sed -i calls quattro gained since the last merge, which sed-follow-symlinks-test.sh fails on: bin/omarchy-theme-set-glass (both calls, since they edit the same theme file), migrations/1791705142.sh, migrations/1791722809.sh, and the /etc/pam.d/polkit-1 rewrite in migrations/1788256455.sh. That one gets the flag for the same reason as the other PAM edits on this branch. sed still renames a complete file into place, so the migration still never leaves a truncated file.

Tests, on a fresh Omarchy worker: the reproduction still holds against the new base. With ~/.config/foot/foot.ini symlinked into a dotfiles directory, omarchy-font-set on quattro replaced the link and left the dotfile on the old font. On this branch the link survived and the dotfile got the new font. With the flag removed from that script again, the link was replaced once more. omarchy-theme-set-glass showed the same thing for a symlinked theme foot.ini: on quattro the link was replaced, and on this branch it was kept through glassy on and off. test/cli passes on both. In the full test/shell.d suite, every file that fails on this branch also fails on quattro itself or flakes on both. That includes unowned-system-paths-test.sh, which fails on the same four unpackaged polkit policy files on both. sed-follow-symlinks-test.sh and the fido2, polkit and herdr migration tests pass.

Second opinion: none this time. The day's budget of reviews had run out, so these new commits have only had one model's review (Claude Opus 5.5). For that reason this is labelled verified but not ready. A review of this head comes next.

#7625 reports the same symlink problem from a user's side for omarchy-hyprland-monitor-scaling. This branch fixes that part, but not the other two symptoms that issue describes, so it is not marked as closing it.

The three points from the last comment still stand for you or the maintainer to decide: the lint misses sed -Ei and sed -i.bak forms, bin/omarchy-upgrade-to-quattro stays on the allowlist although it edits live /boot and /etc/pam.d files, and following a link now writes through to its target.

This waits on a second-opinion review, then on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge, with three previous lower-impact findings still open.

Findings

  1. P2 Unsafe edits escape the check ▶
  2. P2 Backups lose the original contents ▶
  3. P2 Required error checks are missing ▶

Summary

Adds --follow-symlinks to in-place sed edits across commands and migrations so edits preserve config links.

  • Omarchy edits linked configuration files without replacing their symlinks.
  • New script edits are checked for symlink-safe sed -i use.

Reviews (4) · Last reviewed commit: "Merge quattro into fix/sed-follow-symlin..." · Reviewed by Greptile

[[ $local_line == \#* ]] && continue
is_allowlisted "$file" && continue
violations+=("${file#$ROOT/}:$lineno")
done < <(grep -rEn 'sed[[:space:]]+-i([[:space:]]|$)' "$ROOT/bin" "$ROOT/migrations" | grep -v -- '--follow-symlinks' || true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unsafe edits escape the check

The search misses valid in-place commands such as sed -Ei '...' "$config" and sed -i.bak '...' "$config". Both can replace a symlink, but neither matches this pattern. Future unsafe config edits can therefore pass unnoticed. Match combined options and backup suffixes too, and add fixtures for these forms.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
omarchybot and others added 3 commits October 31, 2026 20:59
# Conflicts:
#	bin/omarchy-hyprland-monitor-scaling

quattro moved monitor scale persistence out of this script into omarchy-hyprland-monitor-persist, which writes its own state file rather than monitors.lua, so quattro's side is taken and the two sed -i calls this branch flagged are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st merge

omarchy-kernel, omarchy-locale-generate and migrations 1790984700, 1791769486 and 1791898365 arrived with bare sed -i, which sed-follow-symlinks-test.sh fails on. Their targets are root-owned (/etc/default/limine, /etc/locale.gen, the limine config and drop-in), and the root runs of both commands ignore path overrides, so following a link there only reaches where root put it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From omacom#14343: link the stock alacritty, Ghostty and foot configs from a dotfiles directory, run the real omarchy-font-set and omarchy-display-text-size, and check the links survive and the edits land in their targets. sed-follow-symlinks-test.sh only checks the flag is spelled; this fails on quattro for the reason the fix exists. It extends the test that already drives both commands rather than adding a file.

Co-Authored-By: Ali Yahya <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro moved on and this stopped merging cleanly again, so I brought it up to date at 5c95af2, tested against quattro e4fffc6. It merges cleanly now.

What I pushed to your branch (no rebase or force push):

  • A merge of quattro. The one conflict was bin/omarchy-hyprland-monitor-scaling. quattro moved scale persistence out of that script into omarchy-hyprland-monitor-persist, which writes its own state file rather than monitors.lua, so I took quattro's side. The two sed -i calls this branch had flagged there no longer exist.
  • --follow-symlinks on the seven bare sed -i calls quattro gained since the last merge, which sed-follow-symlinks-test.sh fails on: bin/omarchy-kernel, bin/omarchy-locale-generate, and migrations 1790984700, 1791769486 and 1791898365 (three calls). All of them edit root-owned files, and the root runs of both commands ignore path overrides, so following a link there only reaches where root put it.
  • A behavioural test from Keep symlinked terminal configs linked when changing font or text size #14343 by @alive-zk, credited as co-author. Keep symlinked terminal configs linked when changing font or text size #14343 fixes the same six sed -i calls in omarchy-font-set and omarchy-display-text-size, and this branch covers those and more, so this one is the one carried forward. Its test was the part this branch lacked. It symlinks the stock alacritty, Ghostty and foot configs from a dotfiles directory, runs the real font and text-size commands, and checks that the links survive and the edits land in the targets. It goes into test/shell.d/kitty-config-test.sh, which already drives both commands, instead of a new file.

Tests, on a fresh Omarchy worker:

  • Reproduction: with ~/.config/foot/foot.ini symlinked into a dotfiles directory, omarchy-font-set replaced the link on quattro and left the dotfile on the old font. On this branch the link survived and the dotfile got the new font. With the flag removed again, the link was replaced. omarchy-theme-set-glass showed the same for a symlinked theme foot.ini, with glassy on and off.
  • Folded test: the new kitty-config-test.sh case fails on quattro and with the fix reverted, and passes here.
  • Suites: test/cli passes on both. In the full test/shell.d suite, five files fail here (agent-account-exec, ascii, branding-about-animation, first-run, runtime-smoke); all five also fail on quattro itself, and this branch does not touch them. omarchy-kernel-test, locale-sudoers-test, sudoers-test, install-language-test and sed-follow-symlinks-test pass.

Second opinion: Codex Medium and muse-wonder (pi, thinking high) both reviewed this head and found no runtime defect in the new commits or the rest of the change, and found no sed -i in any spelling still editing a user file without the flag. They agreed with my reading; their independence is not guaranteed. Both also chose this pull request over #14343 and suggested folding in its test. Both raised one point on their own that is not mine to settle: sed-follow-symlinks-test.sh greps the source for the flag. quattro's AGENTS.md Tests section now asks for the opposite, so whether to keep the lint is a call for the maintainer. Its narrow pattern (it misses sed -Ei, sed -E -i, sed -i.bak and --in-place) and the omarchy-upgrade-to-quattro allowlist entry still stand from the earlier comments.

Before merging, the maintainer also has two scope questions to decide. This branch edits migrations that have already shipped, which quattro's rules call frozen. It also flags sed -i calls on root-only system files, where the flag changes nothing for users who don't symlink them.

This is verified and waits on the maintainer.

Comment thread migrations/1788256455.sh
# hardware-auth (gate / pam_fprintd / pam_u2f) lines exactly as they are.
# sed -i renames a complete file into place, so an interrupted run never leaves polkit-1 truncated.
if ! sudo sed -i -E 's/^(auth|account|password|session)([[:space:]]+)required[[:space:]]+pam_unix\.so[[:space:]]*$/\1\2include system-auth/' "$polkit"; then
if ! sudo sed -i --follow-symlinks -E 's/^(auth|account|password|session)([[:space:]]+)required[[:space:]]+pam_unix\.so[[:space:]]*$/\1\2include system-auth/' "$polkit"; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Backups lose the original contents

If /etc/pam.d/polkit-1 is a symlink, cp -a saves another link to the same target, not a copy of its contents. The new --follow-symlinks edit changes that target, so the advertised backup contains the edited contents too. Copying it back cannot undo the change.

The /etc/fstab backups in both hibernation commands have the same problem. Copy the target's contents when making these backups so users can recover the original file.

With sed --follow-symlinks the edit lands on the link's target, so a cp -a backup, which copies the link itself, aliases the edited file and cannot restore the original. cp -aL copies the target's contents; on a regular file it behaves exactly as cp -a. Raised by Greptile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@@ -0,0 +1,43 @@
#!/bin/bash

source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Required error checks are missing

The new test omits set -euo pipefail, which the testing guide requires at the start of every shell test. Add it before sourcing base-test.sh to enable the required checks for failed commands and unset variables. This repository requirement must be satisfied before merging.

Suggested change
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"

File Used: docs/testing.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot

Copy link
Copy Markdown
Collaborator

Greptile's review comment on migrations/1788256455.sh is right, and this branch introduced the problem, so I fixed it in ff8bf2f.

What was wrong: two places back up a file with cp -a and then edit it with sed -i --follow-symlinks: the polkit migration (/etc/pam.d/polkit-1) and omarchy-hibernation-remove (/etc/fstab). cp -a copies a symlink as a symlink. Now that the edit writes through the link to its target, a backup of a symlinked file points at the edited file, so it can't restore the original. On quattro, bare sed -i replaced the link with a new file and left the target alone, so the backup still held the original.

What I pushed: cp -a → cp -aL in those two backups. That copies the target's contents. On a regular file it does exactly what cp -a did.

Tested on a fresh Omarchy worker, with a symlinked polkit-1 run through the migration:

  • On quattro the link is replaced, and the backup holds the original.
  • At the previous head, 5c95af2, the link survives, but the backup is a link to the edited file.
  • At ff8bf2f the link survives and the backup holds the original.
  • The migration's restore step (cp -a "$backup" "$polkit") writes back through the link to its target.

test/cli passes. The full test/shell.d suite has the same five failures as before, all of which also fail on quattro.

omarchy-hibernation-setup has the same kind of cp -a /etc/fstab backup, but it appends with tee -a, which already followed the link on quattro. That one predates this pull request, so I left it alone.

Second opinion: Codex Medium and muse-wonder (pi, thinking high) reviewed the change and found nothing to change. They agreed the regression is real in both places, that cp -aL fixes it, that the restore step still works, and that the hibernation-setup case is pre-existing. They agreed with my reading, and their independence is not guaranteed.

The scope and lint questions from my last comment still stand. This is verified again at ff8bf2f and waits on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
The one conflict was bin/omarchy-font-set, where omacom#6958 now preserves foot's existing font size. Kept that and put --follow-symlinks on its sed -i, so a symlinked foot.ini stays linked as the rest of this branch intends. No other bare sed -i arrived with the merge.
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro moved on and this stopped merging cleanly again, so I merged quattro d367a56 into your branch as 9721b54 (no rebase or force push). It merges cleanly now.

The one conflict was in bin/omarchy-font-set. #6958 now keeps the size foot already has instead of resetting it to 9. I kept that and added --follow-symlinks to its sed -i, so a symlinked foot.ini stays linked and keeps its size. None of the other 37 new commits on quattro add a bare sed -i in bin/ or migrations/.

Tested on a fresh Omarchy worker, with a symlinked foot.ini at size=11 run through omarchy-font-set:

  • On quattro, and at this head with --follow-symlinks removed again, the link is replaced by a regular file and the dotfile is not updated.
  • At 9721b54 the link survives, the dotfile gets the new font, and the size stays 11.

kitty-config-test and sed-follow-symlinks-test fail on quattro and on the stripped tree, and pass at 9721b54. test/cli passes. The full test/shell.d suite has five failing files at this head (agent-account-exec, ascii, branding-about-animation, first-run, runtime-smoke), and all five also fail on quattro.

Second opinion: Codex Medium reviewed the merge and found nothing to change. It confirmed the resolution keeps both #6958's behaviour and the flag. It also found no new bare sed -i from quattro, including forms the lint's pattern would miss, and no auto-merged file that combined badly. It agreed with my reading, and its independence is not guaranteed.

The scope and lint questions from my earlier comments are unchanged. This is verified at 9721b54 and waits on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This no longer merges into quattro at 4d64235. The two conflicts are in bin/omarchy-toggle-hybrid-gpu and test/shell.d/unowned-system-paths-test.sh: the base branch moved the GPU implementation to omarchy-device-gpu-hybrid and made the old command an alias, while this branch still changes the implementation and assertions under the old name.

The scope decision from the earlier review is still outstanding. A focused fix would preserve linked user configs in the runtime commands and keep the behavioural coverage already added to kitty-config-test.sh. This branch also changes shipped migrations and privileged system-file edits, adds a repository-wide editing rule, and introduces a source-grep test that the current AGENTS.md Tests section says to avoid. Keeping those parts adds review and maintenance work beyond the user-config fix; any broader policy change should be considered separately, with shipped migrations left frozen.

Codex High reviewed this round by reading the current diff, review comments, base-branch rules and the conflicting merge result. No code was pushed, and no worker tests or second code review ran this round because the scope decision stops further work. The earlier worker evidence was against quattro d367a56 and does not verify integration with the current base. This waits on the maintainer to decide the scope before the conflicts are resolved and the result is tested again.

@dhh

dhh commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thank you @calebdw! Symlink preservation in bin/omarchy-font-set landed in #19969, and the remaining runtime user-config --follow-symlinks fixes (omarchy-display-text-size, omarchy-theme-set-glass, omarchy-remove-service-sunshine, omarchy-install-gaming-retroarch) plus behavioral tests have been extracted with credit into #20002. Frozen shipped migrations, privileged /etc/ edits, and the source-grep lint test were intentionally left out per AGENTS.md.

@dhh dhh closed this Nov 24, 2026
@calebdw
calebdw deleted the calebdw/push-wuzmqnkuvyon branch November 24, 2026 07:21
dhh added a commit that referenced this pull request Nov 24, 2026
…troArch commands (#20002)

* Preserve symlinked user configs in text-size, glass, Sunshine, and RetroArch commands

Extracted from #14343 and #7309 on top of #19969.

Co-authored-by: Ali Yahya <[email protected]>
Co-authored-by: Caleb White <[email protected]>

* Write through symlinked shell.toml in omarchy-display-text-size

Co-authored-by: Ali Yahya <[email protected]>
Co-authored-by: Caleb White <[email protected]>

---------

Co-authored-by: Ali Yahya <[email protected]>
Co-authored-by: Caleb White <[email protected]>
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 24, 2026
…troArch commands (omacom#20002)

* Preserve symlinked user configs in text-size, glass, Sunshine, and RetroArch commands

Extracted from omacom#14343 and omacom#7309 on top of omacom#19969.

Co-authored-by: Ali Yahya <[email protected]>
Co-authored-by: Caleb White <[email protected]>

* Write through symlinked shell.toml in omarchy-display-text-size

Co-authored-by: Ali Yahya <[email protected]>
Co-authored-by: Caleb White <[email protected]>

---------

Co-authored-by: Ali Yahya <[email protected]>
Co-authored-by: Caleb White <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants