Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,22 @@ History needs a `git` binary (on macOS, the Xcode Command Line Tools). Without
one, `mise dot save` fails and bootstrap commands still run, recording
their journals without content; `mise dot status` says so.

`settings.history.enabled` defaults to `true`. Disabling it stops automatic
capture; it does not delete committed history.
`settings.history.enabled` defaults to `true`, but history only records once you opt in
by tracking files (`mise dot track`, a `[dotfiles]` declaration in your global or system
configuration, or an adopted setup repository). Config that arrives any other way (a
`git clone`, a dotfile manager, Nix) activates it the same way, so nothing needs to be
written to enable it. Setting it to `false` stops automatic capture and explicit saves;
it does not disable browsing history or changing checkpoint descriptions, and it does not
delete committed history.

A bootstrap with nothing tracked and no existing history does not create history state or
take the history lock until it first rewrites a dotfile or edit, and then it does not wait
for, or fail on, another mise process using the same `$MISE_STATE_DIR` (parallel CI jobs, for
example): it warns and runs without its private write-recovery journal. Runs that record
history do wait, up to 30 seconds. A run that declares tracking only while it runs waits at the
end and, if the lock stays busy (or an earlier write already ran without the journal), warns
that its outcome was not recorded. Give each CI job its own `MISE_STATE_DIR`, or set
`MISE_HISTORY_ENABLED=false`, if they should never interact.

Keep your repository and decryption identities recoverable independently.
Repository authentication and an age identity serve different purposes:
Expand Down
8 changes: 8 additions & 0 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,14 @@ explicitly commits tracked changes. Git history lives under `$MISE_STATE_DIR/his
`mise bootstrap dotfiles history` lists and compares its file versions. Bootstrap without
tracking does not start a committed history, and dry runs never record. Set to `false` to
turn recording off without deleting existing commits.

A bootstrap that records no history (nothing tracked, no existing history) touches the history
state only when it first rewrites a dotfile or edit, to keep a private write-recovery journal.
If another history operation in the same `$MISE_STATE_DIR` holds the lock at that point, it warns
and runs without the journal instead of failing. Runs that record history wait up to 30 seconds,
then fail. A run that starts with nothing to record but declares tracking before it ends waits the
same 30 seconds at the end; if the lock is still busy, or an earlier write already ran without the
journal, it warns that its outcome was not recorded and keeps its result.
"""
env = "MISE_HISTORY_ENABLED"
type = "Bool"
Expand Down
2 changes: 1 addition & 1 deletion src/system/history/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ pub(crate) fn begin_changes_with(
item: &str,
paths: impl IntoIterator<Item = (PathBuf, Capture)>,
) -> Result<Vec<PendingChange>> {
if !super::scope::is_active() {
if !super::scope::ensure_started()? {
return Ok(vec![]);
}
let mut pending = vec![];
Expand Down
Loading
Loading