Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(bootstrap): scope forced dotfile conflicts#10410

Merged
jdx merged 5 commits into
mainfrom
codex/bootstrap-force-dotfiles
Jun 13, 2026
Merged

fix(bootstrap): scope forced dotfile conflicts#10410
jdx merged 5 commits into
mainfrom
codex/bootstrap-force-dotfiles

Conversation

@jdx

@jdx jdx commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • add mise bootstrap --force-dotfiles for explicitly replacing conflicting whole-file dotfile targets during bootstrap
  • allow symlink dotfiles to replace an existing regular file without force when the content is identical
  • make dotfile conflict hints caller-specific and document the bootstrap behavior

Tests

  • cargo fmt --all -- --check
  • mise run render:usage
  • mise run test:e2e e2e/cli/test_bootstrap
  • mise run test:e2e e2e/cli/test_dotfiles_files

Note

Medium Risk
Changes filesystem overwrite behavior during bootstrap and dotfile apply; mistakes could replace local files, though defaults remain conservative and force is explicit.

Overview
Adds mise bootstrap --force-dotfiles so the bootstrap dotfiles step can replace conflicting whole-file targets only when you opt in; without it, bootstrap still errors on conflicts and points you at --force-dotfiles or mise dotfiles apply --force.

Symlink apply now treats an existing regular file as a non-conflict when its bytes match the source, and replaces it with the symlink without --force; differing content still requires force. Conflict messages use a caller-specific force_hint on ApplyOpts instead of always saying --force.

Docs, usage spec, man page, and shell completions are updated; e2e tests cover bootstrap force behavior, identical-file symlink convergence, and OS-conditional launchd status expectations.

Reviewed by Cursor Bugbot for commit 4373c06. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added --force-dotfiles to allow overwriting conflicting whole-file dotfile targets.
    • Refined symlink conflict handling: on non-Windows platforms, identical file contents are converted to symlinks without requiring force.
  • Documentation

    • Updated help text, man page, CLI completion, and docs with the new flag, examples, and conflict guidance.
  • Tests

    • Expanded e2e tests to cover dotfile conflict handling and bootstrap scenarios.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 28f41f85-b965-4d78-970d-42f2fae5e343

📥 Commits

Reviewing files that changed from the base of the PR and between 66909dd and 4373c06.

📒 Files selected for processing (2)
  • e2e/cli/test_dotfiles_files
  • src/system/files.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • e2e/cli/test_dotfiles_files
  • src/system/files.rs

📝 Walkthrough

Walkthrough

Adds a --force-dotfiles flag to mise bootstrap, threads a force_hint into dotfiles apply/edit flows and system::files, updates help/docs/completion/manpage/examples, and extends e2e tests to cover conflict refusal, forced overwrite, and identical-content symlink convergence.

Changes

Bootstrap --force-dotfiles Feature

Layer / File(s) Summary
User documentation updates
docs/bootstrap.md, docs/dotfiles.md, docs/cli/bootstrap.md
Documents mise bootstrap dotfile conflict behavior, clarifies identical-content regular files can be converted to symlinks, and adds --force-dotfiles examples.
Bootstrap CLI wiring and examples
src/cli/bootstrap.rs
Adds force_dotfiles: bool (--force-dotfiles) to Bootstrap, wires it into system::files::ApplyOpts.force, and updates long-help examples.
Help, manpage, and completion spec
mise.usage.kdl, man/man1/mise.1, xtasks/fig/src/mise.ts
Adds the --force-dotfiles option to usage examples, the command option list, the man page, and Fig completion metadata.
Dotfiles apply/edit force-hint wiring
src/cli/dotfiles/apply.rs, src/cli/dotfiles/edit.rs
Populate ApplyOpts.force_hint with context-specific hint strings when constructing options for whole-file dotfile application.
system::files conflict detection and messaging
src/system/files.rs
Adds ApplyOpts.force_hint, replaces fixed “use --force” text with opts.force_hint, and changes conflict detection to treat identical-content regular files as non-conflicts on non-Windows platforms (with conservative error handling).
End-to-end tests for conflicts and platform behavior
e2e/cli/test_bootstrap, e2e/cli/test_dotfiles_files
Adds tests for platform-specific launchd output, bootstrap refusing to overwrite conflicting dotfiles unless --force-dotfiles, forced overwrite verification, and symlink conversion when destination content matches source.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • jdx/mise#10395: Modifies bootstrap flow around dotfiles and hook phases; related surface area in src/cli/bootstrap.rs.
  • jdx/mise#10365: Earlier work on bootstrap and [system.files] foundations that this PR extends with force handling and refined conflict behavior.

"I'm a rabbit in the repo, hopping light and fleet,
I nudged a flag so conflicted files might meet.
If contents match, a symlink springs anew,
Else whisper 'use force' and I'll wait for you.
Hoppity cheers for tidy dotfiles too!"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a scoped --force-dotfiles flag to bootstrap for controlling dotfile conflict resolution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds mise bootstrap --force-dotfiles so the bootstrap dotfiles phase can replace conflicting whole-file targets on explicit opt-in, while defaulting to a safe refusal. Symlink conflict detection is also refined so a regular file whose bytes match the source is silently converged to a symlink without --force.

  • ApplyOpts gains a force_hint field so each call site (bootstrap, dotfiles apply, dotfiles edit) surfaces its own remediation hint in the conflict error.
  • find_conflicts now reads and compares file contents for non-Windows symlink entries; a size pre-check short-circuits the common differing-content case before a full read.
  • E2e tests cover the new same-content convergence path and the --force-dotfiles bootstrap flow; docs and completions are updated consistently.

