Repository navigation
fix: install 後も既存ファイルの改行形式を保持する - #63
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
外部コマンドが書いた改行をそのまま採用していたため、Windows では LF のファイルが CRLF になり、更新箇所以外まで差分に出ることがあった。 コマンドの管理対象と Cargo age 監査の受領書を検証した後に、既存の テキストファイルを元の LF または CRLF へ戻す。更新した内容、末尾改行、 権限を保ち、書き戻したバイト列を復元用の追跡状態へ反映する。 新規ファイル、混在改行、バイナリと mise の sidecar は変換しない。 改行を書き戻せない場合は成功扱いにせず、既存の復元処理へ進める。 失敗時も採用済みの生バイト列を追跡し、外部編集の検知を維持する。 Cargo と mise の再書き込み、失敗時の復元、外部編集の保護を検証する 回帰テストを追加し、使い方の英語版と日本語版に保持範囲を記載した。
owayo
force-pushed
the
fix/issue-62-preserve-install-line-endings
branch
from
October 25, 2026 04:55
69e5918 to
73b650d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
--install中の外部コマンドが LF のファイルを CRLF で書き直しても、実行前の改行形式をファイルごとに保持します。Cargo の age 調整と mise の platform lock 補修による再書き込みも対象です。直接のマニフェスト更新は既に改行を保持していましたが、外部コマンドの出力を採用する処理には改行を戻す処理がありませんでした。管理対象ファイルと監査の受領書を検証した後、既存のチェック付きアトミック書き込みで改行を戻し、復元用の追跡状態も更新します。
新規ファイル、元から混在する改行、改行のないファイル、バイナリ、mise の sidecar は変換しません。変換は解決した版・書き込み後の末尾改行・権限を保持し、外部編集の判定には元のバイト列の完全一致を使います。使い方の英語版と日本語版にも保持範囲を追記しました。
検証
make ci: format、clippy、全テスト成功。astro-sight review --git: 公開 API の変更、未解決の影響なし。Closes #62