test: lab 30 checks that each tier has its own chezmoi state
The private init's --persistent-state (chezmoistate-private.boltdb) and its
unit assertion landed in 06b03c9. chezmoi keeps its state next to the config
file, so the tiers used to share chezmoistate.boltdb and each wrote its
config-template hash over the other's: after the private init every public
command warned "config file template has changed".
Lab 30 now asserts the private state file exists, private.toml names it, and
neither tier warns and both statuses are clean after both inits. The fake
private tier is resynced with the real template and cmp alias.
This commit is contained in:
1 parent
0279d4a5d0
commit
28bcea9850
3 files changed
+43
-3
No files matched your search
@@ -43,6 +43,7 @@
|
||||
# ~/.config/chezmoi/chezmoi.toml
|
||||
# private dotup, --source ... -c .../private.toml -> ~/.local/share/dotfiles-private
|
||||
# ~/.config/chezmoi/private.toml
|
||||
# ~/.config/chezmoi/chezmoistate-private.boltdb
|
||||
#
|
||||
# The -c is not cosmetic. Both tiers used to render their .chezmoi.toml.tmpl to
|
||||
# the same default path, so re-running the PUBLIC installer overwrote the config
|
||||
@@ -51,10 +52,17 @@
|
||||
# politely when their data is missing, so the first symptom was `git commit` not
|
||||
# knowing who you are, days later and unconnected to the install that caused it.
|
||||
#
|
||||
# -S and -c must stay in step with dotup's PRIV_SRC and PRIV_CFG. If you move one,
|
||||
# move the other, or cmp reads a config that describes a different source tree.
|
||||
# The --persistent-state is the same lesson for chezmoi's state file: shared, each
|
||||
# tier overwrote the other's config-template hash, and the public tier warned
|
||||
# "config file template has changed" after every private command. private.toml
|
||||
# names this file too, but `cmp init` opens the state before it rewrites that, so
|
||||
# the alias has to carry it.
|
||||
#
|
||||
# -S, -c and --persistent-state must stay in step with dotup's PRIV_SRC, PRIV_CFG
|
||||
# and PRIV_STATE. If you move one, move the others, or cmp reads a config that
|
||||
# describes a different source tree.
|
||||
alias cm='chezmoi'
|
||||
alias cmp='chezmoi -S ${XDG_DATA_HOME:-$HOME/.local/share}/dotfiles-private -c ${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/private.toml'
|
||||
alias cmp='chezmoi -S ${XDG_DATA_HOME:-$HOME/.local/share}/dotfiles-private -c ${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/private.toml --persistent-state ${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/chezmoistate-private.boltdb'
|
||||
|
||||
# Refresh ~/.config/zsh/secrets.zsh from Bitwarden Secrets Manager on demand.
|
||||
# `cmp apply` does the same thing via run_after_50-secrets.sh.
|
||||
|
||||
Reference in new issue
Block a user