Confidence Score: 5/5

Safe to merge; defaults remain conservative and the new --force-dotfiles path requires explicit opt-in.

All three call sites of apply() are updated consistently with caller-specific hints. The same-content convergence path is guarded by a size pre-check and falls back to the conflict error on any read failure. E2e tests exercise both the happy path and the conflict refusal. No pre-existing behaviour changes without explicit flags.

No files require special attention.

Important Files Changed

Filename Overview
src/system/files.rs Core conflict-detection logic updated: same-content regular files no longer trigger a symlink conflict; ApplyOpts gains force_hint; error messages now caller-specific. Logic is sound.
src/cli/bootstrap.rs Adds --force-dotfiles flag and passes it through ApplyOpts; sets caller-specific force_hint; adds help text and example. Straightforward.
src/cli/dotfiles/apply.rs Only change is adding force_hint: "use --force" to ApplyOpts; no logic change.
src/cli/dotfiles/edit.rs Only change is adding force_hint string literal to ApplyOpts; no logic change.
e2e/cli/test_dotfiles_files New test coverage for same-content symlink convergence (should succeed without --force) and different-content conflict (should fail). Both cases are properly asserted.
e2e/cli/test_bootstrap Adds --force-dotfiles bootstrap test and fixes a pre-existing Darwin/non-Darwin branch mismatch in the launchd status assertion.
docs/bootstrap.md Documents default conflict-refusal behaviour and the new --force-dotfiles opt-in.
docs/dotfiles.md Documents same-content convergence behaviour for symlink entries.

Reviews (5): Last reviewed commit: "fix(bootstrap): preserve dotfile conflic..." | Re-trigger Greptile

Comment thread src/system/files.rs Outdated

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
e2e/cli/test_dotfiles_files (1)

154-157: 💤 Low value

Consider adding a comment to document the identical-content convergence behavior.

The new test case at lines 154-157 validates an important new behavior: when a regular file at the target has identical content to the symlink source, mise dotfiles apply succeeds without --force and converts the file to a symlink. Adding a comment before line 154 would clarify this intent and prevent confusion with the comment on line 152, which describes the different-content conflict scenario tested at lines 158-163.

Example:

# identical content: regular file converges to symlink without --force
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/cli/test_dotfiles_files` around lines 154 - 157, Add a clarifying comment
immediately before the test block that starts with the command "cat
dotfiles/gitconfig >~/.gitconfig" to document that this case checks
identical-content convergence (a regular file with identical content is
converted to a symlink without --force); insert a one-line comment such as "#
identical content: regular file converges to symlink without --force" so the
intent is clear and not confused with the adjacent different-content conflict
test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@e2e/cli/test_dotfiles_files`:
- Around line 154-157: Add a clarifying comment immediately before the test
block that starts with the command "cat dotfiles/gitconfig >~/.gitconfig" to
document that this case checks identical-content convergence (a regular file
with identical content is converted to a symlink without --force); insert a
one-line comment such as "# identical content: regular file converges to symlink
without --force" so the intent is clear and not confused with the adjacent
different-content conflict test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e58dbc92-41ff-46b3-8218-2a8604b110c3

📥 Commits

Reviewing files that changed from the base of the PR and between 651130c and 59a9f02.

📒 Files selected for processing (10)
  • docs/bootstrap.md
  • docs/cli/bootstrap.md
  • docs/dotfiles.md
  • e2e/cli/test_bootstrap
  • e2e/cli/test_dotfiles_files
  • mise.usage.kdl
  • src/cli/bootstrap.rs
  • src/cli/dotfiles/apply.rs
  • src/cli/dotfiles/edit.rs
  • src/system/files.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 66909dd. Configure here.

Comment thread src/system/files.rs Outdated
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.6 x -- echo 19.6 ± 0.9 17.6 23.9 1.00
mise x -- echo 20.2 ± 1.5 18.3 46.5 1.03 ± 0.09

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.6 env 19.1 ± 0.9 17.0 23.3 1.00
mise env 19.6 ± 1.0 17.9 23.9 1.03 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.6 hook-env 19.7 ± 0.8 18.0 23.2 1.00
mise hook-env 20.4 ± 1.0 18.5 26.2 1.03 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.6 ls 16.2 ± 0.8 14.6 20.5 1.00
mise ls 16.7 ± 0.9 15.1 20.9 1.04 ± 0.08

xtasks/test/perf

Command mise-2026.6.6 mise Variance
install (cached) 133ms 135ms -1%
ls (cached) 59ms 59ms +0%
bin-paths (cached) 64ms 64ms +0%
task-ls (cached) 127ms 126ms +0%

@jdx jdx merged commit b10d4f0 into main Jun 13, 2026
35 checks passed
@jdx jdx deleted the codex/bootstrap-force-dotfiles branch June 13, 2026 21:36
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