Skip to content

fix(#283): Windows の dotfiles sync を POSIX 版と同等の rules にする (main への switch を追加) - #285

Draft
rebuildup wants to merge 1 commit into
release-0-10-0from
283
Draft

rebuildup wants to merge 1 commit into
release-0-10-0from
283

Conversation

@rebuildup

Copy link
Copy Markdown
Owner

Refs #283

問題

Windows の converge は dotfiles checkout を main に switch しない。

platforms/windows-11/converge.ps1 の Invoke-DotfilesSync は git fetch origin main と git merge --ff-only origin/main のみを Execute するため、checkout が release branch に残っていると merge が必ず失敗し、以降すべての run で dotfiles-sync が error になる。

2026-11-30 実機 (Windows): ~/.dotfiles は release/res-integration にあり、毎時 converge の verify が repos ~/.dotfiles release/res-integration differs を報告し続けていた。POSIX 版の scripts/sync-dotfiles.sh は git switch main してから ff するため、同じ machine-global checkout が OS ごとに別挙動になっていた。

変更

  • scripts/sync-dotfiles.ps1 を追加 (POSIX の scripts/sync-dotfiles.sh と同じ interface / 同じ refusal rule)。
    • 未存在なら clone、git でない path は拒否、origin 不一致は拒否、dirty は拒否 (reset / stash しない)。
    • target ref へ switch してから merge --ff-only。
    • sync 後に script/link.ps1 が存在することを検証。
  • platforms/windows-11/converge.ps1 の dotfiles sync をこの script に委譲 (dirty / origin の事前チェックは converge 側に残し、より具体的な step message を保つ)。
  • scripts/test-sync-dotfiles.ps1: 実 git fixture (bare origin + clone) で以下を検証。release branch に残った checkout が main へ収束する / dirty checkout は拒否され変更が残る / git でない path は拒否され上書きされない。CI (ci.sh / ci.yml) に追加。

検証

  • scripts/test-sync-dotfiles.ps1: 全項目 PASS (ローカル実行)。
  • 実機: ~/.dotfiles が release/res-integration に残っていた状態を、この script で main へ収束させる予定 (適用後の evidence は別 PR / Issue に記載)。

Co-Authored-By: Claude Code noreply@anthropic.com

Windows の converge は dotfiles checkout を `main` に switch しないため、release
branch に残った checkout は `git merge --ff-only origin/main` が常に失敗し、
以降すべての run で dotfiles state が採用されない。実機では `~/.dotfiles` が
`release/res-integration` に残ったまま `repos ~/.dotfiles ... differs` が
報告され続けていた。

- `scripts/sync-dotfiles.ps1` を追加する (POSIX の `scripts/sync-dotfiles.sh` と
  同じ interface / 同じ refusal rule)。
- checkout は target ref へ switch してから ff する。origin 不一致 / dirty /
  git でない path は従来どおり拒否し、reset も stash もしない。
- `platforms/windows-11/converge.ps1` は dotfiles sync をこの script に委譲する。
- `scripts/test-sync-dotfiles.ps1` で実 git fixture に対して検証し、CI に追加。

Co-Authored-By: Claude Code <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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